From 9f49746b445a4844c439cb1aa9ce1ec7dd61f264 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Wed, 5 Feb 2020 16:27:31 +0000 Subject: [PATCH] Actually using proper config --- validator/src/commands/run.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/validator/src/commands/run.rs b/validator/src/commands/run.rs index bca11b7eef..3b50bbd1cc 100644 --- a/validator/src/commands/run.rs +++ b/validator/src/commands/run.rs @@ -1,6 +1,5 @@ use crate::commands::override_config; use crate::config::Config; -use crate::validator; use crate::validator::Validator; use clap::{App, Arg, ArgMatches}; use config::NymConfig; @@ -30,17 +29,10 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { ) } -fn parse_old_config(matches: &ArgMatches) -> validator::Config { - let config_file_path = matches.value_of("config").unwrap(); - // since this is happening at the very startup, it's fine to panic if file doesn't exist - let config_content = std::fs::read_to_string(config_file_path).unwrap(); - toml::from_str(&config_content).unwrap() -} - pub fn execute(matches: &ArgMatches) { let id = matches.value_of("id").unwrap(); - println!("Starting sfw-provider {}...", id); + println!("Starting validator {}...", id); let mut config = Config::load_from_file(matches.value_of("config").map(|path| path.into()), Some(id)) @@ -48,8 +40,6 @@ pub fn execute(matches: &ArgMatches) { config = override_config(config, matches); - let old_config = parse_old_config(matches); - - let validator = Validator::new(old_config); + let validator = Validator::new(config); validator.start() }