diff --git a/cmd/crates/soroban-test/src/lib.rs b/cmd/crates/soroban-test/src/lib.rs index 8752255e6..bf269a2d2 100644 --- a/cmd/crates/soroban-test/src/lib.rs +++ b/cmd/crates/soroban-test/src/lib.rs @@ -104,13 +104,8 @@ impl TestEnv { } pub fn with_rpc_url(rpc_url: &str) -> TestEnv { - let mut env = TestEnv { - network: network::Network { - rpc_url: rpc_url.to_string(), - ..Default::default() - }, - ..Default::default() - }; + let mut env: TestEnv = Default::default(); + env.network.rpc_url = rpc_url.to_string(); if let Ok(network_passphrase) = std::env::var("STELLAR_NETWORK_PASSPHRASE") { env.network.network_passphrase = network_passphrase; }; @@ -119,14 +114,9 @@ impl TestEnv { } pub fn with_rpc_provider(rpc_url: &str, rpc_headers: Vec<(String, String)>) -> TestEnv { - let mut env = TestEnv { - network: network::Network { - rpc_url: rpc_url.to_string(), - rpc_headers, - ..Default::default() - }, - ..Default::default() - }; + let mut env: TestEnv = Default::default(); + env.network.rpc_url = rpc_url.to_string(); + env.network.rpc_headers = rpc_headers; if let Ok(network_passphrase) = std::env::var("STELLAR_NETWORK_PASSPHRASE") { env.network.network_passphrase = network_passphrase; }; diff --git a/cmd/soroban-cli/src/config/network.rs b/cmd/soroban-cli/src/config/network.rs index f4838d44c..e64a0ee77 100644 --- a/cmd/soroban-cli/src/config/network.rs +++ b/cmd/soroban-cli/src/config/network.rs @@ -231,17 +231,6 @@ impl Network { } } -impl Default for Network { - fn default() -> Self { - let testnet_default = DEFAULTS["testnet"]; - Network { - rpc_url: testnet_default.0.to_string(), - rpc_headers: Vec::new(), - network_passphrase: testnet_default.1.to_string(), - } - } -} - pub static DEFAULTS: phf::Map<&'static str, (&'static str, &'static str)> = phf_map! { "local" => ( "http://localhost:8000/rpc",