native client config revamping
This commit is contained in:
@@ -96,11 +96,14 @@ pub(crate) fn execute(args: &Init) {
|
||||
eprintln!("Saved mixnet identity and sphinx keypairs");
|
||||
}
|
||||
|
||||
let config_save_location = default_config_filepath(id);
|
||||
let config_save_location = config.default_location();
|
||||
config
|
||||
.save_to_default_location()
|
||||
.expect("Failed to save the config file");
|
||||
eprintln!("Saved configuration file to {config_save_location:?}");
|
||||
eprintln!(
|
||||
"Saved configuration file to {}",
|
||||
config_save_location.display()
|
||||
);
|
||||
eprintln!("Mixnode configuration completed.\n\n\n");
|
||||
|
||||
MixNode::new(config).print_node_details(args.output)
|
||||
|
||||
@@ -105,8 +105,12 @@ impl Config {
|
||||
Self::read_from_toml_file(default_config_filepath(id))
|
||||
}
|
||||
|
||||
pub fn default_location(&self) -> PathBuf {
|
||||
default_config_filepath(&self.mixnode.id)
|
||||
}
|
||||
|
||||
pub fn save_to_default_location(&self) -> io::Result<()> {
|
||||
let config_save_location: PathBuf = default_config_filepath(&self.mixnode.id);
|
||||
let config_save_location: PathBuf = self.default_location();
|
||||
save_formatted_config_to_file(self, config_save_location)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user