From fa93b58257c34c313f52debba184b3fa871c51df Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Mon, 14 Aug 2023 00:29:46 +0000 Subject: [PATCH] remove `optional_eth2_network_config` (#4611) It seems the passed [`optional_config`](https://github.com/sigp/lighthouse/blob/dfcb3363c757671eb19d5f8e519b4b94ac74677a/lighthouse/src/main.rs#L515) is always `Some` instead of `None`. --- lighthouse/environment/src/lib.rs | 12 ------------ lighthouse/src/main.rs | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lighthouse/environment/src/lib.rs b/lighthouse/environment/src/lib.rs index 53915b52d9..fc7ab8d52c 100644 --- a/lighthouse/environment/src/lib.rs +++ b/lighthouse/environment/src/lib.rs @@ -344,18 +344,6 @@ impl EnvironmentBuilder { Ok(self) } - /// Optionally adds a network configuration to the environment. - pub fn optional_eth2_network_config( - self, - optional_config: Option, - ) -> Result { - if let Some(config) = optional_config { - self.eth2_network_config(config) - } else { - Ok(self) - } - } - /// Consumes the builder, returning an `Environment`. pub fn build(self) -> Result, String> { let (signal, exit) = exit_future::signal(); diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 73e042342a..8b3271f43b 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -513,7 +513,7 @@ fn run( let mut environment = builder .multi_threaded_tokio_runtime()? - .optional_eth2_network_config(Some(eth2_network_config))? + .eth2_network_config(eth2_network_config)? .build()?; let log = environment.core_context().log().clone();