-
Notifications
You must be signed in to change notification settings - Fork 609
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
chore: inverse unit tests for CalcInAmtGivenOut and CalcOutAmtGivenIn with zero swap fee #1254
Conversation
8faa836
to
0b04698
Compare
Codecov Report
@@ Coverage Diff @@
## main #1254 +/- ##
==========================================
- Coverage 20.90% 20.26% -0.64%
==========================================
Files 196 203 +7
Lines 25425 26824 +1399
==========================================
+ Hits 5316 5437 +121
- Misses 19118 20377 +1259
- Partials 991 1010 +19
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what did we find out here? There's a test case commented out in TestJoinSwapExactAmountInConsistency
.
Nothing yet, I'm planning to continue increasing tests / coverage for all methods called within Currently, it's hard to determine where exactly the error is happening because we are missing unit tests for each of the methods called by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrmm interesting. So I think these test cases tell us that running CalcInAmtGivenOut
and CalcOutAmtGiven
straight away returns the correct value we expect, and that the problem is coming from other steps?
It's unclear yet. I have tested with 0 swap fees so far. I'm planning to add the tests with a non-zero swap fee in a separate PR |
Sounds great! Can we address that this is a test for zero fee either in the comment or in the test case name? |
Can we leave this PR in Draft mode to indicate that it's still being worked on? |
Done! I also created an issue to continue with the tests with a non-zero swap fee: #1288 @alexanderbez this is ready for review. I'm trying to work on this in small parts / PRs to make it easier to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌮
Closes: #XXX
Description
Trying to investigate #1196 by incrementally adding more unit tests
These tests do not allow us to conclude anything with regards to #1196 yet. The tests added so far have a swap fee of 0. I'm planning to continue adding unit tests with a non-zero swap fee. Also, test other functionality and methods that are being called in
ExitSwapShareAmountIn
andJoinSwapExactAmountIn
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer