File tree Expand file tree Collapse file tree 2 files changed +0
-50
lines changed Expand file tree Collapse file tree 2 files changed +0
-50
lines changed Original file line number Diff line number Diff line change @@ -1124,21 +1124,6 @@ pub trait EthereumAdapter: Send + Sync + 'static {
1124
1124
block : LightEthereumBlock ,
1125
1125
) -> Result < EthereumBlock , bc:: IngestorError > ;
1126
1126
1127
- /// Find a block by its number, according to the Ethereum node.
1128
- ///
1129
- /// Careful: don't use this function without considering race conditions.
1130
- /// Chain reorgs could happen at any time, and could affect the answer received.
1131
- /// Generally, it is only safe to use this function with blocks that have received enough
1132
- /// confirmations to guarantee no further reorgs, **and** where the Ethereum node is aware of
1133
- /// those confirmations.
1134
- /// If the Ethereum node is far behind in processing blocks, even old blocks can be subject to
1135
- /// reorgs.
1136
- async fn block_hash_by_block_number (
1137
- & self ,
1138
- logger : & Logger ,
1139
- block_number : BlockNumber ,
1140
- ) -> Result < Option < H256 > , Error > ;
1141
-
1142
1127
/// Finds the hash and number of the lowest non-null block with height greater than or equal to
1143
1128
/// the given number.
1144
1129
///
Original file line number Diff line number Diff line change @@ -1475,41 +1475,6 @@ impl EthereumAdapterTrait for EthereumAdapter {
1475
1475
} )
1476
1476
}
1477
1477
1478
- async fn block_hash_by_block_number (
1479
- & self ,
1480
- logger : & Logger ,
1481
- block_number : BlockNumber ,
1482
- ) -> Result < Option < H256 > , Error > {
1483
- let web3 = self . web3 . clone ( ) ;
1484
- let retry_log_message = format ! (
1485
- "eth_getBlockByNumber RPC call for block number {}" ,
1486
- block_number
1487
- ) ;
1488
- retry ( retry_log_message, logger)
1489
- . redact_log_urls ( true )
1490
- . no_limit ( )
1491
- . timeout_secs ( ENV_VARS . json_rpc_timeout . as_secs ( ) )
1492
- . run ( move || {
1493
- let web3 = web3. cheap_clone ( ) ;
1494
- async move {
1495
- web3. eth ( )
1496
- . block ( BlockId :: Number ( block_number. into ( ) ) )
1497
- . await
1498
- . map ( |block_opt| block_opt. and_then ( |block| block. hash ) )
1499
- . map_err ( Error :: from)
1500
- }
1501
- } )
1502
- . await
1503
- . map_err ( move |e| {
1504
- e. into_inner ( ) . unwrap_or_else ( move || {
1505
- anyhow ! (
1506
- "Ethereum node took too long to return data for block #{}" ,
1507
- block_number
1508
- )
1509
- } )
1510
- } )
1511
- }
1512
-
1513
1478
async fn get_balance (
1514
1479
& self ,
1515
1480
logger : & Logger ,
You can’t perform that action at this time.
0 commit comments