File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1497,20 +1497,24 @@ impl EthereumAdapterTrait for EthereumAdapter {
1497
1497
"eth_getBlockByNumber RPC call for block number {}" ,
1498
1498
next_number
1499
1499
) ;
1500
- let web3 = self . web3 . clone ( ) ;
1500
+ let alloy = self . alloy . clone ( ) ;
1501
1501
let logger = logger. clone ( ) ;
1502
1502
let res = retry ( retry_log_message, & logger)
1503
1503
. redact_log_urls ( true )
1504
1504
. when ( |res| !res. is_ok ( ) && !detect_null_block ( res) )
1505
1505
. no_limit ( )
1506
1506
. timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1507
1507
. run ( move || {
1508
- let web3 = web3 . cheap_clone ( ) ;
1508
+ let alloy = alloy . cheap_clone ( ) ;
1509
1509
async move {
1510
- web3. eth ( )
1511
- . block ( BlockId :: Number ( next_number. into ( ) ) )
1510
+ alloy
1511
+ . get_block_by_number ( alloy_rpc_types:: BlockNumberOrTag :: Number (
1512
+ next_number as u64 ,
1513
+ ) )
1512
1514
. await
1513
- . map ( |block_opt| block_opt. and_then ( |block| block. hash ) )
1515
+ . map ( |block_opt| {
1516
+ block_opt. map ( |block| BlockHash :: from ( block. header . hash . 0 . to_vec ( ) ) )
1517
+ } )
1514
1518
. map_err ( Error :: from)
1515
1519
}
1516
1520
} )
@@ -1528,7 +1532,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1528
1532
continue ;
1529
1533
}
1530
1534
return match res {
1531
- Ok ( Some ( hash) ) => Ok ( BlockPtr :: new ( hash. into ( ) , next_number) ) ,
1535
+ Ok ( Some ( hash) ) => Ok ( BlockPtr :: new ( hash, next_number) ) ,
1532
1536
Ok ( None ) => Err ( anyhow ! ( "Block {} does not contain hash" , next_number) ) ,
1533
1537
Err ( e) => Err ( e) ,
1534
1538
} ;
You can’t perform that action at this time.
0 commit comments