@@ -27,6 +27,7 @@ use revm::{
27
27
} ,
28
28
precompile:: PrecompileErrors ,
29
29
primitives:: { Address , Bytes , Log , B256 , U256 } ,
30
+ state:: EvmState ,
30
31
Context , Error , Evm , JournalEntry ,
31
32
} ;
32
33
use std:: { rc:: Rc , vec:: Vec } ;
@@ -396,6 +397,10 @@ where
396
397
fn db ( & mut self ) -> & mut Self :: Database {
397
398
self . inner . db ( )
398
399
}
400
+
401
+ fn db_ref ( & self ) -> & Self :: Database {
402
+ self . inner . db_ref ( )
403
+ }
399
404
}
400
405
401
406
impl < INSP , DB , CTX > ErrorGetter for InspectorContext < INSP , DB , CTX >
@@ -527,6 +532,10 @@ pub trait JournalExt {
527
532
fn logs ( & self ) -> & [ Log ] ;
528
533
529
534
fn last_journal ( & self ) -> & [ JournalEntry ] ;
535
+
536
+ fn evm_state ( & self ) -> & EvmState ;
537
+
538
+ fn evm_state_mut ( & mut self ) -> & mut EvmState ;
530
539
}
531
540
532
541
impl < DB : Database > JournalExt for JournaledState < DB > {
@@ -537,6 +546,14 @@ impl<DB: Database> JournalExt for JournaledState<DB> {
537
546
fn last_journal ( & self ) -> & [ JournalEntry ] {
538
547
self . journal . last ( ) . expect ( "Journal is never empty" )
539
548
}
549
+
550
+ fn evm_state ( & self ) -> & EvmState {
551
+ & self . state
552
+ }
553
+
554
+ fn evm_state_mut ( & mut self ) -> & mut EvmState {
555
+ & mut self . state
556
+ }
540
557
}
541
558
542
559
#[ auto_impl( & , & mut , Box , Arc ) ]
@@ -699,10 +716,17 @@ where
699
716
}
700
717
_ => ( ) ,
701
718
}
702
-
703
719
ret
704
720
}
705
721
722
+ fn final_return (
723
+ context : & mut Self :: Context ,
724
+ result : & mut Self :: FrameResult ,
725
+ ) -> Result < ( ) , Self :: Error > {
726
+ context. frame_end ( result) ;
727
+ Ok ( ( ) )
728
+ }
729
+
706
730
fn init (
707
731
& self ,
708
732
context : & mut CTX ,
@@ -719,9 +743,6 @@ where
719
743
if let Ok ( FrameOrResultGen :: Frame ( frame) ) = & mut ret {
720
744
context. initialize_interp ( & mut frame. eth_frame . interpreter ) ;
721
745
}
722
-
723
- // TODO : Handle last frame_end. MAKE a separate function for `last_return_result`.
724
-
725
746
ret
726
747
}
727
748
0 commit comments