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:
Bastian Köcher
2021-02-22 15:24:09 +01:00
committed by GitHub
parent ecf4404903
commit 4f4a0c5b38
12 changed files with 174 additions and 118 deletions
@@ -187,7 +187,7 @@ async fn build_dht_event(
serialized_addresses.as_slice(),
)
.await
.map_err(|_| Error::Signing)
.unwrap()
.unwrap();
let mut signed_addresses = vec![];
@@ -195,9 +195,7 @@ async fn build_dht_event(
addresses: serialized_addresses.clone(),
signature,
}
.encode(&mut signed_addresses)
.map_err(Error::EncodingProto)
.unwrap();
.encode(&mut signed_addresses).unwrap();
let key = hash_authority_id(&public_key.to_raw_vec());
let value = signed_addresses;