Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed directory arguments to validator #408

Merged
merged 1 commit into from
Nov 2, 2020
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
10 changes: 5 additions & 5 deletions clients/native/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Id of the gateway we are going to connect to.")
.takes_value(true)
)
.arg(Arg::with_name("directory")
.long("directory")
.help("Address of the directory server the client is getting topology from")
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
)
.arg(Arg::with_name("disable-socket")
Expand Down Expand Up @@ -101,8 +101,8 @@ async fn register_with_gateway(
.expect("failed to register with the gateway!")
}

async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::Node {
let validator_client_config = validator_client::Config::new(directory_server.to_string());
async fn gateway_details(validator_server: &str, gateway_id: &str) -> gateway::Node {
let validator_client_config = validator_client::Config::new(validator_server.to_string());
let validator_client = validator_client::Client::new(validator_client_config);
let topology = validator_client.get_active_topology().await.unwrap();
let nym_topology: NymTopology = topology.into();
Expand Down
4 changes: 2 additions & 2 deletions clients/native/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub(crate) mod run;
pub(crate) mod upgrade;

pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
if let Some(directory) = matches.value_of("directory") {
config.get_base_mut().with_custom_validator(directory);
if let Some(validator) = matches.value_of("validator") {
config.get_base_mut().with_custom_validator(validator);
}

if let Some(gateway_id) = matches.value_of("gateway") {
Expand Down
6 changes: 3 additions & 3 deletions clients/native/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.required(true)
)
// the rest of arguments are optional, they are used to override settings in config file
.arg(Arg::with_name("directory")
.long("directory")
.help("Address of the directory server the client is getting topology from")
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
)
.arg(Arg::with_name("gateway")
Expand Down
10 changes: 5 additions & 5 deletions clients/socks5/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Id of the gateway we are going to connect to.")
.takes_value(true)
)
.arg(Arg::with_name("directory")
.long("directory")
.help("Address of the directory server the client is getting topology from")
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
)
.arg(Arg::with_name("port")
Expand Down Expand Up @@ -102,8 +102,8 @@ async fn register_with_gateway(
.expect("failed to register with the gateway!")
}

async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::Node {
let validator_client_config = validator_client::Config::new(directory_server.to_string());
async fn gateway_details(validator_server: &str, gateway_id: &str) -> gateway::Node {
let validator_client_config = validator_client::Config::new(validator_server.to_string());
let validator_client = validator_client::Client::new(validator_client_config);
let topology = validator_client.get_active_topology().await.unwrap();
let nym_topology: NymTopology = topology.into();
Expand Down
4 changes: 2 additions & 2 deletions clients/socks5/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub(crate) mod run;
pub(crate) mod upgrade;

pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
if let Some(directory) = matches.value_of("directory") {
config.get_base_mut().with_custom_validator(directory);
if let Some(validator) = matches.value_of("validator") {
config.get_base_mut().with_custom_validator(validator);
}

if let Some(gateway_id) = matches.value_of("gateway") {
Expand Down
6 changes: 3 additions & 3 deletions clients/socks5/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Address of the socks5 provider to send messages to.")
.takes_value(true)
)
.arg(Arg::with_name("directory")
.long("directory")
.help("Address of the directory server the client is getting topology from")
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
)
.arg(Arg::with_name("gateway")
Expand Down