-
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
refactor(x/swaprouter, x/gamm): unify swap routes in swaprouter #3880
Conversation
While this is not state-breaking, I added the label still to be more careful with this PR as it has an important API break. |
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.
Left one question / concerning point about gamm types. Other then that, looks LGTM
repeated osmosis.swaprouter.v1beta1.SwapAmountOutRoute routes = 3 [ | ||
(gogoproto.moretags) = "yaml:\"routes\"", | ||
(gogoproto.nullable) = false | ||
]; |
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.
We should ask dan lynch and front-end how breaking this is.
Its not clear to me that its worth breaking this in the gamm proto, vs just doing a conversion in the proto boilerplate handling code.
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.
(I think it will break their compiled types, unless we can register a way for a type to get aliased or something in codegen)
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.
as long as the interfaces/API don't change, it doesn't matter where the types live. Telescope will handle it.
from what I can see here it looks the the interface to the type doesn't change, so will be totally ok!
cc @p0mvn
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.
also, even w/o telescope, from what I can tell (since I believe osmosis-fe uses another tool) — nothing should break. But, we should probably all keep in sync when this update rolls out to update FE libs and repos.
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.
Thanks, @pyramation . I also spoke with Jon to make sure that there is no unexpected breakage for FE.
We will track this change and remind everyone to update before this is out.
This should be good to go
Needs changelog entry for breaking changes if you worked with queries via JSON, otherwise LGTM.
(Maybe we can just add a TODO for us to check when we update front-end, may remove it from being marked as breaking, and then it'd just be a misc improvement) Its totally fine for contracts, and an easy update, so LGTM! |
Seems to be JSON serialization compatible based on added test here: 3a46711 |
oh awesome, thats great! |
Closes: #3808
What is the purpose of the change
This PR removes the swap routes in
x/gamm
and refactors all legacyx/gamm
swap messages and methods to utilize the new swap route structs from thex/swaprouter
module.This is done to reduce code duplication and redundant conversions between the different swap routes.
Brief Changelog
x/gamm
swap routes butSwapExactAmountInRoute
x/gamm
swap routes with thex/swaprouter
swap routes.Testing and Verifying
This change added tests and can be verified as follows:
osmosis/x/gamm/types/route_test.go
Line 16 in a3afcda
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes