@@ -129,9 +129,7 @@ func (s *DriverTestSuite) TestProcessL1Blocks() {
129
129
}
130
130
131
131
func (s * DriverTestSuite ) TestCheckL1ReorgToHigherFork () {
132
- var testnetL1SnapshotID string
133
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & testnetL1SnapshotID , "evm_snapshot" ))
134
- s .NotEmpty (testnetL1SnapshotID )
132
+ var testnetL1SnapshotID = s .EvmSnapshot ()
135
133
136
134
l1Head1 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
137
135
s .Nil (err )
@@ -159,9 +157,7 @@ func (s *DriverTestSuite) TestCheckL1ReorgToHigherFork() {
159
157
s .False (reorged )
160
158
161
159
// Reorg back to l2Head1
162
- var revertRes bool
163
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & revertRes , "evm_revert" , testnetL1SnapshotID ))
164
- s .True (revertRes )
160
+ s .EvmRevert (testnetL1SnapshotID )
165
161
166
162
l1Head3 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
167
163
s .Nil (err )
@@ -192,9 +188,7 @@ func (s *DriverTestSuite) TestCheckL1ReorgToHigherFork() {
192
188
}
193
189
194
190
func (s * DriverTestSuite ) TestCheckL1ReorgToLowerFork () {
195
- var testnetL1SnapshotID string
196
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & testnetL1SnapshotID , "evm_snapshot" ))
197
- s .NotEmpty (testnetL1SnapshotID )
191
+ var testnetL1SnapshotID = s .EvmSnapshot ()
198
192
199
193
l1Head1 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
200
194
s .Nil (err )
@@ -222,9 +216,7 @@ func (s *DriverTestSuite) TestCheckL1ReorgToLowerFork() {
222
216
s .False (reorged )
223
217
224
218
// Reorg back to l2Head1
225
- var revertRes bool
226
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & revertRes , "evm_revert" , testnetL1SnapshotID ))
227
- s .True (revertRes )
219
+ s .EvmRevert (testnetL1SnapshotID )
228
220
229
221
l1Head3 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
230
222
s .Nil (err )
@@ -252,9 +244,7 @@ func (s *DriverTestSuite) TestCheckL1ReorgToLowerFork() {
252
244
}
253
245
254
246
func (s * DriverTestSuite ) TestCheckL1ReorgToSameHeightFork () {
255
- var testnetL1SnapshotID string
256
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & testnetL1SnapshotID , "evm_snapshot" ))
257
- s .NotEmpty (testnetL1SnapshotID )
247
+ var testnetL1SnapshotID = s .EvmSnapshot ()
258
248
259
249
l1Head1 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
260
250
s .Nil (err )
@@ -282,9 +272,7 @@ func (s *DriverTestSuite) TestCheckL1ReorgToSameHeightFork() {
282
272
s .False (reorged )
283
273
284
274
// Reorg back to l2Head1
285
- var revertRes bool
286
- s .Nil (s .RPCClient .L1 .CallContext (context .Background (), & revertRes , "evm_revert" , testnetL1SnapshotID ))
287
- s .True (revertRes )
275
+ s .EvmRevert (testnetL1SnapshotID )
288
276
289
277
l1Head3 , err := s .d .rpc .L1 .HeaderByNumber (context .Background (), nil )
290
278
s .Nil (err )
0 commit comments