Skip to content

Commit

Permalink
fix the remaining rewards to next bid
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jun 6, 2024
1 parent a2f6890 commit 447c01f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions x/auction/keeper/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func (k Keeper) FinalizeRewardsAuction() error {
return nil
}

newCoins := k.bank.GetAllBalances(*k.ctx, k.accs.RewardsCollect)
bid, _ := k.getRewardsBid(id)
if bid != nil && len(bid.Bidder) != 0 {
bidderAccAddr, err := sdk.AccAddressFromBech32(bid.Bidder)
Expand All @@ -44,12 +43,10 @@ func (k Keeper) FinalizeRewardsAuction() error {
Id: id,
Bidder: sdk.AccAddress(bid.Bidder).String(),
})
} else if len(a.Rewards) != 0 {
// rollover the past rewards if there was no bidder
newCoins = newCoins.Add(a.Rewards...)
}

return k.initNewAuction(id+1, newCoins)
remainingRewards := k.bank.GetAllBalances(*k.ctx, k.accs.RewardsCollect)
return k.initNewAuction(id+1, remainingRewards)

Check warning on line 49 in x/auction/keeper/rewards.go

View check run for this annotation

Codecov / codecov/patch

x/auction/keeper/rewards.go#L48-L49

Added lines #L48 - L49 were not covered by tests
}

func (k Keeper) initNewAuction(id uint32, rewards sdk.Coins) error {
Expand Down

0 comments on commit 447c01f

Please sign in to comment.