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

Remove osmomath's dependency on osmoassert & gammtypes #3768

Merged
merged 4 commits into from
Dec 16, 2022

Conversation

ValarDragon
Copy link
Member

What is the purpose of the change

Needed to split osmomath into its own go.mod

This basically involved making an exported var for gammtypes.MaxSpotPrice, and removing Conditional Panic cases. Only affects test files.

@ValarDragon ValarDragon requested a review from p0mvn December 16, 2022 20:15
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Dec 16, 2022
@ValarDragon ValarDragon added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v13.x backport patches to v13.x branch labels Dec 16, 2022
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

LGTM

// but we can't directly import that due to import cycles.
// Hence we use the same var name, in hopes that if any change there happens,
// this is caught via a CTRL+F
var MaxSpotPrice = sdk.NewDec(2).Power(128).Sub(sdk.OneDec())
Copy link
Member

Choose a reason for hiding this comment

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

Would having separate constants or utils package help mitigate the import cycles?

Copy link
Member Author

Choose a reason for hiding this comment

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

It would have to be in its own independent go.mod, which seems pretty annoying for now

osmomath/sigfig_round_test.go Outdated Show resolved Hide resolved
@ValarDragon ValarDragon merged commit db97b16 into main Dec 16, 2022
@ValarDragon ValarDragon deleted the dev/remove_osmomath_osmosis_dep branch December 16, 2022 20:44
mergify bot pushed a commit that referenced this pull request Dec 16, 2022
* Remove osmomath's dependency on osmoassert & gammtypes

* Add note in gamm constant

* Bring pack conditional panic

* One more cond panic

(cherry picked from commit db97b16)
ValarDragon added a commit that referenced this pull request Dec 16, 2022
* Remove osmomath's dependency on osmoassert & gammtypes

* Add note in gamm constant

* Bring pack conditional panic

* One more cond panic

(cherry picked from commit db97b16)

Co-authored-by: Dev Ojha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v13.x backport patches to v13.x branch C:x/gamm Changes, features and bugs related to the gamm module. V:state/compatible/backport State machine compatible PR, should be backported
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants