tidy payout function

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Ruaridh 2020-05-11 21:07:39 +01:00 committed by GitHub
parent 7c477eb75d
commit d489bacfac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -350,13 +350,14 @@ func (k Keeper) PlaceReverseBidCollateral(ctx sdk.Context, a types.CollateralAuc
}
for i, payout := range lotPayouts {
// if the payout amount is 0, don't send 0 coins
if payout.IsPositive() {
if !payout.IsPositive() {
break
}
err = k.supplyKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, a.LotReturns.Addresses[i], sdk.NewCoins(payout))
if err != nil {
return a, err
}
}
}
// Update Auction
a.Bidder = bidder