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:
Davide Galassi
2023-03-20 19:21:26 +01:00
committed by GitHub
parent faaa0c2851
commit 480396fe06
44 changed files with 312 additions and 457 deletions
@@ -38,10 +38,10 @@ use sp_core::{
traits::CallContext,
};
use sp_externalities::Extensions;
use sp_keystore::{testing::MemoryKeystore, KeystoreExt, KeystorePtr};
use sp_keystore::{testing::MemoryKeystore, KeystoreExt};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use sp_state_machine::StateMachine;
use std::{collections::HashMap, fmt::Debug, fs, str::FromStr, sync::Arc, time};
use std::{collections::HashMap, fmt::Debug, fs, str::FromStr, time};
/// Logging target
const LOG_TARGET: &'static str = "frame::benchmark::pallet";
@@ -218,9 +218,10 @@ impl PalletCmd {
let extensions = || -> Extensions {
let mut extensions = Extensions::default();
extensions.register(KeystoreExt(Arc::new(MemoryKeystore::new()) as KeystorePtr));
let (offchain, _) = TestOffchainExt::new();
let (pool, _) = TestTransactionPoolExt::new();
let keystore = MemoryKeystore::new();
extensions.register(KeystoreExt::new(keystore));
extensions.register(OffchainWorkerExt::new(offchain.clone()));
extensions.register(OffchainDbExt::new(offchain));
extensions.register(TransactionPoolExt::new(pool));