Skip to content

Commit

Permalink
fix(cli): error if recursive base config, remove goerli netowrks
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Jul 2, 2024
1 parent 307e8c2 commit f7aa694
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 26 deletions.
4 changes: 0 additions & 4 deletions bin/rundler/chain_specs/arbitrum_goerli.toml

This file was deleted.

4 changes: 0 additions & 4 deletions bin/rundler/chain_specs/ethereum_goerli.toml

This file was deleted.

4 changes: 0 additions & 4 deletions bin/rundler/chain_specs/optimism_goerli.toml

This file was deleted.

6 changes: 0 additions & 6 deletions bin/rundler/chain_specs/polygon_mumbai.toml

This file was deleted.

19 changes: 11 additions & 8 deletions bin/rundler/src/cli/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ pub fn resolve_chain_spec(network: &Option<String>, file: &Option<String>) -> Ch
let mut config_builder =
Config::builder().add_source(File::from_str(default.as_str(), FileFormat::Json));
if let Some(base) = base {
config_builder = config_builder.add_source(File::from_str(
get_hardcoded_chain_spec(base.as_str()),
FileFormat::Toml,
));
let base_spec = get_hardcoded_chain_spec(base.as_str());

// base config must not have a base key, recursive base is not allowed
Config::builder()
.add_source(File::from_str(base_spec, FileFormat::Toml))
.build()
.expect("should build base config")
.get::<String>("base")
.expect_err("base config must not have a base key");

config_builder = config_builder.add_source(File::from_str(base_spec, FileFormat::Toml));
}
if let Some(network_source) = network_source {
config_builder = config_builder.add_source(network_source);
Expand Down Expand Up @@ -105,17 +112,13 @@ macro_rules! define_hardcoded_chain_specs {
define_hardcoded_chain_specs!(
dev,
ethereum,
ethereum_goerli,
ethereum_sepolia,
optimism,
optimism_goerli,
optimism_sepolia,
base,
base_sepolia,
arbitrum,
arbitrum_goerli,
arbitrum_sepolia,
polygon,
polygon_mumbai,
polygon_amoy
);

0 comments on commit f7aa694

Please sign in to comment.