Skip to content

Commit

Permalink
chore: remove some clones
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-rise committed Oct 23, 2024
1 parent 8a40d5c commit ff86474
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/evm/src/system_calls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
DB::Error: Display,
{
let result_and_state = eip2935::transact_blockhashes_contract_call(
&self.evm_config.clone(),
&self.evm_config,
&self.chain_spec,
timestamp,
block_number,
Expand Down Expand Up @@ -226,7 +226,7 @@ where
DB::Error: Display,
{
let result_and_state = eip4788::transact_beacon_root_contract_call(
&self.evm_config.clone(),
&self.evm_config,
&self.chain_spec,
timestamp,
block_number,
Expand Down
14 changes: 4 additions & 10 deletions crates/optimism/payload/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@ where
args: BuildArguments<Pool, Client, OptimismPayloadBuilderAttributes, OptimismBuiltPayload>,
) -> Result<BuildOutcome<OptimismBuiltPayload>, PayloadBuilderError> {
let (cfg_env, block_env) = self.cfg_and_block_env(&args.config, &args.config.parent_block);
optimism_payload(
self.evm_config.clone(),
args,
cfg_env,
block_env,
self.compute_pending_block,
)
optimism_payload(&self.evm_config, args, cfg_env, block_env, self.compute_pending_block)
}

fn on_missing_payload(
Expand Down Expand Up @@ -140,7 +134,7 @@ where
best_payload: None,
};
let (cfg_env, block_env) = self.cfg_and_block_env(&args.config, &args.config.parent_block);
optimism_payload(self.evm_config.clone(), args, cfg_env, block_env, false)?
optimism_payload(&self.evm_config, args, cfg_env, block_env, false)?
.into_payload()
.ok_or_else(|| PayloadBuilderError::MissingPayload)
}
Expand All @@ -156,7 +150,7 @@ where
/// a result indicating success with the payload or an error in case of failure.
#[inline]
pub(crate) fn optimism_payload<EvmConfig, Pool, Client>(
evm_config: EvmConfig,
evm_config: &EvmConfig,
args: BuildArguments<Pool, Client, OptimismPayloadBuilderAttributes, OptimismBuiltPayload>,
initialized_cfg: CfgEnvWithHandlerCfg,
initialized_block_env: BlockEnv,
Expand Down Expand Up @@ -430,7 +424,7 @@ where
&mut db,
&chain_spec,
attributes.payload_attributes.timestamp,
attributes.clone().payload_attributes.withdrawals,
attributes.payload_attributes.withdrawals.clone(),
)?;

// merge all transitions into bundle state, this would apply the withdrawal balance changes
Expand Down

0 comments on commit ff86474

Please sign in to comment.