Skip to content

Commit

Permalink
sc-keystore: Improve docs (paritytech#3334)
Browse files Browse the repository at this point in the history
Close: paritytech#3320

@Hugo-Trentesaux are these docs better for explaining the internals?
  • Loading branch information
bkchr committed Feb 15, 2024
1 parent f604860 commit 150a360
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions substrate/client/keystore/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ pub struct LocalKeystore(RwLock<KeystoreInner>);

impl LocalKeystore {
/// Create a local keystore from filesystem.
///
/// The keystore will be created at `path`. The keystore optionally supports to encrypt/decrypt
/// the keys in the keystore using `password`.
///
/// NOTE: Even when passing a `password`, the keys on disk appear to look like normal secret
/// uris. However, without having the correct password the secret uri will not generate the
/// correct private key. See [`SecretUri`](sp_core::crypto::SecretUri) for more information.
pub fn open<T: Into<PathBuf>>(path: T, password: Option<SecretString>) -> Result<Self> {
let inner = KeystoreInner::open(path, password)?;
Ok(Self(RwLock::new(inner)))
Expand Down
2 changes: 2 additions & 0 deletions substrate/primitives/core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ mod dummy {
/// Similarly an empty password (ending the `SURI` with `///`) is perfectly valid and will
/// generally be equivalent to no password at all.
///
/// The `password` is used as salt when generating the seed from the BIP-39 key phrase.
///
/// # Example
///
/// Parse [`DEV_PHRASE`] secret uri with junction:
Expand Down

0 comments on commit 150a360

Please sign in to comment.