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 ,
@@ -267,7 +266,12 @@ impl EthereumAdapter {
267
266
Transport :: WS ( _web_socket) => todo ! ( ) ,
268
267
} ;
269
268
let web3 = Arc :: new ( Web3 :: new ( transport) ) ;
270
- let alloy = Arc :: new ( ProviderBuilder :: new ( ) . connect ( & rpc_url) . await . unwrap ( ) ) ;
269
+ let alloy = Arc :: new (
270
+ alloy:: providers:: ProviderBuilder :: new ( )
271
+ . connect ( & rpc_url)
272
+ . await
273
+ . unwrap ( ) ,
274
+ ) ;
271
275
272
276
EthereumAdapter {
273
277
logger,
@@ -648,11 +652,13 @@ impl EthereumAdapter {
648
652
}
649
653
}
650
654
651
- fn block_ptr_to_alloy_block_id ( & self , block_ptr : & BlockPtr ) -> alloy_rpc_types :: BlockId {
655
+ fn block_ptr_to_alloy_block_id ( & self , block_ptr : & BlockPtr ) -> alloy :: rpc :: types :: BlockId {
652
656
if !self . supports_eip_1898 {
653
- alloy_rpc_types :: BlockId :: number ( block_ptr. number as u64 )
657
+ alloy :: rpc :: types :: BlockId :: number ( block_ptr. number as u64 )
654
658
} else {
655
- alloy_rpc_types:: BlockId :: hash ( B256 :: new ( * block_ptr. hash_as_h256 ( ) . as_fixed_bytes ( ) ) )
659
+ alloy:: rpc:: types:: BlockId :: hash ( alloy:: primitives:: B256 :: new (
660
+ * block_ptr. hash_as_h256 ( ) . as_fixed_bytes ( ) ,
661
+ ) )
656
662
}
657
663
}
658
664
@@ -853,7 +859,7 @@ impl EthereumAdapter {
853
859
854
860
async move {
855
861
let block_result = alloy
856
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
862
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
857
863
number as u64 ,
858
864
) )
859
865
. await ;
@@ -912,7 +918,7 @@ impl EthereumAdapter {
912
918
let alloy = alloy. cheap_clone ( ) ;
913
919
async move {
914
920
let block = alloy
915
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
921
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
916
922
block_num as u64 ,
917
923
) )
918
924
. await ?;
@@ -1524,7 +1530,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1524
1530
let alloy = alloy. cheap_clone ( ) ;
1525
1531
async move {
1526
1532
alloy
1527
- . get_block_by_number ( alloy_rpc_types :: BlockNumberOrTag :: Number (
1533
+ . get_block_by_number ( alloy :: rpc :: types :: BlockNumberOrTag :: Number (
1528
1534
next_number as u64 ,
1529
1535
) )
1530
1536
. await
0 commit comments