Skip to content

Commit f47b224

Browse files
committed
chore(runner): remove cloning by directly applying extensions
1 parent eeaba4c commit f47b224

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

crates/rpc/tests/eip7702_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl TestSetup {
3535

3636
// Deploy Minimal7702Account contract
3737
let deploy_data = Minimal7702Account::BYTECODE.to_vec();
38-
let (account_deploy_tx, account_contract_address, _) =
38+
let (account_deploy_tx, account_contract_address, _account_deploy_hash) =
3939
deployer.create_deployment_tx(Bytes::from(deploy_data), 0)?;
4040

4141
Ok(Self { harness, account_contract_address, account_deploy_tx })

crates/runner/src/extensions/canon.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ impl FlashblocksCanonExtension {
3030

3131
impl BaseNodeExtension for FlashblocksCanonExtension {
3232
/// Applies the extension to the supplied builder.
33-
fn apply(&self, builder: OpBuilder) -> OpBuilder {
34-
let flashblocks = self.config.clone();
33+
fn apply(self: Box<Self>, builder: OpBuilder) -> OpBuilder {
34+
let flashblocks = self.config;
3535
let flashblocks_enabled = flashblocks.is_some();
36-
let flashblocks_cell = self.cell.clone();
36+
let flashblocks_cell = self.cell;
3737

3838
builder.install_exex_if(flashblocks_enabled, "flashblocks-canon", move |mut ctx| {
3939
let flashblocks_cell = flashblocks_cell.clone();

crates/runner/src/extensions/extension.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{BaseNodeConfig, extensions::OpBuilder};
99
/// A node builder extension that can apply additional wiring to the builder.
1010
pub trait BaseNodeExtension: Send + Sync + Debug {
1111
/// Applies the extension to the supplied builder.
12-
fn apply(&self, builder: OpBuilder) -> OpBuilder;
12+
fn apply(self: Box<Self>, builder: OpBuilder) -> OpBuilder;
1313
}
1414

1515
/// An extension that can be constructed from [`BaseNodeConfig`].

crates/runner/src/extensions/rpc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ impl BaseRpcExtension {
4242

4343
impl BaseNodeExtension for BaseRpcExtension {
4444
/// Applies the extension to the supplied builder.
45-
fn apply(&self, builder: OpBuilder) -> OpBuilder {
46-
let flashblocks_cell = self.flashblocks_cell.clone();
47-
let flashblocks = self.flashblocks.clone();
45+
fn apply(self: Box<Self>, builder: OpBuilder) -> OpBuilder {
46+
let flashblocks_cell = self.flashblocks_cell;
47+
let flashblocks = self.flashblocks;
4848
let metering_enabled = self.metering_enabled;
49-
let sequencer_rpc = self.sequencer_rpc.clone();
49+
let sequencer_rpc = self.sequencer_rpc;
5050

5151
builder.extend_rpc_modules(move |ctx| {
5252
if metering_enabled {

crates/runner/src/extensions/tracing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl TransactionTracingExtension {
2424

2525
impl BaseNodeExtension for TransactionTracingExtension {
2626
/// Applies the extension to the supplied builder.
27-
fn apply(&self, builder: OpBuilder) -> OpBuilder {
27+
fn apply(self: Box<Self>, builder: OpBuilder) -> OpBuilder {
2828
let tracing = self.config;
2929
builder.install_exex_if(tracing.enabled, "tracex", move |ctx| async move {
3030
Ok(tracex_exex(ctx, tracing.logs_enabled))

0 commit comments

Comments
 (0)