Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions crates/anvil/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,17 +1024,6 @@ impl NodeConfig {
self
}

/// Sets whether to enable Celo support
#[must_use]
pub fn with_celo(mut self, celo: bool) -> Self {
self.networks.celo = celo;
if celo {
// Celo requires Optimism support
self.networks.optimism = true;
}
self
}

/// Makes the node silent to not emit anything on stdout
#[must_use]
pub fn silent(self) -> Self {
Expand Down
5 changes: 4 additions & 1 deletion crates/anvil/tests/it/fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use alloy_signer_local::PrivateKeySigner;
use anvil::{EthereumHardfork, NodeConfig, NodeHandle, PrecompileFactory, eth::EthApi, spawn};
use foundry_common::provider::get_http_provider;
use foundry_config::Config;
use foundry_evm_networks::NetworkConfigs;
use foundry_test_utils::rpc::{self, next_http_rpc_endpoint, next_rpc_endpoint};
use futures::StreamExt;
use revm::precompile::{Precompile, PrecompileId, PrecompileOutput, PrecompileResult};
Expand Down Expand Up @@ -1711,7 +1712,9 @@ async fn test_config_with_cancun_hardfork() {
#[tokio::test(flavor = "multi_thread")]
async fn test_config_with_prague_hardfork_with_celo() {
let (api, _handle) = spawn(
NodeConfig::test().with_hardfork(Some(EthereumHardfork::Prague.into())).with_celo(true),
NodeConfig::test()
.with_hardfork(Some(EthereumHardfork::Prague.into()))
.with_networks(NetworkConfigs::with_celo()),
)
.await;

Expand Down
4 changes: 4 additions & 0 deletions crates/evm/networks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ impl NetworkConfigs {
Self { optimism: true, ..Default::default() }
}

pub fn with_celo() -> Self {
Self { celo: true, ..Default::default() }
}

pub fn with_chain_id(mut self, chain_id: u64) -> Self {
if let Ok(NamedChain::Celo | NamedChain::CeloSepolia) = NamedChain::try_from(chain_id) {
self.celo = true;
Expand Down
Loading