@@ -12,7 +12,7 @@ use std::str::FromStr;
12
12
use std:: sync:: Arc ;
13
13
use tokio:: sync:: mpsc;
14
14
use tokio:: time:: { Duration , Instant } ;
15
- use trevm:: revm:: primitives:: ResultAndState ;
15
+ use trevm:: revm:: primitives:: { Account , ExecutionResult , ResultAndState } ;
16
16
use trevm:: { NoopBlock , NoopCfg } ;
17
17
18
18
#[ tokio:: test( flavor = "multi_thread" ) ]
@@ -56,11 +56,23 @@ async fn test_spawn() {
56
56
57
57
// Check the result
58
58
assert ! ( best. is_some( ) ) ;
59
- assert_eq ! ( best. unwrap( ) . score, U256 :: from( 1 ) ) ;
59
+ assert_eq ! ( best. unwrap( ) . score, U256 :: from( 0 ) ) ;
60
60
}
61
61
62
- fn mock_evaluator ( _state : & ResultAndState ) -> U256 {
63
- U256 :: from ( 1 )
62
+ fn mock_evaluator ( state : & ResultAndState ) -> U256 {
63
+ // log the transaction results
64
+ match & state. result {
65
+ ExecutionResult :: Success { .. } => println ! ( "Execution was successful." ) ,
66
+ ExecutionResult :: Revert { .. } => println ! ( "Execution reverted." ) ,
67
+ ExecutionResult :: Halt { .. } => println ! ( "Execution halted." ) ,
68
+ }
69
+
70
+ // return the target account balance
71
+ let target_addr = Address :: from_str ( "0x0000000000000000000000000000000000000000" ) . unwrap ( ) ;
72
+ let default_account = Account :: default ( ) ;
73
+ let target_account = state. state . get ( & target_addr) . unwrap_or ( & default_account) ;
74
+ println ! ( "target account balance: {:?}" , target_account. info. balance) ;
75
+ target_account. info . balance
64
76
}
65
77
66
78
// Returns a new signed test transaction with default values
0 commit comments