Skip to content

Commit

Permalink
Try removing another mutation (#7186) (#7189)
Browse files Browse the repository at this point in the history
(cherry picked from commit 35dc300)

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
  • Loading branch information
mergify[bot] and ValarDragon committed Dec 22, 2023
1 parent cc051ad commit a0fd75c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x/incentives/keeper/distribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,11 @@ func (k Keeper) distributeInternal(
denomLockAmt := guaranteedNonzeroCoinAmountOf(lock.Coins, denom)
for _, coin := range remainCoins {
// distribution amount = gauge_size * denom_lock_amount / (total_denom_lock_amount * remain_epochs)
amt := coin.Amount.Mul(denomLockAmt).BigIntMut()
amt = amt.Quo(amt, lockSumTimesRemainingEpochsBi)
coinAmt := osmomath.NewIntFromBigInt(amt)
if coinAmt.IsPositive() {
newlyDistributedCoin := sdk.Coin{Denom: coin.Denom, Amount: coinAmt}
amtInt := coin.Amount.Mul(denomLockAmt)
amtIntBi := amtInt.BigIntMut()
amtIntBi.Quo(amtIntBi, lockSumTimesRemainingEpochsBi)
if amtInt.IsPositive() {
newlyDistributedCoin := sdk.Coin{Denom: coin.Denom, Amount: amtInt}
distrCoins = distrCoins.Add(newlyDistributedCoin)
}
}
Expand Down

0 comments on commit a0fd75c

Please sign in to comment.