refactor: updated to ante handlers support

This commit is contained in:
Sai Kumar
2022-06-07 08:56:18 -05:00
committed by i-norden
parent 20ce3dfb3d
commit fc06fbfb48
28 changed files with 1148 additions and 1451 deletions
+2 -2
View File
@@ -267,7 +267,7 @@ func (k Keeper) WithdrawBond(ctx sdk.Context, id string, ownerAddress sdk.AccAdd
return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.")
}
updatedBalance, isNeg := bond.Balance.SafeSub(coins)
updatedBalance, isNeg := bond.Balance.SafeSub(coins...)
if isNeg {
return nil, sdkerrors.Wrap(sdkerrors.ErrInsufficientFunds, "Insufficient bond balance.")
}
@@ -336,7 +336,7 @@ func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id, moduleAccount
bondObj := k.GetBond(ctx, id)
// Deduct rent from bond.
updatedBalance, isNeg := bondObj.Balance.SafeSub(coins)
updatedBalance, isNeg := bondObj.Balance.SafeSub(coins...)
if isNeg {
// Check if bond has sufficient funds.