Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

minor fix and improvements on localkeystore #7626

Merged
4 commits merged into from
Dec 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update docs
  • Loading branch information
gnunicorn committed Dec 1, 2020
commit 2c74197891db0bea161b278ae8d2e17692d98789
5 changes: 3 additions & 2 deletions client/keystore/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl KeystoreInner {

/// Insert a new key with anonymous crypto.
///
/// Places it into the file system store.
/// Places it into the file system store, if a path is configured.
fn insert_unknown(&self, key_type: KeyTypeId, suri: &str, public: &[u8]) -> Result<()> {
if let Some(path) = self.key_file_path(public, key_type) {
let mut file = File::create(path).map_err(Error::Io)?;
Expand All @@ -385,7 +385,8 @@ impl KeystoreInner {

/// Generate a new key.
///
/// Places it into the file system store.
/// Places it into the file system store, if a path is configured. Otherwise insert
/// it into the memory cache only.
fn generate_by_type<Pair: PairT>(&mut self, key_type: KeyTypeId) -> Result<Pair> {
let (pair, phrase, _) = Pair::generate_with_phrase(self.password());
if let Some(path) = self.key_file_path(pair.public().as_slice(), key_type) {
Expand Down