From 1849d7c6a9b16f848ae8eb53a4f0f68a178552d8 Mon Sep 17 00:00:00 2001 From: jackwener Date: Tue, 16 Jul 2024 23:30:21 +0800 Subject: [PATCH 1/2] chore: fix some typos --- crates/interpreter/src/interpreter.rs | 2 +- crates/primitives/src/state.rs | 4 ++-- crates/revm/src/handler/handle_types/post_execution.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/interpreter/src/interpreter.rs b/crates/interpreter/src/interpreter.rs index fbfac34a3c..ea1389e7fe 100644 --- a/crates/interpreter/src/interpreter.rs +++ b/crates/interpreter/src/interpreter.rs @@ -93,7 +93,7 @@ impl Interpreter { } } - /// Set set is_eof_init to true, this is used to enable `RETURNCONTRACT` opcode. + /// Set is_eof_init to true, this is used to enable `RETURNCONTRACT` opcode. #[inline] pub fn set_is_eof_init(&mut self) { self.is_eof_init = true; diff --git a/crates/primitives/src/state.rs b/crates/primitives/src/state.rs index fc4d1e609f..ff2e99f8b4 100644 --- a/crates/primitives/src/state.rs +++ b/crates/primitives/src/state.rs @@ -219,7 +219,7 @@ pub struct AccountInfo { /// code hash, pub code_hash: B256, /// code: if None, `code_by_hash` will be used to fetch it if code needs to be loaded from - /// inside of `revm`. + /// inside `revm`. pub code: Option, } @@ -288,7 +288,7 @@ impl AccountInfo { } /// Return bytecode hash associated with this account. - /// If account does not have code, it return's `KECCAK_EMPTY` hash. + /// If account does not have code, it returns `KECCAK_EMPTY` hash. pub fn code_hash(&self) -> B256 { self.code_hash } diff --git a/crates/revm/src/handler/handle_types/post_execution.rs b/crates/revm/src/handler/handle_types/post_execution.rs index f2149e8903..bfe9aab695 100644 --- a/crates/revm/src/handler/handle_types/post_execution.rs +++ b/crates/revm/src/handler/handle_types/post_execution.rs @@ -36,12 +36,12 @@ pub type EndHandle<'a, EXT, DB> = Arc< >; /// Clear handle, doesn't have output, its purpose is to clear the -/// context. It will be always called even on failed validation. +/// context. It will always be called even on failed validation. pub type ClearHandle<'a, EXT, DB> = Arc) + 'a>; /// Handles related to post execution after the stack loop is finished. pub struct PostExecutionHandler<'a, EXT, DB: Database> { - /// Reimburse the caller with ethereum it didn't spent. + /// Reimburse the caller with ethereum it didn't spend. pub reimburse_caller: ReimburseCallerHandle<'a, EXT, DB>, /// Reward the beneficiary with caller fee. pub reward_beneficiary: RewardBeneficiaryHandle<'a, EXT, DB>, From a84c0093fe56fa134fc012ac76b829814b7b8030 Mon Sep 17 00:00:00 2001 From: jackwener Date: Tue, 16 Jul 2024 23:33:32 +0800 Subject: [PATCH 2/2] chore: remove useless Arc::clone --- examples/fork_ref_transact.rs | 4 ++-- examples/generate_block_traces.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/fork_ref_transact.rs b/examples/fork_ref_transact.rs index 33258b46f0..014e2b1941 100644 --- a/examples/fork_ref_transact.rs +++ b/examples/fork_ref_transact.rs @@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> { let encoded = getReservesCall::new(()).abi_encode(); // initialize new EthersDB - let mut ethersdb = EthersDB::new(Arc::clone(&client), None).unwrap(); + let mut ethersdb = EthersDB::new(client, None).unwrap(); // query basic properties of an account incl bytecode let acc_info = ethersdb.basic(pool_address).unwrap().unwrap(); @@ -89,7 +89,7 @@ async fn main() -> anyhow::Result<()> { output: Output::Call(value), .. } => value, - result => panic!("Execution failed: {result:?}"), + _ => panic!("Execution failed: {result:?}"), }; // decode bytes to reserves + ts via alloy's abi decode diff --git a/examples/generate_block_traces.rs b/examples/generate_block_traces.rs index c3cba6ffb3..ef98fa2580 100644 --- a/examples/generate_block_traces.rs +++ b/examples/generate_block_traces.rs @@ -72,7 +72,7 @@ async fn main() -> anyhow::Result<()> { // Use the previous block state as the db with caching let prev_id: BlockId = previous_block_number.into(); // SAFETY: This cannot fail since this is in the top-level tokio runtime - let state_db = EthersDB::new(Arc::clone(&client), Some(prev_id)).expect("panic"); + let state_db = EthersDB::new(client, Some(prev_id)).expect("panic"); let cache_db: CacheDB>> = CacheDB::new(state_db); let mut state = StateBuilder::new_with_database(cache_db).build(); let mut evm = Evm::builder()