Skip to content

Commit

Permalink
apply codereview
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed Jul 2, 2024
1 parent 3a016bd commit 446f24b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/rpc/rpc/src/otterscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use revm_inspectors::{
transfer::{TransferInspector, TransferKind},
};
use revm_primitives::ExecutionResult;
use tracing::debug;

const API_LEVEL: u64 = 8;

Expand Down Expand Up @@ -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::<u64>();
let mut num = None;

while low < high {
Expand All @@ -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)
};

Expand Down

0 comments on commit 446f24b

Please sign in to comment.