mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +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:
@@ -46,9 +46,6 @@ pub enum Error {
|
||||
/// Public key type is not supported
|
||||
#[display(fmt="Key crypto type is not supported")]
|
||||
KeyNotSupported(KeyTypeId),
|
||||
/// Pair not found for public key and KeyTypeId
|
||||
#[display(fmt="Pair not found for {} public key", "_0")]
|
||||
PairNotFound(String),
|
||||
/// Keystore unavailable
|
||||
#[display(fmt="Keystore unavailable")]
|
||||
Unavailable,
|
||||
@@ -61,7 +58,6 @@ impl From<Error> for TraitError {
|
||||
fn from(error: Error) -> Self {
|
||||
match error {
|
||||
Error::KeyNotSupported(id) => TraitError::KeyNotSupported(id),
|
||||
Error::PairNotFound(e) => TraitError::PairNotFound(e),
|
||||
Error::InvalidSeed | Error::InvalidPhrase | Error::InvalidPassword => {
|
||||
TraitError::ValidationError(error.to_string())
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user