Skip to content

Commit

Permalink
rebase clean
Browse files Browse the repository at this point in the history
  • Loading branch information
mangas committed Jun 12, 2024
1 parent 92c68fd commit daf4d11
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,43 +129,6 @@ impl EthereumAdapter {
}
}

pub async fn check_block_receipt_support(
web3: Arc<Web3<impl web3::Transport>>,
provider: &str,
supports_eip_1898: bool,
call_only: bool,
logger: &Logger,
) -> Result<(), Error> {
if call_only {
warn!(logger, "Call only providers not supported"; "provider" => provider);
return Err(anyhow!("Call only providers not supported"));
}

if !supports_eip_1898 {
warn!(logger, "EIP-1898 not supported"; "provider" => provider);
return Err(anyhow!("EIP-1898 not supported"));
}

// Fetch block receipts from the provider for the latest block.
let block_receipts_result = web3
.eth()
.block_receipts(BlockId::Number(Web3BlockNumber::Latest))
.await;

// Determine if the provider supports block receipts based on the fetched result.
match block_receipts_result {
Ok(Some(receipts)) if !receipts.is_empty() => Ok(()),
Ok(_) => {
warn!(logger, "Block receipts are empty"; "provider" => provider);
Err(anyhow!("Block receipts are empty"))
}
Err(err) => {
warn!(logger, "Failed to fetch block receipts"; "provider" => provider, "error" => err.to_string());
Err(anyhow!("Failed to fetch block receipts: {}", err))
}
}
}

async fn traces(
self,
logger: Logger,
Expand Down

0 comments on commit daf4d11

Please sign in to comment.