From b3cc3417b0ac985474541730ea23ff81ebe77ca8 Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Thu, 15 Feb 2024 13:18:16 +0100 Subject: [PATCH] Document LocalKeystore insert method --- 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 ca4a87ef383e..b3c32085b82b 100644 --- a/substrate/client/keystore/src/local.rs +++ b/substrate/client/keystore/src/local.rs @@ -136,6 +136,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,