Skip to content

Commit 1bf34e9

Browse files
authored
chore: rm NodeConfig::with_optimism (#12035)
1 parent f521c23 commit 1bf34e9

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

crates/anvil/src/config.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -989,13 +989,6 @@ impl NodeConfig {
989989
Config::foundry_block_cache_file(chain_id, block)
990990
}
991991

992-
/// Sets whether to enable optimism support
993-
#[must_use]
994-
pub fn with_optimism(mut self, enable_optimism: bool) -> Self {
995-
self.networks.optimism = enable_optimism;
996-
self
997-
}
998-
999992
/// Sets whether to disable the default create2 deployer
1000993
#[must_use]
1001994
pub fn with_disable_default_create2_deployer(mut self, yes: bool) -> Self {

crates/anvil/tests/it/optimism.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use alloy_provider::Provider;
88
use alloy_rpc_types::TransactionRequest;
99
use alloy_serde::WithOtherFields;
1010
use anvil::{NodeConfig, spawn};
11+
use foundry_evm_networks::NetworkConfigs;
1112
use op_alloy_consensus::TxDeposit;
1213
use op_alloy_rpc_types::OpTransactionFields;
1314

@@ -47,7 +48,8 @@ async fn test_deposits_not_supported_if_optimism_disabled() {
4748
#[tokio::test(flavor = "multi_thread")]
4849
async fn test_send_value_deposit_transaction() {
4950
// enable the Optimism flag
50-
let (api, handle) = spawn(NodeConfig::test().with_optimism(true)).await;
51+
let (api, handle) =
52+
spawn(NodeConfig::test().with_networks(NetworkConfigs::with_optimism())).await;
5153

5254
let accounts: Vec<_> = handle.dev_wallets().collect();
5355
let signer: EthereumWallet = accounts[0].clone().into();
@@ -94,7 +96,8 @@ async fn test_send_value_deposit_transaction() {
9496
#[tokio::test(flavor = "multi_thread")]
9597
async fn test_send_value_raw_deposit_transaction() {
9698
// enable the Optimism flag
97-
let (api, handle) = spawn(NodeConfig::test().with_optimism(true)).await;
99+
let (api, handle) =
100+
spawn(NodeConfig::test().with_networks(NetworkConfigs::with_optimism())).await;
98101

99102
let accounts: Vec<_> = handle.dev_wallets().collect();
100103
let signer: EthereumWallet = accounts[0].clone().into();
@@ -150,7 +153,8 @@ async fn test_send_value_raw_deposit_transaction() {
150153
#[tokio::test(flavor = "multi_thread")]
151154
async fn test_deposit_transaction_hash_matches_sepolia() {
152155
// enable the Optimism flag
153-
let (_api, handle) = spawn(NodeConfig::test().with_optimism(true)).await;
156+
let (_api, handle) =
157+
spawn(NodeConfig::test().with_networks(NetworkConfigs::with_optimism())).await;
154158

155159
let accounts: Vec<_> = handle.dev_wallets().collect();
156160
let signer: EthereumWallet = accounts[0].clone().into();
@@ -181,7 +185,8 @@ async fn test_deposit_transaction_hash_matches_sepolia() {
181185
#[tokio::test(flavor = "multi_thread")]
182186
async fn test_deposit_tx_checks_sufficient_funds_after_applying_deposited_value() {
183187
// enable the Optimism flag
184-
let (_api, handle) = spawn(NodeConfig::test().with_optimism(true)).await;
188+
let (_api, handle) =
189+
spawn(NodeConfig::test().with_networks(NetworkConfigs::with_optimism())).await;
185190

186191
let provider = http_provider(&handle.http_endpoint());
187192

0 commit comments

Comments
 (0)