Skip to content

Commit

Permalink
consistency in antehandler (cosmos#9144)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Apr 20, 2021
1 parent 83645e0 commit b1cf479
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/auth/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
NewRejectExtensionOptionsDecorator(),
NewMempoolFeeDecorator(),
NewValidateBasicDecorator(),
TxTimeoutHeightDecorator{},
NewTxTimeoutHeightDecorator(),
NewValidateMemoDecorator(options.AccountKeeper),
NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
Expand Down
6 changes: 6 additions & 0 deletions x/auth/ante/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ type (
}
)

// TxTimeoutHeightDecorator defines an AnteHandler decorator that checks for a
// tx height timeout.
func NewTxTimeoutHeightDecorator() TxTimeoutHeightDecorator {
return TxTimeoutHeightDecorator{}
}

// AnteHandle implements an AnteHandler decorator for the TxHeightTimeoutDecorator
// type where the current block height is checked against the tx's height timeout.
// If a height timeout is provided (non-zero) and is less than the current block
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (suite *AnteTestSuite) TestConsumeGasForTxSize() {
func (suite *AnteTestSuite) TestTxHeightTimeoutDecorator() {
suite.SetupTest(true)

antehandler := sdk.ChainAnteDecorators(ante.TxTimeoutHeightDecorator{})
antehandler := sdk.ChainAnteDecorators(ante.NewTxTimeoutHeightDecorator())

// keys and addresses
priv1, _, addr1 := testdata.KeyTestPubAddr()
Expand Down

0 comments on commit b1cf479

Please sign in to comment.