Skip to content

Commit

Permalink
Make serialization error context more specific.
Browse files Browse the repository at this point in the history
Now it is possible to differentiate serialization and
deserialization error.
  • Loading branch information
koxu1996 committed Mar 5, 2024
1 parent 1eb91d4 commit 2a37718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kairos-cli/src/crypto/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl CasperPublicKey {
let (public_key, _remainder) =
casper_types::PublicKey::from_bytes(bytes).map_err(|_e| {
CryptoError::Serialization {
context: "public key",
context: "public key serialization",
}
})?;
Ok(Self(public_key))
Expand All @@ -18,7 +18,7 @@ impl CasperPublicKey {
#[allow(unused)]
fn to_bytes(&self) -> Result<Vec<u8>, CryptoError> {
self.0.to_bytes().map_err(|_e| CryptoError::Serialization {
context: "public key",
context: "public key deserialization",
})
}
}
Expand Down

0 comments on commit 2a37718

Please sign in to comment.