Skip to content

Commit

Permalink
l -> numTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon committed Apr 20, 2022
1 parent 60f4c35 commit 0b2da2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/gamm/pool-models/stableswap/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ func (pa Pool) getPoolAmts(denoms ...string) ([]sdk.Int, error) {
// denominations in the pool.
// The function sanity checks this, and panics if not the case.
func (p *Pool) updatePoolLiquidityForSwap(tokensIn sdk.Coins, tokensOut sdk.Coins) {
l := p.PoolLiquidity.Len()
numTokens := p.PoolLiquidity.Len()
// update liquidity
p.PoolLiquidity = p.PoolLiquidity.Add(tokensIn...).Sub(tokensOut)
// sanity check that no new denoms were added
if len(p.PoolLiquidity) != l {
if len(p.PoolLiquidity) != numTokens {
panic("updatePoolLiquidityForSwap changed number of tokens in pool")
}
}
Expand Down

0 comments on commit 0b2da2f

Please sign in to comment.