From 728f5e237a20dbcea391e996dd96d5eceb9304ed Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Thu, 30 Jan 2020 14:55:10 +0000 Subject: [PATCH] Ability to create client pathfinder from the config --- nym-client/src/config/persistance/pathfinder.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nym-client/src/config/persistance/pathfinder.rs b/nym-client/src/config/persistance/pathfinder.rs index c71aab5b84..670e71038e 100644 --- a/nym-client/src/config/persistance/pathfinder.rs +++ b/nym-client/src/config/persistance/pathfinder.rs @@ -1,3 +1,5 @@ +use crate::config::Config; +use config::NymConfig; use pemstore::pathfinder::PathFinder; use std::path::PathBuf; @@ -19,6 +21,14 @@ impl ClientPathfinder { public_mix_key, } } + + pub fn new_from_config(config: &Config) -> Self { + ClientPathfinder { + config_dir: config.get_config_file_save_location(), + private_mix_key: config.get_private_identity_key_file(), + public_mix_key: config.get_public_identity_key_file(), + } + } } impl PathFinder for ClientPathfinder {