From cc2e330dcc101e1ac293c38f1fcdfb6efbd63b71 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 31 Oct 2024 10:53:00 +0100 Subject: [PATCH] fix(cli): more descriptive error --- bolt-cli/src/common/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bolt-cli/src/common/mod.rs b/bolt-cli/src/common/mod.rs index b152a4614..d730df81b 100644 --- a/bolt-cli/src/common/mod.rs +++ b/bolt-cli/src/common/mod.rs @@ -19,8 +19,10 @@ pub mod signing; /// Parse a BLS public key from a string pub fn parse_bls_public_key(delegatee_pubkey: &str) -> Result { let hex_pk = delegatee_pubkey.strip_prefix("0x").unwrap_or(delegatee_pubkey); - BlsPublicKey::try_from(hex::decode(hex_pk).wrap_err("Failed to hex-decode pubkey")?.as_slice()) - .map_err(|e| eyre::eyre!("Failed to parse public key '{}': {}", hex_pk, e)) + BlsPublicKey::try_from( + hex::decode(hex_pk).wrap_err("Failed to hex-decode delegatee pubkey")?.as_slice(), + ) + .map_err(|e| eyre::eyre!("Failed to parse delegatee public key '{}': {}", hex_pk, e)) } /// Write some serializable data to an output json file