diff --git a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs index 01b3f6c1b7..17f33217f0 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/transaction.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/transaction.rs @@ -15,7 +15,7 @@ use alloy_dyn_abi::TypedData; use alloy_eips::{eip2718::Encodable2718, BlockId}; use alloy_network::{TransactionBuilder, TransactionBuilder4844}; use alloy_primitives::{Address, Bytes, TxHash, B256, U256}; -use alloy_rpc_types_eth::{BlockNumberOrTag, TransactionInfo}; +use alloy_rpc_types_eth::TransactionInfo; use futures::{Future, StreamExt}; use reth_chain_state::CanonStateSubscriptions; use reth_primitives_traits::{ @@ -343,9 +343,7 @@ pub trait EthTransactions: LoadTransaction { return Ok(None); } - let Ok(high) = self.provider().best_block_number() else { - return Err(EthApiError::HeaderNotFound(BlockNumberOrTag::Latest.into()).into()); - }; + let high = self.provider().best_block_number().map_err(Self::Error::from_eth_err)?; // Perform a binary search over the block range to find the block in which the sender's // nonce reached the requested nonce.