diff --git a/parity/configuration.rs b/parity/configuration.rs index 6185d2cf7..30d77c35d 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -285,8 +285,10 @@ impl Configuration { cors.map_or_else(Vec::new, |c| c.split(',').map(|s| s.to_owned()).collect()) } - fn geth_ipc_path() -> String { - path::ethereum::with_default("geth.ipc").to_str().unwrap().to_owned() + fn geth_ipc_path(&self) -> String { + if self.args.flag_testnet { path::ethereum::with_testnet("geth.ipc") } + else { path::ethereum::with_default("geth.ipc") } + .to_str().unwrap().to_owned() } pub fn keys_iterations(&self) -> u32 { @@ -350,7 +352,7 @@ impl Configuration { } fn ipc_path(&self) -> String { - if self.args.flag_geth { Self::geth_ipc_path() } + if self.args.flag_geth { self.geth_ipc_path() } else { Configuration::replace_home(&self.args.flag_ipcpath.clone().unwrap_or(self.args.flag_ipc_path.clone())) } } } diff --git a/util/src/path.rs b/util/src/path.rs index 3a8dcaaae..899650149 100644 --- a/util/src/path.rs +++ b/util/src/path.rs @@ -53,4 +53,12 @@ pub mod ethereum { pth.push(s); pth } + + /// Get the specific folder inside default ethereum installation configured for testnet + pub fn with_testnet(s: &str) -> PathBuf { + let mut pth = default(); + pth.push("testnet"); + pth.push(s); + pth + } }