parent
6be18a1cb4
commit
eee53a9500
@ -64,6 +64,7 @@ func NewAnteHandler(
|
||||
authante.NewMempoolFeeDecorator(),
|
||||
authante.NewValidateBasicDecorator(),
|
||||
authante.TxTimeoutHeightDecorator{},
|
||||
authante.NewValidateMemoDecorator(ak),
|
||||
NewEthSigVerificationDecorator(evmKeeper),
|
||||
NewEthAccountVerificationDecorator(ak, bankKeeper, evmKeeper),
|
||||
NewEthNonceVerificationDecorator(ak),
|
||||
|
@ -2,6 +2,7 @@ package ante_test
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
@ -91,6 +92,17 @@ func (suite AnteTestSuite) TestAnteHandler() {
|
||||
return tx
|
||||
}, false, true, true,
|
||||
},
|
||||
{
|
||||
"fail - CheckTx (memo too long)",
|
||||
func() sdk.Tx {
|
||||
signedTx := evmtypes.NewMsgEthereumTx(suite.app.EvmKeeper.ChainID(), 3, &to, big.NewInt(10), 100000, big.NewInt(1), nil, nil)
|
||||
signedTx.From = addr.Hex()
|
||||
|
||||
txBuilder := suite.CreateTestTxBuilder(signedTx, privKey, 1)
|
||||
txBuilder.SetMemo(strings.Repeat("*", 257))
|
||||
return txBuilder.GetTx()
|
||||
}, true, false, false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
@ -73,6 +73,13 @@ func TestAnteTestSuite(t *testing.T) {
|
||||
func (suite *AnteTestSuite) CreateTestTx(
|
||||
msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64,
|
||||
) authsigning.Tx {
|
||||
return suite.CreateTestTxBuilder(msg, priv, accNum).GetTx()
|
||||
}
|
||||
|
||||
// CreateTestTxBuilder is a helper function to create a tx builder given multiple inputs.
|
||||
func (suite *AnteTestSuite) CreateTestTxBuilder(
|
||||
msg *evmtypes.MsgEthereumTx, priv cryptotypes.PrivKey, accNum uint64,
|
||||
) client.TxBuilder {
|
||||
|
||||
option, err := codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{})
|
||||
suite.Require().NoError(err)
|
||||
@ -125,7 +132,7 @@ func (suite *AnteTestSuite) CreateTestTx(
|
||||
err = suite.txBuilder.SetSignatures(sigsV2...)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
return suite.txBuilder.GetTx()
|
||||
return suite.txBuilder
|
||||
}
|
||||
|
||||
func newTestAddrKey() (common.Address, cryptotypes.PrivKey) {
|
||||
|
Loading…
Reference in New Issue
Block a user