Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Add ante test
Browse files Browse the repository at this point in the history
  • Loading branch information
0a1c committed Apr 6, 2023
1 parent 63865da commit b58be7b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 3 deletions.
42 changes: 39 additions & 3 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
signing.SignMode_SIGN_MODE_DIRECT,
msg,
"ethermint_9000-1",
2000,
2000000,
"EIP-712",
)

Expand Down Expand Up @@ -831,7 +831,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
signing.SignMode_SIGN_MODE_DIRECT,
msg,
"ethermint_9000-1",
2000,
2000000,
"EIP-712",
)

Expand Down Expand Up @@ -860,12 +860,48 @@ func (suite AnteTestSuite) TestAnteHandler() {
signing.SignMode_SIGN_MODE_DIRECT,
msg,
"ethermint_9000-1",
2000,
2000000,
"EIP-712",
)

txBuilder.SetMsgs(msg, msg)

return txBuilder.GetTx()
}, false, false, false,
},
{
"Fails - Authz Exec with unauthorized message",
func() sdk.Tx {
ethTx := evmtypes.NewTx(
suite.app.EvmKeeper.ChainID(),
1,
&to,
big.NewInt(10),
100000,
big.NewInt(150),
big.NewInt(200),
nil,
nil,
nil,
)
ethTx.From = addr.Hex()

msg := authz.NewMsgExec(
sdk.AccAddress(privKey.PubKey().Address()),
[]sdk.Msg{ethTx},
)

txBuilder := suite.CreateTestSingleSignedTx(
privKey,
signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON,
&msg,
"ethermint_9000-1",
200000,
"",
)

txBuilder.SetMsgs(&msg)

return txBuilder.GetTx()
}, false, false, false,
},
Expand Down
Loading

0 comments on commit b58be7b

Please sign in to comment.