From 324b6f264b3b0757a3812a6db571b40c55696168 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Sat, 4 Feb 2023 14:23:51 +1100 Subject: [PATCH] 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. --- bitcoin/examples/taproot-psbt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/examples/taproot-psbt.rs b/bitcoin/examples/taproot-psbt.rs index 55d6dd34..702be5e8 100644 --- a/bitcoin/examples/taproot-psbt.rs +++ b/bitcoin/examples/taproot-psbt.rs @@ -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 };