@@ -14,7 +14,9 @@ use revm::{
14
14
} ,
15
15
DatabaseCommit ,
16
16
} ;
17
- use revm_inspectors:: tracing:: { MuxInspector , TracingInspector , TracingInspectorConfig } ;
17
+ use revm_inspectors:: tracing:: {
18
+ js:: JsInspector , MuxInspector , TracingInspector , TracingInspectorConfig ,
19
+ } ;
18
20
19
21
#[ test]
20
22
fn test_geth_calltracer_logs ( ) {
@@ -106,23 +108,28 @@ fn test_geth_calltracer_logs() {
106
108
. geth_builder ( )
107
109
. geth_call_traces ( CallConfig :: default ( ) . with_log ( ) , res. result . gas_used ( ) ) ;
108
110
109
- // three subcalls
111
+ // top-level call succeeded, no log and three subcalls
110
112
assert_eq ! ( call_frame. calls. len( ) , 3 ) ;
111
-
112
- // top-level call emitted one log
113
113
assert_eq ! ( call_frame. logs. len( ) , 1 ) ;
114
+ assert ! ( call_frame. error. is_none( ) ) ;
114
115
115
- // first call failed, no logs
116
+ // first subcall failed, and no logs
116
117
assert ! ( call_frame. calls[ 0 ] . logs. is_empty( ) ) ;
118
+ assert ! ( call_frame. calls[ 0 ] . error. is_some( ) ) ;
117
119
118
- // second call failed, with a two nested subcalls that emitted logs, but none should be included
120
+ // second subcall failed, with a two nested subcalls that emitted logs, but none should be
121
+ // included
119
122
assert_eq ! ( call_frame. calls[ 1 ] . calls. len( ) , 1 ) ;
120
123
assert ! ( call_frame. calls[ 1 ] . logs. is_empty( ) ) ;
124
+ assert ! ( call_frame. calls[ 1 ] . error. is_some( ) ) ;
121
125
assert ! ( call_frame. calls[ 1 ] . calls[ 0 ] . logs. is_empty( ) ) ;
126
+ assert ! ( call_frame. calls[ 1 ] . calls[ 0 ] . error. is_none( ) ) ;
122
127
assert ! ( call_frame. calls[ 1 ] . calls[ 0 ] . calls[ 0 ] . logs. is_empty( ) ) ;
128
+ assert ! ( call_frame. calls[ 1 ] . calls[ 0 ] . calls[ 0 ] . error. is_none( ) ) ;
123
129
124
- // third call succeeded, one log
130
+ // third subcall succeeded, one log
125
131
assert_eq ! ( call_frame. calls[ 2 ] . logs. len( ) , 1 ) ;
132
+ assert ! ( call_frame. calls[ 2 ] . error. is_none( ) ) ;
126
133
}
127
134
128
135
#[ test]
@@ -423,11 +430,9 @@ fn test_geth_jstracer_op_gascost() {
423
430
) ;
424
431
let mut insp = JsInspector :: new ( code. to_string ( ) , serde_json:: Value :: Null ) . unwrap ( ) ;
425
432
let ( res, _) = inspect ( & mut db, env. clone ( ) , & mut insp) . unwrap ( ) ;
426
- println ! ( "result: {:?}" , res) ;
427
433
assert ! ( res. result. is_success( ) ) ;
428
434
429
435
let result = insp. json_result ( res, & env, & db) . unwrap ( ) ;
430
- println ! ( "result: {}" , result. to_string( ) ) ;
431
436
432
437
assert ! ( !result[ "error" ] . as_bool( ) . unwrap( ) ) ;
433
438
assert_eq ! (
0 commit comments