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: remove clone for context in handler_register.rs #1138

Merged
merged 1 commit into from
Mar 1, 2024
Merged
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
6 changes: 3 additions & 3 deletions crates/revm/src/optimism/handler_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn deduct_caller<SPEC: Spec, EXT, DB: Database>(
// caller's balance directly after minting the requested amount of ETH.
if context.evm.env.tx.optimism.source_hash.is_none() {
// get envelope
let Some(enveloped_tx) = context.evm.env.tx.optimism.enveloped_tx.clone() else {
let Some(enveloped_tx) = &context.evm.env.tx.optimism.enveloped_tx else {
return Err(EVMError::Custom(
"[OPTIMISM] Failed to load enveloped transaction.".to_string(),
));
Expand All @@ -194,7 +194,7 @@ pub fn deduct_caller<SPEC: Spec, EXT, DB: Database>(
.l1_block_info
.as_ref()
.expect("L1BlockInfo should be loaded")
.calculate_tx_l1_cost(&enveloped_tx, SPEC::SPEC_ID);
.calculate_tx_l1_cost(enveloped_tx, SPEC::SPEC_ID);
if tx_l1_cost.gt(&caller_account.info.balance) {
return Err(EVMError::Transaction(
InvalidTransaction::LackOfFundForMaxFee {
Expand Down Expand Up @@ -224,7 +224,7 @@ pub fn reward_beneficiary<SPEC: Spec, EXT, DB: Database>(
if !is_deposit {
// If the transaction is not a deposit transaction, fees are paid out
// to both the Base Fee Vault as well as the L1 Fee Vault.
let Some(l1_block_info) = context.evm.l1_block_info.clone() else {
let Some(l1_block_info) = &context.evm.l1_block_info else {
return Err(EVMError::Custom(
"[OPTIMISM] Failed to load L1 block information.".to_string(),
));
Expand Down
Loading