Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document LocalKeystore insert method #3336

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
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
7 changes: 7 additions & 0 deletions substrate/client/keystore/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ impl LocalKeystore {
}

impl Keystore for LocalKeystore {
/// Insert a new secret key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be put above the method declaration in the trait.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed it here as the comments references the keystore construction using a password) which is a concept not referenced anywhere in the Keystore trait. I thought that talking about passwords in the trait could be misleading.

///
/// WARNING: if the secret keypair has been manually generated using a password
/// (e.g. using methods such as [`sp_core::crypto::Pair::from_phrase`]) then such
/// a password must match the one used to open the keystore via [`LocalKeystore::open`].
/// If the passwords doesn't match then the inserted key ends up being unusable under
/// the current keystore instance.
fn insert(
&self,
key_type: KeyTypeId,
Expand Down
Loading