From 2a3771802399a457f53bd5851a5b39edccdd9a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Bro=C5=84ski?= Date: Tue, 5 Mar 2024 15:19:25 +0100 Subject: [PATCH] Make serialization error context more specific. Now it is possible to differentiate serialization and deserialization error. --- kairos-cli/src/crypto/public_key.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kairos-cli/src/crypto/public_key.rs b/kairos-cli/src/crypto/public_key.rs index fa85808f..9bf0d571 100644 --- a/kairos-cli/src/crypto/public_key.rs +++ b/kairos-cli/src/crypto/public_key.rs @@ -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)) @@ -18,7 +18,7 @@ impl CasperPublicKey { #[allow(unused)] fn to_bytes(&self) -> Result, CryptoError> { self.0.to_bytes().map_err(|_e| CryptoError::Serialization { - context: "public key", + context: "public key deserialization", }) } }