diff --git a/crates/rpc/rpc-api/src/eth.rs b/crates/rpc/rpc-api/src/eth.rs index 5050e8f5995f..9ff6e32c89e1 100644 --- a/crates/rpc/rpc-api/src/eth.rs +++ b/crates/rpc/rpc-api/src/eth.rs @@ -74,10 +74,8 @@ pub trait EthApi { /// Returns all transaction receipts for a given block. #[method(name = "getBlockReceipts")] - async fn block_receipts( - &self, - number: BlockNumberOrTag, - ) -> RpcResult>>; + async fn block_receipts(&self, block_id: BlockId) + -> RpcResult>>; /// Returns an uncle block of the given block and index. #[method(name = "getUncleByBlockHashAndIndex")] diff --git a/crates/rpc/rpc/src/eth/api/block.rs b/crates/rpc/rpc/src/eth/api/block.rs index b778c4d3891a..a257a28c2992 100644 --- a/crates/rpc/rpc/src/eth/api/block.rs +++ b/crates/rpc/rpc/src/eth/api/block.rs @@ -8,7 +8,7 @@ use crate::{ EthApi, }; use reth_network_api::NetworkInfo; -use reth_primitives::{BlockId, BlockNumberOrTag, TransactionMeta}; +use reth_primitives::{BlockId, TransactionMeta}; use reth_provider::{BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, StateProviderFactory}; use reth_rpc_types::{Index, RichBlock, TransactionReceipt}; @@ -59,13 +59,13 @@ where /// Returns `None` if the block wasn't found. pub(crate) async fn block_receipts( &self, - number: BlockNumberOrTag, + block_id: BlockId, ) -> EthResult>> { let mut block_and_receipts = None; - if number.is_pending() { + if block_id.is_pending() { block_and_receipts = self.provider().pending_block_and_receipts()?; - } else if let Some(block_hash) = self.provider().block_hash_for_id(number.into())? { + } else if let Some(block_hash) = self.provider().block_hash_for_id(block_id)? { block_and_receipts = self.cache().get_block_and_receipts(block_hash).await?; } diff --git a/crates/rpc/rpc/src/eth/api/server.rs b/crates/rpc/rpc/src/eth/api/server.rs index b961785f43ad..9801878969d1 100644 --- a/crates/rpc/rpc/src/eth/api/server.rs +++ b/crates/rpc/rpc/src/eth/api/server.rs @@ -126,12 +126,9 @@ where } /// Handler for: `eth_getBlockReceipts` - async fn block_receipts( - &self, - number: BlockNumberOrTag, - ) -> Result>> { - trace!(target: "rpc::eth", ?number, "Serving eth_getBlockReceipts"); - Ok(EthApi::block_receipts(self, number).await?) + async fn block_receipts(&self, block_id: BlockId) -> Result>> { + trace!(target: "rpc::eth", ?block_id, "Serving eth_getBlockReceipts"); + Ok(EthApi::block_receipts(self, block_id).await?) } /// Handler for: `eth_getUncleByBlockHashAndIndex`