Skip to content

Commit

Permalink
chore: fix some typos & remove useless Arc::clone (bluealloy#1621)
Browse files Browse the repository at this point in the history
* chore: fix some typos

* chore: remove useless Arc::clone
  • Loading branch information
jackwener authored Jul 17, 2024
1 parent bac2f4a commit 1a13e2a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/interpreter/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bytecode>,
}

Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions crates/revm/src/handler/handle_types/post_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn Fn(&mut Context<EXT, DB>) + '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>,
Expand Down
4 changes: 2 additions & 2 deletions examples/fork_ref_transact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/generate_block_traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EthersDB<Provider<Http>>> = CacheDB::new(state_db);
let mut state = StateBuilder::new_with_database(cache_db).build();
let mut evm = Evm::builder()
Expand Down

0 comments on commit 1a13e2a

Please sign in to comment.