Skip to content

Commit

Permalink
Try removing another mutation (#7186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored Dec 22, 2023
1 parent 543dc5a commit 35dc300
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 @@ -668,11 +668,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 35dc300

Please sign in to comment.