Merge rust-bitcoin/rust-bitcoin#3472: test: add test for new sign fn

88a35c8918 test: add test for new sign fn (Chris Hyunhum Cho)

Pull request description:

  Follow up https://github.com/rust-bitcoin/rust-bitcoin/pull/3456.
  add test to verify the signature generated from newly added `sign` fn.

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

Tree-SHA512: 8c457fbabf1ff86a9369934564874e78660f706714465731c185da16eff5c88a5e680c4373effbcc273394a5653edde9f559558917fee6e438b79bfee6f63b22
This commit is contained in:
merge-script 2024-10-17 02:09:09 +00:00
commit 0f20669b40
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 0 deletions

View File

@ -257,6 +257,7 @@ mod tests {
let secp_sig = secp.sign_ecdsa_recoverable(&msg, &privkey); let secp_sig = secp.sign_ecdsa_recoverable(&msg, &privkey);
let signature = super::MessageSignature { signature: secp_sig, compressed: true }; 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()); assert_eq!(signature.to_base64(), signature.to_string());
let signature2 = &signature.to_string().parse::<super::MessageSignature>().unwrap(); let signature2 = &signature.to_string().parse::<super::MessageSignature>().unwrap();
let pubkey = signature2 let pubkey = signature2