Skip to content

Commit

Permalink
fix negative dynamic fee (#351)
Browse files Browse the repository at this point in the history
* fix negative dynamic fee

* Update app/ante/fee_checker.go

Signed-off-by: yihuang <huang@crypto.com>

* fix build

---------

Signed-off-by: yihuang <huang@crypto.com>
  • Loading branch information
yihuang authored Sep 15, 2023
1 parent bb2418b commit 80b6515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/ante/fee_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func NewDynamicFeeChecker(k DynamicFeeEVMKeeper) authante.TxFeeChecker {
}
}

if maxPriorityPrice.Sign() == -1 {
return nil, 0, errorsmod.Wrapf(errortypes.ErrInsufficientFee, "priority fee is negative")
}

gas := feeTx.GetGas()
feeCoins := feeTx.GetFee()
fee := feeCoins.AmountOfNoDenomValidation(denom)
Expand Down

0 comments on commit 80b6515

Please sign in to comment.