Skip to content

Commit

Permalink
bug: Added not set to ibc ante handler (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuguen authored Mar 21, 2024
1 parent c9bf16a commit b5d2a9b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
29 changes: 29 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package app

import (
"github.com/cosmos/cosmos-sdk/client"
sdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
)

// setAnteHandler Reference github.com/cosmos/cosmos-sdk/x/auth/ante/ante.go
func (app *App) setAnteHandler(txConfig client.TxConfig) {
app.SetAnteHandler(
sdktypes.ChainAnteDecorators(
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.NewExtensionOptionsDecorator(nil),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(app.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(app.AccountKeeper),
ante.NewDeductFeeDecorator(app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, nil),
ante.NewSetPubKeyDecorator(app.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(app.AccountKeeper),
ante.NewSigGasConsumeDecorator(app.AccountKeeper, ante.DefaultSigVerificationGasConsumer),
ante.NewSigVerificationDecorator(app.AccountKeeper, txConfig.SignModeHandler()),
ante.NewIncrementSequenceDecorator(app.AccountKeeper),
ibcante.NewRedundantRelayDecorator(app.IBCKeeper),
),
)
}
18 changes: 0 additions & 18 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
Expand Down Expand Up @@ -411,23 +410,6 @@ func New(
return app
}

func (app *App) setAnteHandler(txConfig client.TxConfig) {
anteHandler, err := ante.NewAnteHandler(
ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
SignModeHandler: txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
)
if err != nil {
panic(err)
}

app.SetAnteHandler(anteHandler)
}

func (app *App) setPostHandler() {
postHandler, err := posthandler.NewPostHandler(
posthandler.HandlerOptions{},
Expand Down

0 comments on commit b5d2a9b

Please sign in to comment.