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 authored and GitHub committed 2023-03-20 18:21:26 +00:00
1 parent faaa0c2851
commit 480396fe06
44 files changed
+312 -457

No files matched your search

+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))
}
}