@@ -24,8 +24,10 @@ use alloy_genesis::GenesisAccount;
2424use alloy_primitives:: { Address , B256 , U256 } ;
2525use eyre:: Context ;
2626use rand:: { SeedableRng , rngs:: StdRng } ;
27- use reth:: api:: NodeTypesWithDBAdapter ;
28- use reth:: revm:: db:: { AccountState , BundleState , Cache , CacheDB , DbAccount , State } ;
27+ use reth:: {
28+ api:: NodeTypesWithDBAdapter ,
29+ revm:: db:: { AccountState , BundleState , Cache , CacheDB , DbAccount , State } ,
30+ } ;
2931use reth_db:: {
3032 ClientVersion , DatabaseEnv , init_db,
3133 mdbx:: { DatabaseArguments , KILOBYTE , MEGABYTE , MaxReadTransactionDuration } ,
@@ -35,11 +37,11 @@ use reth_optimism_chainspec::{BASE_MAINNET, OpChainSpec, OpChainSpecBuilder};
3537use reth_optimism_node:: OpNode ;
3638use reth_primitives_traits:: SealedHeader ;
3739use reth_provider:: {
38- HeaderProvider , ProviderFactory , StateProviderFactory , providers:: { BlockchainProvider , StaticFileProvider } ,
40+ HeaderProvider , ProviderFactory , StateProviderFactory ,
41+ providers:: { BlockchainProvider , StaticFileProvider } ,
3942} ;
4043use reth_testing_utils:: generators:: generate_keys;
41- use revm:: Database ;
42- use revm:: primitives:: KECCAK_EMPTY ;
44+ use revm:: { Database , primitives:: KECCAK_EMPTY } ;
4345
4446type NodeTypes = NodeTypesWithDBAdapter < OpNode , Arc < TempDatabase < DatabaseEnv > > > ;
4547
@@ -170,10 +172,7 @@ fn layering_old_state_only_cannot_see_pending_state() -> eyre::Result<()> {
170172 let account = db. basic ( alice_address) ?. expect ( "account should exist" ) ;
171173
172174 // Old implementation sees canonical nonce (0), not any pending state
173- assert_eq ! (
174- account. nonce, 0 ,
175- "Old State-only layering can only see canonical state"
176- ) ;
175+ assert_eq ! ( account. nonce, 0 , "Old State-only layering can only see canonical state" ) ;
177176
178177 Ok ( ( ) )
179178}
@@ -337,12 +336,8 @@ fn layering_cachedb_makes_pending_balance_visible() -> eyre::Result<()> {
337336 . provider
338337 . state_by_block_hash ( harness. header . hash ( ) )
339338 . context ( "getting state provider" ) ?;
340- let canonical_balance2 =
341- state_provider2. account_balance ( & alice_address) ?. unwrap_or ( U256 :: ZERO ) ;
342- assert_eq ! (
343- canonical_balance, canonical_balance2,
344- "Canonical state should be unchanged"
345- ) ;
339+ let canonical_balance2 = state_provider2. account_balance ( & alice_address) ?. unwrap_or ( U256 :: ZERO ) ;
340+ assert_eq ! ( canonical_balance, canonical_balance2, "Canonical state should be unchanged" ) ;
346341
347342 Ok ( ( ) )
348343}
@@ -409,10 +404,7 @@ fn layering_bundle_prestate_makes_pending_nonce_visible() -> eyre::Result<()> {
409404
410405 // Read through State without prestate - should see canonical nonce (0)
411406 let account2 = db_without_prestate. basic ( alice_address) ?. expect ( "account should exist" ) ;
412- assert_eq ! (
413- account2. nonce, 0 ,
414- "State without bundle_prestate should see canonical nonce"
415- ) ;
407+ assert_eq ! ( account2. nonce, 0 , "State without bundle_prestate should see canonical nonce" ) ;
416408
417409 Ok ( ( ) )
418410}
0 commit comments