@@ -4,9 +4,7 @@ use super::{
4
4
} ;
5
5
use database:: State ;
6
6
use indicatif:: { ProgressBar , ProgressDrawTarget } ;
7
- use inspector:: {
8
- inspect_main_commit, inspector_context:: InspectorContext , inspectors:: TracerEip3155 ,
9
- } ;
7
+ use inspector:: { exec:: InspectCommitEvm , inspectors:: TracerEip3155 } ;
10
8
use revm:: {
11
9
bytecode:: Bytecode ,
12
10
context:: { block:: BlockEnv , cfg:: CfgEnv , tx:: TxEnv } ,
@@ -18,7 +16,7 @@ use revm::{
18
16
database_interface:: EmptyDB ,
19
17
primitives:: { keccak256, Bytes , TxKind , B256 } ,
20
18
specification:: { eip4844:: TARGET_BLOB_GAS_PER_BLOCK_CANCUN , hardfork:: SpecId } ,
21
- transact_main_commit , Context ,
19
+ Context , ExecuteCommitEvm ,
22
20
} ;
23
21
use serde_json:: json;
24
22
use statetest_types:: { SpecName , Test , TestSuite } ;
@@ -421,21 +419,20 @@ pub fn execute_test_suite(
421
419
422
420
// Do the deed
423
421
let ( e, exec_result) = if trace {
424
- let mut ctx = & mut InspectorContext :: new (
425
- Context :: builder ( )
426
- . with_block ( & block)
427
- . with_tx ( & tx)
428
- . with_cfg ( & cfg)
429
- . with_db ( & mut state) ,
430
- TracerEip3155 :: new ( Box :: new ( stderr ( ) ) ) . without_summary ( ) ,
431
- ) ;
422
+ let mut ctx = Context :: builder ( )
423
+ . with_block ( & block)
424
+ . with_tx ( & tx)
425
+ . with_cfg ( & cfg)
426
+ . with_db ( & mut state) ;
432
427
433
428
let timer = Instant :: now ( ) ;
434
- let res = inspect_main_commit ( & mut ctx) ;
429
+ let res = ctx. inspect_commit_previous (
430
+ TracerEip3155 :: new ( Box :: new ( stderr ( ) ) ) . without_summary ( ) ,
431
+ ) ;
435
432
* elapsed. lock ( ) . unwrap ( ) += timer. elapsed ( ) ;
436
433
437
434
let spec = cfg. spec ( ) ;
438
- let db = & mut ctx. inner . journaled_state . database ;
435
+ let db = & mut ctx. journaled_state . database ;
439
436
// Dump state and traces if test failed
440
437
let output = check_evm_execution (
441
438
& test,
@@ -452,7 +449,7 @@ pub fn execute_test_suite(
452
449
( e, res)
453
450
} else {
454
451
let timer = Instant :: now ( ) ;
455
- let res = transact_main_commit ( & mut ctx) ;
452
+ let res = ctx. exec_commit_previous ( ) ;
456
453
* elapsed. lock ( ) . unwrap ( ) += timer. elapsed ( ) ;
457
454
458
455
let spec = cfg. spec ( ) ;
@@ -494,24 +491,20 @@ pub fn execute_test_suite(
494
491
495
492
println ! ( "\n Traces:" ) ;
496
493
497
- let mut ctx = InspectorContext :: new (
498
- Context :: builder ( )
499
- . with_db ( & mut state)
500
- . with_block ( & block)
501
- . with_tx ( & tx)
502
- . with_cfg ( & cfg) ,
494
+ let mut ctx = Context :: builder ( )
495
+ . with_db ( & mut state)
496
+ . with_block ( & block)
497
+ . with_tx ( & tx)
498
+ . with_cfg ( & cfg) ;
499
+
500
+ let _ = ctx. inspect_commit_previous (
503
501
TracerEip3155 :: new ( Box :: new ( stderr ( ) ) ) . without_summary ( ) ,
504
502
) ;
505
503
506
- let _ = inspect_main_commit ( & mut ctx) ;
507
-
508
504
println ! ( "\n Execution result: {exec_result:#?}" ) ;
509
505
println ! ( "\n Expected exception: {:?}" , test. expect_exception) ;
510
506
println ! ( "\n State before: {cache_state:#?}" ) ;
511
- println ! (
512
- "\n State after: {:#?}" ,
513
- ctx. inner. journaled_state. database. cache
514
- ) ;
507
+ println ! ( "\n State after: {:#?}" , ctx. journaled_state. database. cache) ;
515
508
println ! ( "\n Specification: {:?}" , cfg. spec) ;
516
509
println ! ( "\n Tx: {tx:#?}" ) ;
517
510
println ! ( "Block: {block:#?}" ) ;
0 commit comments