1
- use alloy:: primitives:: B256 ;
2
- use alloy:: providers:: { Provider , ProviderBuilder } ;
3
1
use futures03:: { future:: BoxFuture , stream:: FuturesUnordered } ;
4
2
use graph:: abi;
5
3
use graph:: abi:: DynSolValueExt ;
@@ -21,6 +19,7 @@ use graph::futures03::future::try_join_all;
21
19
use graph:: futures03:: {
22
20
self , compat:: Future01CompatExt , FutureExt , StreamExt , TryFutureExt , TryStreamExt ,
23
21
} ;
22
+ use graph:: prelude:: alloy;
24
23
use graph:: prelude:: tokio:: try_join;
25
24
use graph:: slog:: o;
26
25
use graph:: tokio:: sync:: RwLock ;
@@ -78,7 +77,7 @@ pub struct EthereumAdapter {
78
77
logger : Logger ,
79
78
provider : String ,
80
79
web3 : Arc < Web3 < Transport > > ,
81
- alloy : Arc < dyn Provider > ,
80
+ alloy : Arc < dyn alloy :: providers :: Provider > ,
82
81
metrics : Arc < ProviderEthRpcMetrics > ,
83
82
supports_eip_1898 : bool ,
84
83
call_only : bool ,
@@ -139,7 +138,12 @@ impl EthereumAdapter {
139
138
Transport :: WS ( _web_socket) => todo ! ( ) ,
140
139
} ;
141
140
let web3 = Arc :: new ( Web3 :: new ( transport) ) ;
142
- let alloy = Arc :: new ( ProviderBuilder :: new ( ) . connect ( & rpc_url) . await . unwrap ( ) ) ;
141
+ let alloy = Arc :: new (
142
+ alloy:: providers:: ProviderBuilder :: new ( )
143
+ . connect ( & rpc_url)
144
+ . await
145
+ . unwrap ( ) ,
146
+ ) ;
143
147
144
148
EthereumAdapter {
145
149
logger,
@@ -520,11 +524,13 @@ impl EthereumAdapter {
520
524
}
521
525
}
522
526
523
- fn block_ptr_to_alloy_block_id ( & self , block_ptr : & BlockPtr ) -> alloy_rpc_types :: BlockId {
527
+ fn block_ptr_to_alloy_block_id ( & self , block_ptr : & BlockPtr ) -> alloy :: rpc :: types :: BlockId {
524
528
if !self . supports_eip_1898 {
525
- alloy_rpc_types :: BlockId :: number ( block_ptr. number as u64 )
529
+ alloy :: rpc :: types :: BlockId :: number ( block_ptr. number as u64 )
526
530
} else {
527
- alloy_rpc_types:: BlockId :: hash ( B256 :: new ( * block_ptr. hash_as_h256 ( ) . as_fixed_bytes ( ) ) )
531
+ alloy:: rpc:: types:: BlockId :: hash ( alloy:: primitives:: B256 :: new (
532
+ * block_ptr. hash_as_h256 ( ) . as_fixed_bytes ( ) ,
533
+ ) )
528
534
}
529
535
}
530
536
@@ -838,7 +844,7 @@ impl EthereumAdapter {
838
844
839
845
async move {
840
846
let block_result = alloy
841
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
847
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
842
848
number as u64 ,
843
849
) )
844
850
. await ;
@@ -897,7 +903,7 @@ impl EthereumAdapter {
897
903
let alloy = alloy. cheap_clone ( ) ;
898
904
async move {
899
905
let block = alloy
900
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
906
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
901
907
block_num as u64 ,
902
908
) )
903
909
. await ?;
@@ -1509,7 +1515,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1509
1515
let alloy = alloy. cheap_clone ( ) ;
1510
1516
async move {
1511
1517
alloy
1512
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
1518
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
1513
1519
next_number as u64 ,
1514
1520
) )
1515
1521
. await
0 commit comments