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.
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: Change Pool API to have separate methods for
JoinPool
andJoinPoolNoSwap
#2133Refactor: Change Pool API to have separate methods for
JoinPool
andJoinPoolNoSwap
#2133Changes from 25 commits
9f86b96
3cb4b3b
654fdf4
019e3e5
1fdf342
5633945
f1a00eb
08d2b8e
eebb7cc
43772e7
79e4232
82ff209
a251f7c
a370c6e
dcbb25a
d9fe736
8806506
1a1509c
20f068e
4797f8f
eda585c
0e5f5fa
1eae187
8b6f485
6147129
0e55e9d
005ae6a
096d5b2
2f53651
d91e0b5
0ef8a99
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 now this method is basically not called in the codebase anywhere, right?
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.
CalcJoinPoolShares
? Do you mean calls outside of the module? Otherwise it's called inJoinPool
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.
But JoinPool is no longer called in the state machien right?
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 might be missing your point here but I believe
JoinPool
is still called inJoinSwapExactAmountIn
:osmosis/x/gamm/keeper/pool_service.go
Line 272 in 16e3e4b
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.
Context:
CalcJoinPoolNoSwapShares
includes this calculation and returns the resultingtokensJoined
aboveThere 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.
Just trying to understand:
Why do you emphasize "no-swap joins"?
CalcJoinPoolNoSwapShares
is called fromCalcJoinPoolShares
which is called from regularJoinPool
that does swaps. I also noticed a similar check nCalcJoinPoolShares
.My point is that it seems that this is relevant for joins with the swaps as well.
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.
This specific function is for no-swap joins, so the errors returned by it specify that it is a no-swap pool join (this specific line wouldn't error if this was a join with swaps)
Even though
CalcJoinPoolNoSwapShares
is still called inCalcJoinPoolShares
, it is called in the "no-swap"/"all-asset"/"exact ratio" join component of it, and all pool join logic related to swaps is handled elsewhere in that functionThere 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.
Awesome, thank you! Just wanted to make sure that this check was intentional to have on the path for regular joins as well