Skip to content

Commit 183311e

Browse files
authored
Remove redundant account initialization (#208)
1 parent d987794 commit 183311e

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

crates/op-rbuilder/src/tests/flashblocks.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use tokio_util::sync::CancellationToken;
88

99
use crate::{
1010
args::{FlashblocksArgs, OpRbuilderArgs},
11-
tests::{ChainDriverExt, LocalInstance, TransactionBuilderExt},
11+
tests::{LocalInstance, TransactionBuilderExt},
1212
};
1313

1414
#[rb_test(flashblocks, args = OpRbuilderArgs {
@@ -25,7 +25,6 @@ use crate::{
2525
})]
2626
async fn smoke_dynamic_base(rbuilder: LocalInstance) -> eyre::Result<()> {
2727
let driver = rbuilder.driver().await?;
28-
driver.fund_default_accounts().await?;
2928

3029
// Create a struct to hold received messages
3130
let received_messages = Arc::new(Mutex::new(Vec::new()));
@@ -94,7 +93,6 @@ async fn smoke_dynamic_base(rbuilder: LocalInstance) -> eyre::Result<()> {
9493
})]
9594
async fn smoke_dynamic_unichain(rbuilder: LocalInstance) -> eyre::Result<()> {
9695
let driver = rbuilder.driver().await?;
97-
driver.fund_default_accounts().await?;
9896

9997
// Create a struct to hold received messages
10098
let received_messages = Arc::new(Mutex::new(Vec::new()));
@@ -163,7 +161,6 @@ async fn smoke_dynamic_unichain(rbuilder: LocalInstance) -> eyre::Result<()> {
163161
})]
164162
async fn smoke_classic_unichain(rbuilder: LocalInstance) -> eyre::Result<()> {
165163
let driver = rbuilder.driver().await?;
166-
driver.fund_default_accounts().await?;
167164

168165
// Create a struct to hold received messages
169166
let received_messages = Arc::new(Mutex::new(Vec::new()));
@@ -232,7 +229,6 @@ async fn smoke_classic_unichain(rbuilder: LocalInstance) -> eyre::Result<()> {
232229
})]
233230
async fn smoke_classic_base(rbuilder: LocalInstance) -> eyre::Result<()> {
234231
let driver = rbuilder.driver().await?;
235-
driver.fund_default_accounts().await?;
236232

237233
// Create a struct to hold received messages
238234
let received_messages = Arc::new(Mutex::new(Vec::new()));
@@ -301,7 +297,6 @@ async fn smoke_classic_base(rbuilder: LocalInstance) -> eyre::Result<()> {
301297
})]
302298
async fn unichain_dynamic_with_lag(rbuilder: LocalInstance) -> eyre::Result<()> {
303299
let driver = rbuilder.driver().await?;
304-
driver.fund_default_accounts().await?;
305300

306301
// Create a struct to hold received messages
307302
let received_messages = Arc::new(Mutex::new(Vec::new()));
@@ -372,7 +367,6 @@ async fn unichain_dynamic_with_lag(rbuilder: LocalInstance) -> eyre::Result<()>
372367
})]
373368
async fn dynamic_with_full_block_lag(rbuilder: LocalInstance) -> eyre::Result<()> {
374369
let driver = rbuilder.driver().await?;
375-
driver.fund_default_accounts().await?;
376370

377371
// Create a struct to hold received messages
378372
let received_messages = Arc::new(Mutex::new(Vec::new()));

crates/op-rbuilder/src/tests/framework/instance.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
tests::{
77
create_test_db,
88
framework::{driver::ChainDriver, BUILDER_PRIVATE_KEY},
9-
ChainDriverExt, EngineApi, Ipc, TransactionPoolObserver,
9+
EngineApi, Ipc, TransactionPoolObserver,
1010
},
1111
tx::FBPooledTransaction,
1212
tx_signer::Signer,
@@ -179,10 +179,7 @@ impl LocalInstance {
179179
let Commands::Node(ref node_command) = args.command else {
180180
unreachable!()
181181
};
182-
let instance = Self::new::<StandardBuilder>(node_command.ext.clone()).await?;
183-
let driver = ChainDriver::<Ipc>::local(&instance).await?;
184-
driver.fund_default_accounts().await?;
185-
Ok(instance)
182+
Self::new::<StandardBuilder>(node_command.ext.clone()).await
186183
}
187184

188185
/// Creates new local instance of the OP builder node with the flashblocks builder configuration.
@@ -194,10 +191,7 @@ impl LocalInstance {
194191
};
195192
node_command.ext.flashblocks.enabled = true;
196193
node_command.ext.flashblocks.flashblocks_port = 0; // use random os assigned port
197-
let instance = Self::new::<FlashblocksBuilder>(node_command.ext.clone()).await?;
198-
let driver = ChainDriver::<Ipc>::local(&instance).await?;
199-
driver.fund_default_accounts().await?;
200-
Ok(instance)
194+
Self::new::<FlashblocksBuilder>(node_command.ext.clone()).await
201195
}
202196

203197
pub const fn config(&self) -> &NodeConfig<OpChainSpec> {

0 commit comments

Comments
 (0)