diff --git a/crates/rpc/rpc-eth-api/src/helpers/receipt.rs b/crates/rpc/rpc-eth-api/src/helpers/receipt.rs index 63016e3d2e..39da504750 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/receipt.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/receipt.rs @@ -26,15 +26,12 @@ pub trait LoadReceipt: EthApiTypes + Send + Sync { ) -> impl Future> + Send { async move { // get all receipts for the block - let all_receipts = match self + let all_receipts = self .cache() .get_receipts(meta.block_hash) .await .map_err(Self::Error::from_eth_err)? - { - Some(recpts) => recpts, - None => return Err(EthApiError::UnknownBlockNumber.into()), - }; + .ok_or_else(|| EthApiError::UnknownBlockNumber)?; Ok(ReceiptBuilder::new(&tx, meta, &receipt, &all_receipts)?.build()) }