From 60b84c57de7c1763f65ed471180da0fbafcbdbf4 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Thu, 13 Nov 2025 18:21:46 +0100 Subject: [PATCH] chore(apps/quorum): add recovered addr on sig error --- Cargo.lock | 2 +- apps/quorum/Cargo.toml | 2 +- apps/quorum/src/api.rs | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67d36e3c06..4adc2e0d41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6008,7 +6008,7 @@ dependencies = [ [[package]] name = "quorum" -version = "0.2.2" +version = "0.2.3" dependencies = [ "anyhow", "axum 0.8.4", diff --git a/apps/quorum/Cargo.toml b/apps/quorum/Cargo.toml index 317465d329..aa1ba189fc 100644 --- a/apps/quorum/Cargo.toml +++ b/apps/quorum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quorum" -version = "0.2.2" +version = "0.2.3" edition = "2021" [dependencies] diff --git a/apps/quorum/src/api.rs b/apps/quorum/src/api.rs index 50448bc980..bd433a9662 100644 --- a/apps/quorum/src/api.rs +++ b/apps/quorum/src/api.rs @@ -110,7 +110,8 @@ fn verify_observation( .iter() .position(|addr| *addr == GuardianAddress(address)) .ok_or(anyhow::anyhow!( - "Signature does not match any guardian address" + "Signature does not match any guardian address, recovered address: {:}", + hex::encode(address) )) } @@ -365,16 +366,19 @@ mod test { #[test] fn test_verify_observation_invalid_signature() { let (guardian_set, _) = get_guardian_sets(10); - let random_key = get_new_keypair().0; + let (key, address) = get_new_keypair(); let body = get_sample_body(-(OBSERVERATION_LIFETIME as i64 - 1)); let observation = Observation { - signature: sign(&body, &random_key), + signature: sign(&body, &key), body: serde_wormhole::to_vec(&body).unwrap(), }; let result = verify_observation(&observation, guardian_set.clone(), OBSERVERATION_LIFETIME); assert_eq!( result.unwrap_err().to_string(), - "Signature does not match any guardian address" + format!( + "Signature does not match any guardian address, recovered address: {}", + hex::encode(address) + ) ); }