Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: calculate minium receive #6

Closed
wants to merge 2 commits into from

Conversation

meomeocoj
Copy link
Member

  • Add slippage to msg collect_fees

Copy link

github-actions bot commented Mar 15, 2024

badge

Code Coverage Summary

Filename                                    Stmts    Miss  Cover    Missing
----------------------------------------  -------  ------  -------  ----------------------------------------------------
src/contract.rs                               181      12  93.37%   48-51, 60, 74, 155, 232, 248, 299, 312, 347, 410-411
src/helpers.rs                                 12       2  83.33%   13, 36
src/multitest/contract.rs                      29       0  100.00%
src/multitest/contract_ping_pong_mock.rs       21       2  90.48%   64-65
src/multitest/mock_cw20_contract.rs            38       2  94.74%   87-88
src/multitest/mock_router_contract.rs          50       4  92.00%   97, 109, 134-135
src/multitest/tests.rs                         61       0  100.00%
TOTAL                                         392      22  94.39%

Results for commit: 0c5531f

Minimum allowed coverage is 90%

♻️ This comment has been updated with latest results

@@ -191,12 +193,16 @@ pub fn execute_collect_fees(
env: Env,
_info: MessageInfo,
collect_fee_requirements: Vec<CollectFeeRequirement>,
slippage: Option<Uint128>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cái này em thấy thêm slippage không có ý nghĩa mấy anh ạ, vì trong lúc mình thực hiện tx này, do tính chất blockchain nên không có ai xen vào giữa được, thì anh query minimum receive rồi trừ đi slippage ko để làm gì ạ.

Chuẩn là anh phải query minimum receive rồi truyền từ client

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oke anh hiểu đoạn này, giao dịch này đang thực hiện thì k chèn thêm dược thằng khác vào nhỉ, thế chắc phải refactor code một chút rồi.

@meomeocoj meomeocoj closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants