mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 23:41:02 +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:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user