From e75e0eb5ee98a42220e390bab9f94f9ac7c49540 Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Fri, 16 Feb 2024 12:14:35 +0100 Subject: [PATCH] Document LocalKeystore insert method (#3336) Refer to https://github.com/paritytech/polkadot-sdk/issues/3320 discussion --- substrate/client/keystore/src/local.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/substrate/client/keystore/src/local.rs b/substrate/client/keystore/src/local.rs index 4a04a48518..8b922c11cb 100644 --- a/substrate/client/keystore/src/local.rs +++ b/substrate/client/keystore/src/local.rs @@ -143,6 +143,13 @@ impl LocalKeystore { } impl Keystore for LocalKeystore { + /// Insert a new secret key. + /// + /// 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,