Skip to main content
Sign in
Snippets Groups Projects
Commit c41c0e62 authored by dvermd's avatar dvermd
Browse files

[ref] conf: move load_keypairs out of load_conf

parent ef334c23
Branches
No related tags found
1 merge request!275Resolve "Change keypairs file to encrypted format (DEWIF)"
......@@ -285,12 +285,7 @@ pub fn get_profile_path(profiles_path: &Option<PathBuf>, profile_name: &str) ->
}
/// Load configuration.
pub fn load_conf(
profile_path: PathBuf,
keypairs_file_path: &Option<PathBuf>,
) -> Result<(DuRsConf, DuniterKeyPairs), DursConfError> {
let keypairs = crate::keypairs::load_keypairs_from_file(&profile_path, keypairs_file_path)?;
pub fn load_conf(profile_path: PathBuf) -> Result<DuRsConf, DursConfError> {
// Load conf from file
let conf_from_file =
crate::file::load_conf_from_file(profile_path).map_err(DursConfError::FileErr)?;
......@@ -302,7 +297,7 @@ pub fn load_conf(
// Override global conf with env global user conf
let conf = conf_from_file.override_global_conf(env_global_user_conf);
Ok((conf, keypairs))
Ok(conf)
}
/// Write new module conf
......
......
......@@ -239,9 +239,14 @@ impl DursCore<DuRsConf> {
)?;
// Load global conf
let (conf, keypairs) =
durs_conf::load_conf(profile_path.clone(), &durs_core_opts.keypairs_file)
let conf =
durs_conf::load_conf(profile_path.clone()).map_err(DursCoreError::LoadConfError)?;
let keypairs = durs_conf::keypairs::load_keypairs_from_file(
&profile_path,
&durs_core_opts.keypairs_file,
)
.map_err(DursCoreError::LoadConfError)?;
info!("Success to load global conf.");
// Get currency name
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment