@@ -12,7 +12,7 @@ use std::collections::HashMap;
1212use std:: time:: { SystemTime , UNIX_EPOCH } ;
1313use std:: sync:: { Arc , Mutex } ;
1414use std:: sync:: mpsc:: { channel, Sender , Receiver } ;
15- use sputnikvm:: { AccountChange , ValidTransaction , Patch , AccountCommitment , AccountState , HeaderParams , SeqTransactionVM , VM } ;
15+ use sputnikvm:: { AccountChange , ValidTransaction , Patch , AccountCommitment , AccountState , HeaderParams , SeqTransactionVM , VM , VMStatus } ;
1616use sputnikvm:: errors:: RequireError ;
1717use sputnikvm_stateful:: MemoryStateful ;
1818use rand:: os:: OsRng ;
@@ -167,6 +167,7 @@ pub fn mine_one<P: Patch>(state: Arc<Mutex<MinerState>>, address: Address) {
167167 state. fat_transit ( current_block. header . number . as_usize ( ) , & [ ] ) ;
168168
169169 for transaction in transactions. clone ( ) {
170+ let transaction_hash = transaction. rlp_hash ( ) ;
170171 let valid = state. stateful_mut ( ) . to_valid :: < P > ( transaction) . unwrap ( ) ;
171172 let vm: SeqTransactionVM < P > = {
172173 let vm = state. stateful_mut ( ) . call ( valid, HeaderParams :: from ( & current_block. header ) ,
@@ -197,6 +198,14 @@ pub fn mine_one<P: Patch>(state: Arc<Mutex<MinerState>>, address: Address) {
197198 state_root : state. stateful_mut ( ) . root ( ) ,
198199 } ;
199200 receipts. push ( receipt) ;
201+
202+ state. set_receipt_status (
203+ transaction_hash,
204+ match vm. status ( ) {
205+ VMStatus :: ExitedOk => true ,
206+ _ => false ,
207+ }
208+ ) ;
200209 }
201210
202211 let root = state. stateful_mut ( ) . root ( ) ;
0 commit comments