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 @@ -1512,20 +1512,24 @@ impl EthereumAdapterTrait for EthereumAdapter {
1512
1512
"eth_getBlockByNumber RPC call for block number {}" ,
1513
1513
next_number
1514
1514
) ;
1515
- let web3 = self . web3 . clone ( ) ;
1515
+ let alloy = self . alloy . clone ( ) ;
1516
1516
let logger = logger. clone ( ) ;
1517
1517
let res = retry ( retry_log_message, & logger)
1518
1518
. redact_log_urls ( true )
1519
1519
. when ( |res| !res. is_ok ( ) && !detect_null_block ( res) )
1520
1520
. no_limit ( )
1521
1521
. timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1522
1522
. run ( move || {
1523
- let web3 = web3 . cheap_clone ( ) ;
1523
+ let alloy = alloy . cheap_clone ( ) ;
1524
1524
async move {
1525
- web3. eth ( )
1526
- . block ( BlockId :: Number ( next_number. into ( ) ) )
1525
+ alloy
1526
+ . get_block_by_number ( alloy_rpc_types:: BlockNumberOrTag :: Number (
1527
+ next_number as u64 ,
1528
+ ) )
1527
1529
. await
1528
- . map ( |block_opt| block_opt. and_then ( |block| block. hash ) )
1530
+ . map ( |block_opt| {
1531
+ block_opt. map ( |block| BlockHash :: from ( block. header . hash . 0 . to_vec ( ) ) )
1532
+ } )
1529
1533
. map_err ( Error :: from)
1530
1534
}
1531
1535
} )
@@ -1543,7 +1547,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1543
1547
continue ;
1544
1548
}
1545
1549
return match res {
1546
- Ok ( Some ( hash) ) => Ok ( BlockPtr :: new ( hash. into ( ) , next_number) ) ,
1550
+ Ok ( Some ( hash) ) => Ok ( BlockPtr :: new ( hash, next_number) ) ,
1547
1551
Ok ( None ) => Err ( anyhow ! ( "Block {} does not contain hash" , next_number) ) ,
1548
1552
Err ( e) => Err ( e) ,
1549
1553
} ;
You can’t perform that action at this time.
0 commit comments