From cb0237901deeb543f23c923d526b9c5722753bca Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Fri, 3 May 2024 19:18:00 -0600 Subject: [PATCH] make it clear where a `custom` network will load configuration when printing --- ethereum-consensus/src/networks.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/ethereum-consensus/src/networks.rs b/ethereum-consensus/src/networks.rs index 619ff4044..33c036c89 100644 --- a/ethereum-consensus/src/networks.rs +++ b/ethereum-consensus/src/networks.rs @@ -25,7 +25,7 @@ impl std::fmt::Display for Network { Self::Sepolia => write!(f, "sepolia"), Self::Goerli => write!(f, "goerli"), Self::Holesky => write!(f, "holesky"), - Self::Custom(config_dir) => write!(f, "{config_dir}"), + Self::Custom(config_dir) => write!(f, "custom ({config_dir}/config.yaml)"), } } } @@ -70,21 +70,3 @@ impl TryFrom for Context { pub fn typical_genesis_time(context: &Context) -> u64 { context.min_genesis_time + context.genesis_delay } - -#[cfg(test)] -mod tests { - use super::*; - - #[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] - struct File { - network: Network, - } - - #[test] - fn test_serde() { - let file = File { network: Network::Custom("/path/to/foo.yaml".to_string()) }; - let str = toml::to_string(&file).unwrap(); - let recovered_file: File = toml::from_str(&str).unwrap(); - assert_eq!(file, recovered_file); - } -}