Additional comments
This commit is contained in:
@@ -4,7 +4,7 @@ use clap::ArgMatches;
|
||||
pub mod init;
|
||||
pub mod run;
|
||||
|
||||
pub(crate) fn overwrite_config(mut config: Config, matches: &ArgMatches) -> Config {
|
||||
pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
|
||||
if let Some(directory) = matches.value_of("directory") {
|
||||
config = config.with_custom_directory(directory);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::client::NymClient;
|
||||
use crate::commands::overwrite_config;
|
||||
use crate::commands::override_config;
|
||||
use crate::config::persistance::pathfinder::ClientPathfinder;
|
||||
use crate::config::Config;
|
||||
use clap::ArgMatches;
|
||||
@@ -13,7 +13,7 @@ pub fn execute(matches: &ArgMatches) {
|
||||
Config::load_from_file(matches.value_of("config").map(|path| path.into()), Some(id))
|
||||
.expect("Failed to load config file");
|
||||
|
||||
config = overwrite_config(config, matches);
|
||||
config = override_config(config, matches);
|
||||
|
||||
let identity_keypair = PemStore::new(ClientPathfinder::new_from_config(&config))
|
||||
.read_identity()
|
||||
@@ -25,6 +25,5 @@ pub fn execute(matches: &ArgMatches) {
|
||||
);
|
||||
|
||||
let client = NymClient::new(config);
|
||||
//
|
||||
// client.start().unwrap();
|
||||
client.start().unwrap();
|
||||
}
|
||||
|
||||
@@ -351,6 +351,8 @@ mod client_config {
|
||||
|
||||
#[test]
|
||||
fn after_saving_default_config_the_loaded_one_is_identical() {
|
||||
// need to figure out how to do something similar but without touching the disk
|
||||
// or the file system at all...
|
||||
let temp_location = tempfile::tempdir().unwrap().path().join("config.toml");
|
||||
let default_config = Config::default().with_id("foomp".to_string());
|
||||
default_config
|
||||
|
||||
Reference in New Issue
Block a user