Skip to content

Commit

Permalink
Merge rust-bitcoin#3472: test: add test for new sign fn
Browse files Browse the repository at this point in the history
88a35c8 test: add test for new sign fn (Chris Hyunhum Cho)

Pull request description:

  Follow up rust-bitcoin#3456.
  add test to verify the signature generated from newly added `sign` fn.

ACKs for top commit:
  apoelstra:
    ACK 88a35c8; successfully ran local tests; sorry, testing local CI changes..
  tcharding:
    ACK 88a35c8

Tree-SHA512: 8c457fbabf1ff86a9369934564874e78660f706714465731c185da16eff5c88a5e680c4373effbcc273394a5653edde9f559558917fee6e438b79bfee6f63b22
  • Loading branch information
apoelstra committed Oct 17, 2024
2 parents 140602f + 88a35c8 commit 0f20669
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bitcoin/src/sign_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ mod tests {
let secp_sig = secp.sign_ecdsa_recoverable(&msg, &privkey);
let signature = super::MessageSignature { signature: secp_sig, compressed: true };

assert_eq!(signature.to_string(), super::sign(&secp, message, privkey).to_string());
assert_eq!(signature.to_base64(), signature.to_string());
let signature2 = &signature.to_string().parse::<super::MessageSignature>().unwrap();
let pubkey = signature2
Expand Down

0 comments on commit 0f20669

Please sign in to comment.