@@ -3,11 +3,11 @@ package ante_test
3
3
import (
4
4
"testing"
5
5
6
+ "github.com/ethereum/go-ethereum/common"
6
7
"github.com/stretchr/testify/require"
7
8
8
9
"github.com/cosmos/evm/ante"
9
10
ethante "github.com/cosmos/evm/ante/evm"
10
- evmdante "github.com/cosmos/evm/evmd/ante"
11
11
"github.com/cosmos/evm/evmd/tests/integration"
12
12
"github.com/cosmos/evm/testutil/integration/evm/network"
13
13
"github.com/cosmos/evm/types"
@@ -18,25 +18,25 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
18
18
nw := network .NewUnitTestNetwork (create , options ... )
19
19
cases := []struct {
20
20
name string
21
- options evmdante .HandlerOptions
21
+ options ante .HandlerOptions
22
22
expPass bool
23
23
}{
24
24
{
25
25
"fail - empty options" ,
26
- evmdante .HandlerOptions {},
26
+ ante .HandlerOptions {},
27
27
false ,
28
28
},
29
29
{
30
30
"fail - empty account keeper" ,
31
- evmdante .HandlerOptions {
31
+ ante .HandlerOptions {
32
32
Cdc : nw .App .AppCodec (),
33
33
AccountKeeper : nil ,
34
34
},
35
35
false ,
36
36
},
37
37
{
38
38
"fail - empty bank keeper" ,
39
- evmdante .HandlerOptions {
39
+ ante .HandlerOptions {
40
40
Cdc : nw .App .AppCodec (),
41
41
AccountKeeper : nw .App .GetAccountKeeper (),
42
42
BankKeeper : nil ,
@@ -45,7 +45,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
45
45
},
46
46
{
47
47
"fail - empty IBC keeper" ,
48
- evmdante .HandlerOptions {
48
+ ante .HandlerOptions {
49
49
Cdc : nw .App .AppCodec (),
50
50
AccountKeeper : nw .App .GetAccountKeeper (),
51
51
BankKeeper : nw .App .GetBankKeeper (),
@@ -55,7 +55,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
55
55
},
56
56
{
57
57
"fail - empty fee market keeper" ,
58
- evmdante .HandlerOptions {
58
+ ante .HandlerOptions {
59
59
Cdc : nw .App .AppCodec (),
60
60
AccountKeeper : nw .App .GetAccountKeeper (),
61
61
BankKeeper : nw .App .GetBankKeeper (),
@@ -66,7 +66,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
66
66
},
67
67
{
68
68
"fail - empty EVM keeper" ,
69
- evmdante .HandlerOptions {
69
+ ante .HandlerOptions {
70
70
Cdc : nw .App .AppCodec (),
71
71
AccountKeeper : nw .App .GetAccountKeeper (),
72
72
BankKeeper : nw .App .GetBankKeeper (),
@@ -78,7 +78,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
78
78
},
79
79
{
80
80
"fail - empty signature gas consumer" ,
81
- evmdante .HandlerOptions {
81
+ ante .HandlerOptions {
82
82
Cdc : nw .App .AppCodec (),
83
83
AccountKeeper : nw .App .GetAccountKeeper (),
84
84
BankKeeper : nw .App .GetBankKeeper (),
@@ -91,7 +91,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
91
91
},
92
92
{
93
93
"fail - empty signature mode handler" ,
94
- evmdante .HandlerOptions {
94
+ ante .HandlerOptions {
95
95
Cdc : nw .App .AppCodec (),
96
96
AccountKeeper : nw .App .GetAccountKeeper (),
97
97
BankKeeper : nw .App .GetBankKeeper (),
@@ -105,7 +105,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
105
105
},
106
106
{
107
107
"fail - empty tx fee checker" ,
108
- evmdante .HandlerOptions {
108
+ ante .HandlerOptions {
109
109
Cdc : nw .App .AppCodec (),
110
110
AccountKeeper : nw .App .GetAccountKeeper (),
111
111
BankKeeper : nw .App .GetBankKeeper (),
@@ -118,9 +118,28 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
118
118
},
119
119
false ,
120
120
},
121
+ {
122
+ "fail - empty pending tx listener" ,
123
+ ante.HandlerOptions {
124
+ Cdc : nw .App .AppCodec (),
125
+ AccountKeeper : nw .App .GetAccountKeeper (),
126
+ BankKeeper : nw .App .GetBankKeeper (),
127
+ ExtensionOptionChecker : types .HasDynamicFeeExtensionOption ,
128
+ EvmKeeper : nw .App .GetEVMKeeper (),
129
+ FeegrantKeeper : nw .App .GetFeeGrantKeeper (),
130
+ IBCKeeper : nw .App .GetIBCKeeper (),
131
+ FeeMarketKeeper : nw .App .GetFeeMarketKeeper (),
132
+ SignModeHandler : nw .GetEncodingConfig ().TxConfig .SignModeHandler (),
133
+ SigGasConsumer : ante .SigVerificationGasConsumer ,
134
+ MaxTxGasWanted : 40000000 ,
135
+ TxFeeChecker : ethante .NewDynamicFeeChecker (nw .App .GetFeeMarketKeeper ()),
136
+ PendingTxListener : nil ,
137
+ },
138
+ false ,
139
+ },
121
140
{
122
141
"success - default app options" ,
123
- evmdante .HandlerOptions {
142
+ ante .HandlerOptions {
124
143
Cdc : nw .App .AppCodec (),
125
144
AccountKeeper : nw .App .GetAccountKeeper (),
126
145
BankKeeper : nw .App .GetBankKeeper (),
@@ -133,6 +152,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op
133
152
SigGasConsumer : ante .SigVerificationGasConsumer ,
134
153
MaxTxGasWanted : 40000000 ,
135
154
TxFeeChecker : ethante .NewDynamicFeeChecker (nw .App .GetFeeMarketKeeper ()),
155
+ PendingTxListener : func (hash common.Hash ) {},
136
156
},
137
157
true ,
138
158
},
0 commit comments