Skip to content

Commit e682792

Browse files
authored
chore: remove clone for context in handler_register.rs (#1138)
1 parent a89daef commit e682792

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/revm/src/optimism/handler_register.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn deduct_caller<SPEC: Spec, EXT, DB: Database>(
183183
// caller's balance directly after minting the requested amount of ETH.
184184
if context.evm.env.tx.optimism.source_hash.is_none() {
185185
// get envelope
186-
let Some(enveloped_tx) = context.evm.env.tx.optimism.enveloped_tx.clone() else {
186+
let Some(enveloped_tx) = &context.evm.env.tx.optimism.enveloped_tx else {
187187
return Err(EVMError::Custom(
188188
"[OPTIMISM] Failed to load enveloped transaction.".to_string(),
189189
));
@@ -194,7 +194,7 @@ pub fn deduct_caller<SPEC: Spec, EXT, DB: Database>(
194194
.l1_block_info
195195
.as_ref()
196196
.expect("L1BlockInfo should be loaded")
197-
.calculate_tx_l1_cost(&enveloped_tx, SPEC::SPEC_ID);
197+
.calculate_tx_l1_cost(enveloped_tx, SPEC::SPEC_ID);
198198
if tx_l1_cost.gt(&caller_account.info.balance) {
199199
return Err(EVMError::Transaction(
200200
InvalidTransaction::LackOfFundForMaxFee {
@@ -224,7 +224,7 @@ pub fn reward_beneficiary<SPEC: Spec, EXT, DB: Database>(
224224
if !is_deposit {
225225
// If the transaction is not a deposit transaction, fees are paid out
226226
// to both the Base Fee Vault as well as the L1 Fee Vault.
227-
let Some(l1_block_info) = context.evm.l1_block_info.clone() else {
227+
let Some(l1_block_info) = &context.evm.l1_block_info else {
228228
return Err(EVMError::Custom(
229229
"[OPTIMISM] Failed to load L1 block information.".to_string(),
230230
));

0 commit comments

Comments
 (0)