@@ -2,7 +2,7 @@ use std::collections::HashMap;
22
33use alloy_primitives:: { Address , B256 , U256 } ;
44use revm:: {
5- primitives:: { Account , AccountInfo , Bytecode , EvmStorageSlot } ,
5+ primitives:: { Account , AccountInfo , Bytecode , EvmState , EvmStorageSlot } ,
66 Database , DatabaseCommit ,
77} ;
88
@@ -48,28 +48,29 @@ pub trait EvmExtUnchecked<Db: Database> {
4848 {
4949 let mut state = HashMap :: default ( ) ;
5050 let mut old = HashMap :: default ( ) ;
51- for account in changes. into_iter ( ) {
52- let mut acct = self . account ( account ) ?;
53- old. insert ( account , acct. info . clone ( ) ) ;
51+ for addr in changes. into_iter ( ) {
52+ let mut acct = self . account ( addr ) ?;
53+ old. insert ( addr , acct. info . clone ( ) ) ;
5454 f ( & mut acct. info ) ;
5555 acct. mark_touch ( ) ;
56- state. insert ( account , acct) ;
56+ state. insert ( addr , acct) ;
5757 }
5858 self . db_mut_ext ( ) . commit ( state) ;
5959 Ok ( old)
6060 }
6161
6262 /// Modify an account with a closure and commit the modified account.
63- fn modify_account < F > ( & mut self , address : Address , f : F ) -> Result < AccountInfo , Db :: Error >
63+ fn modify_account < F > ( & mut self , addr : Address , f : F ) -> Result < AccountInfo , Db :: Error >
6464 where
6565 F : FnOnce ( & mut AccountInfo ) ,
6666 Db : DatabaseCommit ,
6767 {
68- let mut acct = self . account ( address ) ?;
68+ let mut acct = self . account ( addr ) ?;
6969 let old = acct. info . clone ( ) ;
7070 f ( & mut acct. info ) ;
7171 acct. mark_touch ( ) ;
72- let changes = [ ( address, acct) ] . into_iter ( ) . collect ( ) ;
72+
73+ let changes: EvmState = [ ( addr, acct) ] . into_iter ( ) . collect ( ) ;
7374 self . db_mut_ext ( ) . commit ( changes) ;
7475 Ok ( old)
7576 }
0 commit comments