mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +00:00
Keystore overhaul (iter 2) (#13634)
* Remove bloat about remote keystore * Update docs and remove unused 'KeystoreRef' trait * Use wherever possible, MemoryKeystore for testing * Remove unrequired fully qualified method syntax for Keystore
This commit is contained in:
@@ -243,17 +243,14 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sc_network_test::Block;
|
||||
use sp_keystore::{Keystore, KeystorePtr};
|
||||
|
||||
use super::*;
|
||||
use crate::keystore::BeefyKeystore;
|
||||
use sc_network_test::Block;
|
||||
use sp_consensus_beefy::{
|
||||
crypto::Signature, known_payloads, Commitment, Keyring, MmrRootHash, Payload, VoteMessage,
|
||||
KEY_TYPE,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
use sp_keystore::{testing::MemoryKeystore, Keystore};
|
||||
|
||||
#[test]
|
||||
fn known_votes_insert_remove() {
|
||||
@@ -306,10 +303,9 @@ mod tests {
|
||||
}
|
||||
|
||||
fn sign_commitment<BN: Encode>(who: &Keyring, commitment: &Commitment<BN>) -> Signature {
|
||||
let store: KeystorePtr = std::sync::Arc::new(LocalKeystore::in_memory());
|
||||
Keystore::ecdsa_generate_new(&*store, KEY_TYPE, Some(&who.to_seed())).unwrap();
|
||||
let beefy_keystore: BeefyKeystore = Some(store).into();
|
||||
|
||||
let store = MemoryKeystore::new();
|
||||
store.ecdsa_generate_new(KEY_TYPE, Some(&who.to_seed())).unwrap();
|
||||
let beefy_keystore: BeefyKeystore = Some(store.into()).into();
|
||||
beefy_keystore.sign(&who.public(), &commitment.encode()).unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user