Use `into` for hash argument

Hash types can be converted into a `Message` because `Message`
implements `From` for any type that implements `ThirtyTwoByteHash`,
which hash types do.

Use `into` to convert the hash argument to a message to sign.
This commit is contained in:
Tobin C. Harding 2023-02-04 14:23:51 +11:00
parent 5a867821aa
commit 324b6f264b
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 1 deletions

View File

@ -745,7 +745,7 @@ fn sign_psbt_taproot(
Some(_) => keypair, // no tweak for script spend
};
let sig = secp.sign_schnorr(&Message::from_slice(&hash.into_inner()[..]).unwrap(), &keypair);
let sig = secp.sign_schnorr(&hash.into(), &keypair);
let final_signature = taproot::Signature { sig, hash_ty };