From 446f24b5e1805b833b40e849c6937bd59c386c64 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 2 Jul 2024 16:55:18 +0000 Subject: [PATCH] apply codereview Signed-off-by: jsvisa --- crates/rpc/rpc/src/otterscan.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc/src/otterscan.rs b/crates/rpc/rpc/src/otterscan.rs index a10639253cdc..ea74df23fcdf 100644 --- a/crates/rpc/rpc/src/otterscan.rs +++ b/crates/rpc/rpc/src/otterscan.rs @@ -20,6 +20,7 @@ use revm_inspectors::{ transfer::{TransferInspector, TransferKind}, }; use revm_primitives::ExecutionResult; +use tracing::debug; const API_LEVEL: u64 = 8; @@ -219,7 +220,7 @@ where // use binary search from block [1, latest block number] to find the first block where the // contract was deployed let mut low = 1; - let mut high = self.eth.block_number()?.try_into().unwrap(); + let mut high = self.eth.block_number()?.saturating_to::(); let mut num = None; while low < high { @@ -235,7 +236,7 @@ where // this should not happen, only if the state of the chain is inconsistent let Some(num) = num else { - // debug log here + debug!(target: "rpc::otterscan", address = ?address, "Contract not found in history state"); return Ok(None) };