Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

IPC path for tesetnet with --geth compatibility #1231

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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())) }
}
}
Expand Down
8 changes: 8 additions & 0 deletions util/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}