mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 16:37:57 +00:00
Make keystore return None when a key doesn't exist (#8163)
* Make keystore return `None` when a key doesn't exist * Fixes * More fixes * Update comment * Update primitives/keystore/src/lib.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Update client/keystore/src/local.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Address comments * Update client/keystore/src/local.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -474,8 +474,9 @@ pub trait Crypto {
|
||||
let keystore = &***self.extension::<KeystoreExt>()
|
||||
.expect("No `keystore` associated for the current context!");
|
||||
SyncCryptoStore::sign_with(keystore, id, &pub_key.into(), msg)
|
||||
.map(|sig| ed25519::Signature::from_slice(sig.as_slice()))
|
||||
.ok()
|
||||
.flatten()
|
||||
.map(|sig| ed25519::Signature::from_slice(sig.as_slice()))
|
||||
}
|
||||
|
||||
/// Verify `ed25519` signature.
|
||||
@@ -600,8 +601,9 @@ pub trait Crypto {
|
||||
let keystore = &***self.extension::<KeystoreExt>()
|
||||
.expect("No `keystore` associated for the current context!");
|
||||
SyncCryptoStore::sign_with(keystore, id, &pub_key.into(), msg)
|
||||
.map(|sig| sr25519::Signature::from_slice(sig.as_slice()))
|
||||
.ok()
|
||||
.flatten()
|
||||
.map(|sig| sr25519::Signature::from_slice(sig.as_slice()))
|
||||
}
|
||||
|
||||
/// Verify an `sr25519` signature.
|
||||
@@ -646,8 +648,9 @@ pub trait Crypto {
|
||||
let keystore = &***self.extension::<KeystoreExt>()
|
||||
.expect("No `keystore` associated for the current context!");
|
||||
SyncCryptoStore::sign_with(keystore, id, &pub_key.into(), msg)
|
||||
.map(|sig| ecdsa::Signature::from_slice(sig.as_slice()))
|
||||
.ok()
|
||||
.flatten()
|
||||
.map(|sig| ecdsa::Signature::from_slice(sig.as_slice()))
|
||||
}
|
||||
|
||||
/// Verify `ecdsa` signature.
|
||||
|
||||
Reference in New Issue
Block a user