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

x/gamm: Consider renaming CalcExitPoolShares to CalcExitCoinsFromShares #1905

Closed
AlpinYukseloglu opened this issue Jun 30, 2022 · 2 comments · Fixed by #1970
Closed

x/gamm: Consider renaming CalcExitPoolShares to CalcExitCoinsFromShares #1905

AlpinYukseloglu opened this issue Jun 30, 2022 · 2 comments · Fixed by #1970
Assignees
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:dev-UX

Comments

@AlpinYukseloglu
Copy link
Contributor

AlpinYukseloglu commented Jun 30, 2022

Background

CalcExitPoolShares calculates the expected tokens output by a pool given some number of shares. With the current name, it's not clear whether or not the function calculates the number of shares from output tokens or output tokens from the number of shares, so I think it might be worth considering renaming it to something like CalcExitCoinsFromShares (or something else that better specifies what the function does).

func (p *Pool) CalcExitPoolShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) {

Suggested Design

  • CalcExitPoolShares -> CalcExitCoinsFromShares

Acceptance Criteria

  • All existing and new tests pass
@AlpinYukseloglu AlpinYukseloglu added the C:x/gamm Changes, features and bugs related to the gamm module. label Jun 30, 2022
@AlpinYukseloglu AlpinYukseloglu changed the title Consider renaming CalcExitPoolShares to CalcExitCoinsFromShares x/gamm: Consider renaming CalcExitPoolShares to CalcExitCoinsFromShares Jun 30, 2022
@p0mvn
Copy link
Member

p0mvn commented Jun 30, 2022

I like the idea. Suggest even being more verbose for clarity: CalcExitPoolCoinsFromShares

@AlpinYukseloglu
Copy link
Contributor Author

cc: @ValarDragon @alexanderbez thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:dev-UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants