@@ -275,7 +275,7 @@ where
275
275
& mut self ,
276
276
address : Address ,
277
277
) -> Result < Option < AccountInfo > , <Db as Database >:: Error > {
278
- self . inner . db ( ) . basic ( address)
278
+ self . inner . db_mut ( ) . basic ( address)
279
279
}
280
280
281
281
/// Get the current nonce for a specific address
@@ -300,7 +300,7 @@ where
300
300
address : Address ,
301
301
slot : U256 ,
302
302
) -> Result < U256 , <Db as Database >:: Error > {
303
- self . inner . db ( ) . storage ( address, slot)
303
+ self . inner . db_mut ( ) . storage ( address, slot)
304
304
}
305
305
306
306
/// Get the code at the given account, if any.
@@ -312,7 +312,7 @@ where
312
312
) -> Result < Option < Bytecode > , <Db as Database >:: Error > {
313
313
let acct_info = self . try_read_account ( address) ?;
314
314
match acct_info {
315
- Some ( acct) => Ok ( Some ( self . inner . db ( ) . code_by_hash ( acct. code_hash ) ?) ) ,
315
+ Some ( acct) => Ok ( Some ( self . inner . db_mut ( ) . code_by_hash ( acct. code_hash ) ?) ) ,
316
316
None => Ok ( None ) ,
317
317
}
318
318
}
@@ -409,7 +409,7 @@ where
409
409
///
410
410
/// Note: due to revm's DB model, this requires a mutable pointer.
411
411
pub fn read_account ( & mut self , address : Address ) -> Option < AccountInfo > {
412
- self . inner . db ( ) . basic ( address) . expect ( "infallible" )
412
+ self . inner . db_mut ( ) . basic ( address) . expect ( "infallible" )
413
413
}
414
414
415
415
/// Get the current nonce for a specific address
@@ -430,15 +430,15 @@ where
430
430
///
431
431
/// Note: due to revm's DB model, this requires a mutable pointer.
432
432
pub fn read_storage ( & mut self , address : Address , slot : U256 ) -> U256 {
433
- self . inner . db ( ) . storage ( address, slot) . expect ( "infallible" )
433
+ self . inner . db_mut ( ) . storage ( address, slot) . expect ( "infallible" )
434
434
}
435
435
436
436
/// Get the code at the given account, if any.
437
437
///
438
438
/// Note: due to revm's DB model, this requires a mutable pointer.
439
439
pub fn read_code ( & mut self , address : Address ) -> Option < Bytecode > {
440
440
let acct_info = self . read_account ( address) ?;
441
- Some ( self . inner . db ( ) . code_by_hash ( acct_info. code_hash ) . expect ( "infallible" ) )
441
+ Some ( self . inner . db_mut ( ) . code_by_hash ( acct_info. code_hash ) . expect ( "infallible" ) )
442
442
}
443
443
}
444
444
@@ -493,7 +493,7 @@ where
493
493
where
494
494
Db : DatabaseCommit ,
495
495
{
496
- self . inner . db ( ) . commit ( state) ;
496
+ self . inner . db_mut ( ) . commit ( state) ;
497
497
}
498
498
499
499
/// Modify an account with a closure and commit the modified account. This
@@ -735,7 +735,7 @@ where
735
735
/// Set the [EIP-161] state clear flag, activated in the Spurious Dragon
736
736
/// hardfork.
737
737
pub fn set_state_clear_flag ( & mut self , flag : bool ) {
738
- self . inner . db ( ) . set_state_clear_flag ( flag)
738
+ self . inner . db_mut ( ) . set_state_clear_flag ( flag)
739
739
}
740
740
}
741
741
@@ -753,7 +753,7 @@ where
753
753
& mut self ,
754
754
flag : bool ,
755
755
) -> Result < ( ) , <Db as TryStateAcc >:: Error > {
756
- self . inner . db ( ) . try_set_state_clear_flag ( flag)
756
+ self . inner . db_mut ( ) . try_set_state_clear_flag ( flag)
757
757
}
758
758
}
759
759
@@ -1204,8 +1204,8 @@ where
1204
1204
/// [`State::take_bundle`]: revm::database::State::take_bundle
1205
1205
pub fn finish ( self ) -> BundleState {
1206
1206
let Self { inner : mut evm, .. } = self ;
1207
- evm. db ( ) . merge_transitions ( BundleRetention :: Reverts ) ;
1208
- let bundle = evm. db ( ) . take_bundle ( ) ;
1207
+ evm. db_mut ( ) . merge_transitions ( BundleRetention :: Reverts ) ;
1208
+ let bundle = evm. db_mut ( ) . take_bundle ( ) ;
1209
1209
1210
1210
bundle
1211
1211
}
@@ -1231,7 +1231,7 @@ where
1231
1231
pub fn try_finish (
1232
1232
mut self ,
1233
1233
) -> Result < BundleState , EvmErrored < Db , Insp , <Db as TryStateAcc >:: Error > > {
1234
- let db = self . inner . db ( ) ;
1234
+ let db = self . inner . db_mut ( ) ;
1235
1235
1236
1236
trevm_try ! ( db. try_merge_transitions( BundleRetention :: Reverts ) , self ) ;
1237
1237
@@ -1544,7 +1544,7 @@ where
1544
1544
overrides. fill_block ( & mut self . inner ) ;
1545
1545
1546
1546
if let Some ( hashes) = overrides. block_hash . as_ref ( ) {
1547
- self . inner . db ( ) . set_block_hashes ( hashes)
1547
+ self . inner . db_mut ( ) . set_block_hashes ( hashes)
1548
1548
}
1549
1549
1550
1550
self
@@ -1590,7 +1590,7 @@ where
1590
1590
overrides. fill_block ( & mut self . inner ) ;
1591
1591
1592
1592
if let Some ( hashes) = overrides. block_hash . as_ref ( ) {
1593
- trevm_try ! ( self . inner. db ( ) . try_set_block_hashes( hashes) , self ) ;
1593
+ trevm_try ! ( self . inner. db_mut ( ) . try_set_block_hashes( hashes) , self ) ;
1594
1594
}
1595
1595
1596
1596
Ok ( self )
@@ -2110,7 +2110,7 @@ where
2110
2110
{
2111
2111
let Self { mut inner, state : TransactedState { result } } = self ;
2112
2112
2113
- inner. db ( ) . commit ( result. state ) ;
2113
+ inner. db_mut ( ) . commit ( result. state ) ;
2114
2114
2115
2115
( result. result , Trevm { inner, state : NeedsTx :: new ( ) } )
2116
2116
}
@@ -2133,7 +2133,7 @@ where
2133
2133
{
2134
2134
let Self { mut inner, state : TransactedState { result } } = self ;
2135
2135
2136
- trevm_try ! ( inner. db ( ) . try_commit( result. state) , Trevm { inner, state: NeedsTx :: new( ) } ) ;
2136
+ trevm_try ! ( inner. db_mut ( ) . try_commit( result. state) , Trevm { inner, state: NeedsTx :: new( ) } ) ;
2137
2137
Ok ( ( result. result , Trevm { inner, state : NeedsTx :: new ( ) } ) )
2138
2138
}
2139
2139
0 commit comments