-
Notifications
You must be signed in to change notification settings - Fork 607
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
Math Refactor #740
Math Refactor #740
Conversation
Codecov Report
@@ Coverage Diff @@
## main #740 +/- ##
==========================================
+ Coverage 18.73% 20.00% +1.27%
==========================================
Files 172 189 +17
Lines 23908 24559 +651
==========================================
+ Hits 4478 4914 +436
- Misses 18655 18790 +135
- Partials 775 855 +80
Continue to review full report at Codecov.
|
Co-authored-by: Dev Ojha <[email protected]>
…/osmosis into mconcat/curve-math-refactor
|
@@ -124,7 +124,7 @@ func (suite *KeeperTestSuite) TestCleanupPoolRandomized() { | |||
for _, coin := range coinOf[acc.String()] { | |||
amt := suite.app.BankKeeper.GetBalance(suite.ctx, acc, coin.Denom) | |||
// the refund could have rounding error | |||
suite.True(amt.Amount.Equal(coin.Amount) || amt.Amount.Equal(coin.Amount.SubRaw(1)), | |||
suite.True(amt.Amount.Sub(coin.Amount).Abs().LTE(sdk.NewInt(2)), |
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.
Was there an error here, or just pro-actively changing it?
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.
LGTM! Thanks for removing duplicate code on the tests as well! Its nice how much simpler this all is
I think we should get this into the v6.x line, just to ensure that no math broke (I don't think it should have)
* refactor math * factor out normalizedWeight * unify into SolveConstantFunctionInvariant * test in progress * add randomized test * Update x/gamm/keeper/math.go Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: Dev Ojha <[email protected]>
This is on v6.x now, and syncing just fine! |
Swap math functions refactoring PR.
This PR does not (and should not) contain any mathematical level change(except for adding several
Neg()
s), only code level changes.Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer