diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 4d87c6cbe950..248d7163471b 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -16,7 +16,7 @@ import ( // TxFeeChecker checks if the provided fee is enough and returns the effective fee and tx priority. // The effective fee should be deducted later, and the priority should be returned in the ABCI response. -type TxFeeChecker func(ctx context.Context, tx sdk.Tx) (sdk.Coins, int64, error) +type TxFeeChecker func(ctx context.Context, tx transaction.Tx) (sdk.Coins, int64, error) // DeductFeeDecorator deducts fees from the fee payer. The fee payer is the fee granter (if specified) or first signer of the tx. // If the fee payer does not have the funds to pay for the fees, return an InsufficientFunds error. @@ -63,7 +63,7 @@ func (dfd *DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, ne return next(newCtx, tx, false) } -func (dfd *DeductFeeDecorator) innerValidateTx(ctx context.Context, tx sdk.Tx) (priority int64, err error) { +func (dfd *DeductFeeDecorator) innerValidateTx(ctx context.Context, tx transaction.Tx) (priority int64, err error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { return 0, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must implement the FeeTx interface") @@ -93,7 +93,7 @@ func (dfd *DeductFeeDecorator) innerValidateTx(ctx context.Context, tx sdk.Tx) ( // ValidateTx implements an TxValidator for DeductFeeDecorator // Note: This method is applicable only for transactions that implement the sdk.FeeTx interface. -func (dfd *DeductFeeDecorator) ValidateTx(ctx context.Context, tx sdk.Tx) error { +func (dfd *DeductFeeDecorator) ValidateTx(ctx context.Context, tx transaction.Tx) error { _, err := dfd.innerValidateTx(ctx, tx) return err } diff --git a/x/auth/ante/validator_tx_fee.go b/x/auth/ante/validator_tx_fee.go index 3b00c1ba6c29..421068175bea 100644 --- a/x/auth/ante/validator_tx_fee.go +++ b/x/auth/ante/validator_tx_fee.go @@ -14,7 +14,7 @@ import ( // checkTxFeeWithValidatorMinGasPrices implements the default fee logic, where the minimum price per // unit of gas is fixed and set by each validator, can the tx priority is computed from the gas price. -func (dfd *DeductFeeDecorator) checkTxFeeWithValidatorMinGasPrices(ctx context.Context, tx sdk.Tx) (sdk.Coins, int64, error) { +func (dfd *DeductFeeDecorator) checkTxFeeWithValidatorMinGasPrices(ctx context.Context, tx transaction.Tx) (sdk.Coins, int64, error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { return nil, 0, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") diff --git a/x/auth/tx/config/module.go b/x/auth/tx/config/module.go index 21c3131a4e00..f4a1207fa7b1 100644 --- a/x/auth/tx/config/module.go +++ b/x/auth/tx/config/module.go @@ -53,5 +53,9 @@ func (a AppModule) TxValidator(ctx context.Context, tx transaction.Tx) error { } } + if err := a.feeTxValidator.ValidateTx(ctx, tx); err != nil { + return err + } + return a.sigVerification.ValidateTx(ctx, tx) }