diff --git a/bin/reth/src/commands/p2p/mod.rs b/bin/reth/src/commands/p2p/mod.rs index 2de5a9aa5..b40207c80 100644 --- a/bin/reth/src/commands/p2p/mod.rs +++ b/bin/reth/src/commands/p2p/mod.rs @@ -3,7 +3,7 @@ use crate::{ args::{ get_secret_key, - utils::{chain_help, chain_spec_value_parser, hash_or_num_value_parser, SUPPORTED_CHAINS}, + utils::{chain_help, genesis_value_parser, hash_or_num_value_parser, SUPPORTED_CHAINS}, DatabaseArgs, DiscoveryArgs, NetworkArgs, }, utils::get_single_header, @@ -40,7 +40,7 @@ pub struct Command { value_name = "CHAIN_OR_PATH", long_help = chain_help(), default_value = SUPPORTED_CHAINS[0], - value_parser = chain_spec_value_parser + value_parser = genesis_value_parser )] chain: Arc, diff --git a/crates/node-core/src/args/utils.rs b/crates/node-core/src/args/utils.rs index 38c0b01b6..784a3f818 100644 --- a/crates/node-core/src/args/utils.rs +++ b/crates/node-core/src/args/utils.rs @@ -32,35 +32,6 @@ pub fn parse_duration_from_secs(arg: &str) -> eyre::Result eyre::Result, eyre::Error> { - Ok(match s { - #[cfg(not(feature = "optimism"))] - "mainnet" => MAINNET.clone(), - #[cfg(not(feature = "optimism"))] - "goerli" => GOERLI.clone(), - #[cfg(not(feature = "optimism"))] - "sepolia" => SEPOLIA.clone(), - #[cfg(not(feature = "optimism"))] - "holesky" => HOLESKY.clone(), - #[cfg(not(feature = "optimism"))] - "dev" => DEV.clone(), - #[cfg(feature = "optimism")] - "optimism" => OP_MAINNET.clone(), - #[cfg(feature = "optimism")] - "optimism_sepolia" | "optimism-sepolia" => OP_SEPOLIA.clone(), - #[cfg(feature = "optimism")] - "base" => BASE_MAINNET.clone(), - #[cfg(feature = "optimism")] - "base_sepolia" | "base-sepolia" => BASE_SEPOLIA.clone(), - _ => { - let raw = fs::read_to_string(PathBuf::from(shellexpand::full(s)?.into_owned()))?; - serde_json::from_str(&raw)? - } - }) -} - /// The help info for the --chain flag pub fn chain_help() -> String { format!("The chain this node is running.\nPossible values are either a built-in chain or the path to a chain specification file.\n\nBuilt-in chains:\n {}", SUPPORTED_CHAINS.join(", ")) @@ -178,7 +149,6 @@ mod tests { #[test] fn parse_known_chain_spec() { for chain in SUPPORTED_CHAINS { - chain_spec_value_parser(chain).unwrap(); genesis_value_parser(chain).unwrap(); } }