diff --git a/zebra-state/src/config.rs b/zebra-state/src/config.rs index 9ef3f85d..009b2789 100644 --- a/zebra-state/src/config.rs +++ b/zebra-state/src/config.rs @@ -110,11 +110,12 @@ impl Config { (path, opts) } - /// Construct a config for an ephemeral in memory database - pub fn ephemeral() -> Self { - let mut config = Self::default(); - config.ephemeral = true; - config + /// Construct a config for an ephemeral database + pub fn ephemeral() -> Config { + Config { + ephemeral: true, + ..Config::default() + } } /// Calculate the database's share of `open_file_limit` diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index fd7938a6..1382a66a 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -39,11 +39,16 @@ use zebrad::config::ZebradConfig; const LAUNCH_DELAY: Duration = Duration::from_secs(3); fn default_test_config() -> Result { - let mut config = ZebradConfig::default(); - config.state = zebra_state::Config::ephemeral(); - config.network.listen_addr = "127.0.0.1:0".parse()?; - - Ok(config) + let auto_port_ipv4_local = zebra_network::Config { + listen_addr: "127.0.0.1:0".parse()?, + ..zebra_network::Config::default() + }; + let local_ephemeral = ZebradConfig { + state: zebra_state::Config::ephemeral(), + network: auto_port_ipv4_local, + ..ZebradConfig::default() + }; + Ok(local_ephemeral) } fn persistent_test_config() -> Result {