Normalize keystore type and its usage across tests (#12553)

* Normalize keystore type and usage across tests

* Extract peer index from array index
This commit is contained in:
Davide Galassi
2022-10-24 19:55:25 +02:00
committed by GitHub
parent 3ae4be8662
commit 6201ccaf8f
6 changed files with 41 additions and 60 deletions
+2 -2
View File
@@ -29,12 +29,12 @@ use sc_consensus::{
BlockImport, BlockImportParams, BoxJustificationImport, ForkChoiceStrategy, ImportResult,
ImportedAux,
};
use sc_keystore::LocalKeystore;
use sc_network_test::{
Block, BlockImportAdapter, FullPeerConfig, PassThroughVerifier, Peer, PeersClient,
PeersFullClient, TestNetFactory,
};
use sc_utils::notification::NotificationReceiver;
use sp_keystore::testing::KeyStore as TestKeystore;
use beefy_primitives::{
crypto::{AuthorityId, Signature},
@@ -333,7 +333,7 @@ pub(crate) fn make_beefy_ids(keys: &[BeefyKeyring]) -> Vec<AuthorityId> {
}
pub(crate) fn create_beefy_keystore(authority: BeefyKeyring) -> SyncCryptoStorePtr {
let keystore = Arc::new(LocalKeystore::in_memory());
let keystore = Arc::new(TestKeystore::new());
SyncCryptoStore::ecdsa_generate_new(&*keystore, BeefyKeyType, Some(&authority.to_seed()))
.expect("Creates authority key");
keystore