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
+8 -1
View File
@@ -150,10 +150,17 @@ pub trait Keystore: Send + Sync {
) -> Result<Option<ecdsa::Signature>, Error>;
}
/// A pointer to a keystore.
/// A shared pointer to a keystore implementation.
pub type KeystorePtr = Arc<dyn Keystore>;
sp_externalities::decl_extension! {
/// The keystore extension to register/retrieve from the externalities.
pub struct KeystoreExt(KeystorePtr);
}
impl KeystoreExt {
/// Create a new instance of `KeystoreExt`
pub fn new<T: Keystore + 'static>(keystore: T) -> Self {
Self(Arc::new(keystore))
}
}