Skip to content

Commit

Permalink
add fee ante handler
Browse files Browse the repository at this point in the history
  • Loading branch information
vuong177 committed Oct 26, 2023
1 parent ea20497 commit 17f1239
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
tfmwKeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txBoundaryAnte "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
txBoundaryKeeper "github.com/notional-labs/composable/v6/x/tx-boundary/keeper"
Expand All @@ -18,8 +18,11 @@ import (
// Link to default ante handler used by cosmos sdk:
// https://github.com/cosmos/cosmos-sdk/blob/v0.43.0/x/auth/ante/ante.go#L41
func NewAnteHandler(
_ servertypes.AppOptions,
options servertypes.AppOptions,
ak ante.AccountKeeper,
bk authtypes.BankKeeper,
feegrantKeeper ante.FeegrantKeeper,
txFeeChecker ante.TxFeeChecker,
sigGasConsumer ante.SignatureVerificationGasConsumer,
signModeHandler signing.SignModeHandler,
channelKeeper *ibckeeper.Keeper,
Expand All @@ -30,6 +33,8 @@ func NewAnteHandler(
return sdk.ChainAnteDecorators(
ante.NewSetUpContextDecorator(), // // outermost AnteDecorator. SetUpContext must be called first
ante.NewValidateBasicDecorator(),
ante.NewConsumeGasForTxSizeDecorator(ak),
ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(ak),
ante.NewConsumeGasForTxSizeDecorator(ak),
Expand Down
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ func NewComposableApp(
app.SetAnteHandler(ante.NewAnteHandler(
appOpts,
app.AccountKeeper,
app.BankKeeper,
app.FeeGrantKeeper,
nil,
authante.DefaultSigVerificationGasConsumer,
encodingConfig.TxConfig.SignModeHandler(),
app.IBCKeeper,
Expand Down

0 comments on commit 17f1239

Please sign in to comment.