passing key path to all invocations
This commit is contained in:
@@ -128,7 +128,7 @@ impl Default for AccountService {
|
||||
}
|
||||
|
||||
impl AccountService {
|
||||
/// New account service with the default location
|
||||
/// New account service with the keys store in default location
|
||||
pub fn new() -> Self {
|
||||
let secret_store = RwLock::new(SecretStore::new());
|
||||
secret_store.write().unwrap().try_import_existing();
|
||||
@@ -137,6 +137,15 @@ impl AccountService {
|
||||
}
|
||||
}
|
||||
|
||||
/// New account service with the keys store in specific location
|
||||
pub fn new_in(path: &Path) -> Self {
|
||||
let secret_store = RwLock::new(SecretStore::new_in(path));
|
||||
secret_store.write().unwrap().try_import_existing();
|
||||
AccountService {
|
||||
secret_store: secret_store
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn new_test(temp: &::devtools::RandomTempPath) -> Self {
|
||||
let secret_store = RwLock::new(SecretStore::new_test(temp));
|
||||
|
||||
Reference in New Issue
Block a user