Keystore overhaul (#13615)

* Remove 'supported_keys' 'sign_with_any' and 'sign_with_all' from keystore trait

* Remove the aync keystore

* Renaming:
- SyncCryptoStore -> Keystore
- SyncCryptoStorePtr -> KeystorePtr
- KeyStore -> MemoryKeystore

* Fix authority discovery worker and tests

* Rename 'insert_unknown' to 'insert'

* Remove leftover
This commit is contained in:
Davide Galassi
2023-03-17 12:24:14 +01:00
committed by GitHub
parent 91bb2d29ca
commit f110941b7f
49 changed files with 317 additions and 820 deletions
@@ -28,7 +28,7 @@ use serde::Serialize;
use codec::{Codec, Decode, Encode, Input};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
use sp_keystore::{Keystore, KeystorePtr};
use sp_runtime::{
traits::{Header as HeaderT, NumberFor},
ConsensusEngineId, RuntimeDebug,
@@ -444,7 +444,7 @@ where
/// Localizes the message to the given set and round and signs the payload.
#[cfg(feature = "std")]
pub fn sign_message<H, N>(
keystore: SyncCryptoStorePtr,
keystore: KeystorePtr,
message: grandpa::Message<H, N>,
public: AuthorityId,
round: RoundNumber,
@@ -458,7 +458,7 @@ where
use sp_core::crypto::Public;
let encoded = localized_payload(round, set_id, &message);
let signature = SyncCryptoStore::sign_with(
let signature = Keystore::sign_with(
&*keystore,
AuthorityId::ID,
&public.to_public_crypto_pair(),