@@ -62,121 +62,3 @@ func TestPendingOpsStaked(t *testing.T) {
62
62
t .Fatalf ("got err %v, want nil" , err )
63
63
}
64
64
}
65
-
66
- // TestReplaceOp calls checks.ValidatePendingOps with a valid UserOperation that replaces a pending
67
- // UserOperation. Expect nil.
68
- func TestReplaceOp (t * testing.T ) {
69
- penOp := testutils .MockValidInitUserOp ()
70
- penOps := []* userop.UserOperation {penOp }
71
- op := testutils .MockValidInitUserOp ()
72
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Add (penOp .MaxPriorityFeePerGas , common .Big1 )
73
- op .MaxFeePerGas = big .NewInt (0 ).Add (penOp .MaxFeePerGas , common .Big1 )
74
- err := ValidatePendingOps (
75
- op ,
76
- penOps ,
77
- testutils .MaxOpsForUnstakedSender ,
78
- testutils .MockGetNotStakeZeroDeposit ,
79
- )
80
-
81
- if err != nil {
82
- t .Fatalf ("got err %v, want nil" , err )
83
- }
84
- }
85
-
86
- // TestReplaceOpLowerMPF calls checks.ValidatePendingOps with a UserOperation that replaces a pending
87
- // UserOperation but has a lower MaxPriorityFeePerGas. Expect error.
88
- func TestReplaceOpLowerMPF (t * testing.T ) {
89
- penOp := testutils .MockValidInitUserOp ()
90
- penOps := []* userop.UserOperation {penOp }
91
- op := testutils .MockValidInitUserOp ()
92
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Sub (penOp .MaxPriorityFeePerGas , common .Big1 )
93
- err := ValidatePendingOps (
94
- op ,
95
- penOps ,
96
- testutils .MaxOpsForUnstakedSender ,
97
- testutils .MockGetNotStakeZeroDeposit ,
98
- )
99
-
100
- if err == nil {
101
- t .Fatal ("got nil, want err" )
102
- }
103
- }
104
-
105
- // TestReplaceOpEqualMPF calls checks.ValidatePendingOps with a UserOperation that replaces a pending
106
- // UserOperation but has an equal MaxPriorityFeePerGas. Expect error.
107
- func TestReplaceOpEqualMPF (t * testing.T ) {
108
- penOp := testutils .MockValidInitUserOp ()
109
- penOps := []* userop.UserOperation {penOp }
110
- op := testutils .MockValidInitUserOp ()
111
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Add (penOp .MaxPriorityFeePerGas , common .Big0 )
112
- err := ValidatePendingOps (
113
- op ,
114
- penOps ,
115
- testutils .MaxOpsForUnstakedSender ,
116
- testutils .MockGetNotStakeZeroDeposit ,
117
- )
118
-
119
- if err == nil {
120
- t .Fatal ("got nil, want err" )
121
- }
122
- }
123
-
124
- // TestReplaceOpNotEqualIncMF calls checks.ValidatePendingOps with a UserOperation that replaces a pending
125
- // UserOperation but does not have an equally increasing MaxFeePerGas. Expect error.
126
- func TestReplaceOpNotEqualIncMF (t * testing.T ) {
127
- penOp := testutils .MockValidInitUserOp ()
128
- penOps := []* userop.UserOperation {penOp }
129
- op := testutils .MockValidInitUserOp ()
130
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Add (penOp .MaxPriorityFeePerGas , common .Big2 )
131
- op .MaxFeePerGas = big .NewInt (0 ).Add (penOp .MaxFeePerGas , common .Big1 )
132
- err := ValidatePendingOps (
133
- op ,
134
- penOps ,
135
- testutils .MaxOpsForUnstakedSender ,
136
- testutils .MockGetNotStakeZeroDeposit ,
137
- )
138
-
139
- if err == nil {
140
- t .Fatal ("got nil, want err" )
141
- }
142
- }
143
-
144
- // TestReplaceOpSameMF calls checks.ValidatePendingOps with a UserOperation that replaces a pending
145
- // UserOperation but does not increase MaxFeePerGas. Expect error.
146
- func TestReplaceOpSameMF (t * testing.T ) {
147
- penOp := testutils .MockValidInitUserOp ()
148
- penOps := []* userop.UserOperation {penOp }
149
- op := testutils .MockValidInitUserOp ()
150
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Add (penOp .MaxPriorityFeePerGas , common .Big1 )
151
- op .MaxFeePerGas = big .NewInt (0 ).Add (penOp .MaxFeePerGas , common .Big0 )
152
- err := ValidatePendingOps (
153
- op ,
154
- penOps ,
155
- testutils .MaxOpsForUnstakedSender ,
156
- testutils .MockGetNotStakeZeroDeposit ,
157
- )
158
-
159
- if err == nil {
160
- t .Fatal ("got nil, want err" )
161
- }
162
- }
163
-
164
- // TestReplaceOpDecMF calls checks.ValidatePendingOps with a UserOperation that replaces a pending
165
- // UserOperation but has a decreasing MaxFeePerGas. Expect error.
166
- func TestReplaceOpDecMF (t * testing.T ) {
167
- penOp := testutils .MockValidInitUserOp ()
168
- penOps := []* userop.UserOperation {penOp }
169
- op := testutils .MockValidInitUserOp ()
170
- op .MaxPriorityFeePerGas = big .NewInt (0 ).Add (penOp .MaxPriorityFeePerGas , common .Big1 )
171
- op .MaxFeePerGas = big .NewInt (0 ).Sub (penOp .MaxFeePerGas , common .Big1 )
172
- err := ValidatePendingOps (
173
- op ,
174
- penOps ,
175
- testutils .MaxOpsForUnstakedSender ,
176
- testutils .MockGetNotStakeZeroDeposit ,
177
- )
178
-
179
- if err == nil {
180
- t .Fatal ("got nil, want err" )
181
- }
182
- }
0 commit comments