1- pub use alloy:: eips:: BlockId ;
2- use alloy:: transports:: TransportError ;
31use alloy:: {
2+ eips:: BlockId ,
43 primitives:: { StorageValue , U256 } ,
54 providers:: {
65 network:: { primitives:: HeaderResponse , BlockResponse } ,
76 Network , Provider ,
87 } ,
8+ transports:: TransportError ,
99} ;
1010use core:: error:: Error ;
11- use revm:: database_interface:: { async_db:: DatabaseAsyncRef , DBErrorMarker } ;
12- use revm:: primitives:: { Address , B256 } ;
13-
14- use revm:: state:: { AccountInfo , Bytecode } ;
11+ use revm:: {
12+ database_interface:: { async_db:: DatabaseAsyncRef , DBErrorMarker } ,
13+ primitives:: { Address , B256 } ,
14+ state:: { AccountInfo , Bytecode } ,
15+ } ;
1516use std:: fmt:: Display ;
1617
1718/// A type alias for the storage key used in the database.
@@ -43,15 +44,15 @@ impl From<TransportError> for DBTransportError {
4344///
4445/// When accessing the database, it'll use the given provider to fetch the corresponding account's data.
4546#[ derive( Debug ) ]
46- pub struct AlloyDB < N : Network , P : Provider < N > > {
47+ pub struct AlloyDb < N : Network , P : Provider < N > > {
4748 /// The provider to fetch the data from.
4849 provider : P ,
4950 /// The block number on which the queries will be based on.
5051 block_number : BlockId ,
5152 _marker : core:: marker:: PhantomData < fn ( ) -> N > ,
5253}
5354
54- impl < N : Network , P : Provider < N > > AlloyDB < N , P > {
55+ impl < N : Network , P : Provider < N > > AlloyDb < N , P > {
5556 /// Creates a new AlloyDB instance, with a [Provider] and a block.
5657 pub fn new ( provider : P , block_number : BlockId ) -> Self {
5758 Self { provider, block_number, _marker : core:: marker:: PhantomData }
@@ -63,7 +64,7 @@ impl<N: Network, P: Provider<N>> AlloyDB<N, P> {
6364 }
6465}
6566
66- impl < N : Network , P : Provider < N > > DatabaseAsyncRef for AlloyDB < N , P > {
67+ impl < N : Network , P : Provider < N > > DatabaseAsyncRef for AlloyDb < N , P > {
6768 type Error = DBTransportError ;
6869
6970 async fn basic_async_ref ( & self , address : Address ) -> Result < Option < AccountInfo > , Self :: Error > {
@@ -117,7 +118,7 @@ mod tests {
117118 let client = ProviderBuilder :: new ( ) . connect_http (
118119 "https://mainnet.infura.io/v3/c60b0bb42f8a4c6481ecd229eddaca27" . parse ( ) . unwrap ( ) ,
119120 ) ;
120- let alloydb = AlloyDB :: new ( client, BlockId :: from ( 16148323 ) ) ;
121+ let alloydb = AlloyDb :: new ( client, BlockId :: from ( 16148323 ) ) ;
121122 let wrapped_alloydb = WrapDatabaseAsync :: new ( alloydb) . unwrap ( ) ;
122123
123124 // ETH/USDT pair on Uniswap V2
0 commit comments