-
Notifications
You must be signed in to change notification settings - Fork 592
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: remove PokePool from the PoolI interface, define on extension instead #3035
Changes from all commits
6709feb
0758f70
89f17de
77901ca
388b471
900f51b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,10 +79,6 @@ type PoolI interface { | |
// CalcExitPoolCoinsFromShares returns how many coins ExitPool would return on these arguments. | ||
// This does not mutate the pool, or state. | ||
CalcExitPoolCoinsFromShares(ctx sdk.Context, numShares sdk.Int, exitFee sdk.Dec) (exitedCoins sdk.Coins, err error) | ||
|
||
// PokePool determines if a pool's weights need to be updated and updates | ||
// them if so. | ||
PokePool(blockTime time.Time) | ||
} | ||
|
||
// PoolAmountOutExtension is an extension of the PoolI | ||
|
@@ -126,6 +122,19 @@ type PoolAmountOutExtension interface { | |
IncreaseLiquidity(sharesOut sdk.Int, coinsIn sdk.Coins) | ||
} | ||
|
||
// WeightedPoolExtension is an extension of the PoolI interface | ||
// That defines an additional API for handling the pool's weights. | ||
type WeightedPoolExtension interface { | ||
PoolI | ||
|
||
// PokePool determines if a pool's weights need to be updated and updates | ||
// them if so. | ||
PokePool(blockTime time.Time) | ||
Comment on lines
+130
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is poke pool on this? Its more general than for a weighted pool? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the spec and balancer implementation, Stableswap did not have this method implemented, and I don't see why we would need it since there are no weights. So it seems to be weight-specific There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like our current implementation of PokePool only concerns itself with updating weights. Is there some extension of PokePool that is planned that would make it useful for stableswap/concentrated-liquidity pools? |
||
|
||
// GetTokenWeight returns the weight of the specified token in the pool. | ||
GetTokenWeight(denom string) (sdk.Int, error) | ||
} | ||
|
||
func NewPoolAddress(poolId uint64) sdk.AccAddress { | ||
key := append([]byte("pool"), sdk.Uint64ToBigEndian(poolId)...) | ||
return address.Module(ModuleName, key) | ||
|
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.
Note to reviewers: registered stable swap interfaces that are needed for tests.
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.
Applied state breaking label due to this