diff --git a/x/auth/ante.go b/x/auth/ante.go index 21f8df0fbd..9663bcfe45 100644 --- a/x/auth/ante.go +++ b/x/auth/ante.go @@ -80,11 +80,10 @@ func NewAnteHandler(am AccountMapper, fck FeeCollectionKeeper) sdk.AnteHandler { if !fee.Amount.IsZero() { ctx.GasMeter().ConsumeGas(deductFeesCost, "deductFees") signerAcc, res = deductFees(signerAcc, fee) - fck.addCollectedFees(ctx, fee.Amount) - if !res.IsOK() { return ctx, res, true } + fck.addCollectedFees(ctx, fee.Amount) } } diff --git a/x/auth/ante_test.go b/x/auth/ante_test.go index e21be8f16f..b7f22e5d54 100644 --- a/x/auth/ante_test.go +++ b/x/auth/ante_test.go @@ -209,9 +209,13 @@ func TestAnteHandlerFees(t *testing.T) { mapper.SetAccount(ctx, acc1) checkInvalidTx(t, anteHandler, ctx, tx, sdk.CodeInsufficientFunds) + assert.True(t, feeCollector.GetCollectedFees(ctx).IsEqual(emptyCoins)) + acc1.SetCoins(sdk.Coins{{"atom", 150}}) mapper.SetAccount(ctx, acc1) checkValidTx(t, anteHandler, ctx, tx) + + assert.True(t, feeCollector.GetCollectedFees(ctx).IsEqual(sdk.Coins{{"atom", 150}})) } func TestAnteHandlerBadSignBytes(t *testing.T) {