Skip to content

Commit

Permalink
chore: propagate signer pubkey recovery errors in newblock processing
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed Oct 24, 2024
1 parent 15d4744 commit c3a8b75
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/chainhook-sdk/src/indexer/stacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,12 @@ pub fn standardize_stacks_block(
(Some(signer_sig_hash), Some(signatures)) => {
Some(signatures.iter().map(|sig_hex| {
let sig_msg = clarity::util::secp256k1::MessageSignature::from_hex(sig_hex)
.expect("unable to parse signer signature message");
.map_err(|e| format!("unable to parse signer signature message: {}", e))?;
let pubkey = get_signer_pubkey_from_message_hash(&signer_sig_hash, &sig_msg)
.expect("unable to recover signer sig pubkey");
format!("0x{}", hex::encode(pubkey))
}).collect())
.map_err(|e| format!("unable to recover signer sig pubkey: {}", e))?;
Ok(format!("0x{}", hex::encode(pubkey)))
})
.collect::<Result<Vec<_>, String>>()?)
}
_ => None,
},
Expand Down

0 comments on commit c3a8b75

Please sign in to comment.