Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix some typos & remove useless Arc::clone #1621

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:?}"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This result is redundant

};

// 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
Loading