Skip to content

Commit

Permalink
simplify test helper logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpinYukseloglu committed Mar 19, 2024
1 parent 704882d commit a19e98d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions x/concentrated-liquidity/incentives_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2787,14 +2787,10 @@ func (s *KeeperTestSuite) checkForfeitedCoinsByUptime(totalForfeitedCoins sdk.Co
// We unfortunately need to through each coin individually to properly scale down the amount
// (doing it in bulk leads to inconsistent rounding error)
for uptimeIndex := range types.SupportedUptimes {
// Check if the slice at the current uptime index is not empty, then add the coins to the sum
forfeitedCurrentUptime := scaledForfeitedCoinsByUptime[uptimeIndex]
if !forfeitedCurrentUptime.IsZero() {
for _, coin := range forfeitedCurrentUptime {
// Scale down the actual forfeited coin amount
scaledDownAmount := cl.ScaleDownIncentiveAmount(coin.Amount, cl.PerUnitLiqScalingFactor)
forfeitedCoins = forfeitedCoins.Add(sdk.NewCoin(coin.Denom, scaledDownAmount))
}
for _, coin := range scaledForfeitedCoinsByUptime[uptimeIndex] {
// Scale down the actual forfeited coin amount
scaledDownAmount := cl.ScaleDownIncentiveAmount(coin.Amount, cl.PerUnitLiqScalingFactor)
forfeitedCoins = forfeitedCoins.Add(sdk.NewCoin(coin.Denom, scaledDownAmount))
}
}

Expand Down

0 comments on commit a19e98d

Please sign in to comment.