-
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
MultihopEstimateInGivenExactAmountOut
and MultihopEstimateOutGivenExactAmountIn
panic recovering
#4248
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pysel
changed the title
EstimateMultihopIn/Out panic recovering
Feb 7, 2023
MultihopEstimateInGivenExactAmountOut
and MultihopEstimateOutGivenExactAmountIn
panic recovering
pysel
added
V:state/compatible/backport
State machine compatible PR, should be backported
V:state/compatible/no_backport
State machine compatible PR, depends on prior breaks
and removed
V:state/compatible/backport
State machine compatible PR, should be backported
labels
Feb 7, 2023
pysel
force-pushed
the
ruslan/panic-recovering-multihop
branch
from
February 7, 2023 14:26
3f3a16b
to
04be5ff
Compare
p0mvn
reviewed
Feb 7, 2023
p0mvn
reviewed
Feb 7, 2023
p0mvn
approved these changes
Feb 7, 2023
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.
Nice work
p0mvn
added
V:state/breaking
State machine breaking PR
and removed
V:state/compatible/no_backport
State machine compatible PR, depends on prior breaks
labels
Feb 7, 2023
@pysel please add a changelog entry prior to merge |
ValarDragon
approved these changes
Feb 8, 2023
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.
Nice LGTM! Echo the needs changelog
added changelog entry |
mergify bot
pushed a commit
that referenced
this pull request
Feb 8, 2023
…ExactAmountIn` panic recovering (#4248) * add panic recovering to multihop estimate functions * unit test for making sure recovery works as expected * change error message * separate tests * refactoring * refactor * add panic catching to RouteExactAmountOut * add panic catching assertions to existing tests * delete old unit tests * remove fmt * hardcoded stableswap to enum * getSetupPoolsStrategy as a helper function * remove callback return * remove redundant swap fee variable * .String rm * docs fix/rename * typo * typo2 * changelog entry (cherry picked from commit a33893d)
p0mvn
pushed a commit
that referenced
this pull request
Feb 8, 2023
…ExactAmountIn` panic recovering (#4248) (#4258) * add panic recovering to multihop estimate functions * unit test for making sure recovery works as expected * change error message * separate tests * refactoring * refactor * add panic catching to RouteExactAmountOut * add panic catching assertions to existing tests * delete old unit tests * remove fmt * hardcoded stableswap to enum * getSetupPoolsStrategy as a helper function * remove callback return * remove redundant swap fee variable * .String rm * docs fix/rename * typo * typo2 * changelog entry (cherry picked from commit a33893d) Co-authored-by: Ruslan Akhtariev <[email protected]>
6 tasks
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A:backport/v15.x
backport patches to v15.x branch
C:app-wiring
Changes to the app folder
C:x/poolmanager
V:state/breaking
State machine breaking PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #4180
What is the purpose of the change
Panic recovery in
MultihopEstimateInGivenExactAmountOut
andMultihopEstimateOutGivenExactAmountIn
Brief Changelog
Adds a defer statement that cathes panic and returns empty struct corresponding to function's return type. Similar to
https://github.com/osmosis-labs/osmosis/blob/main/x/gamm/keeper/swap.go#L39-L44
Testing and Verifying
Adds unit tests