From c36a3da6f073b07afa2d618786a61b13507a1ee2 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 6 Jan 2022 12:00:29 +0100 Subject: [PATCH] Add EcdsaSig::sighash_all convenience constructor --- src/util/ecdsa.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/ecdsa.rs b/src/util/ecdsa.rs index 9cd4bb2c..5456cc03 100644 --- a/src/util/ecdsa.rs +++ b/src/util/ecdsa.rs @@ -425,6 +425,13 @@ pub struct EcdsaSig { } impl EcdsaSig { + /// Constructs ECDSA bitcoin signature for [`EcdsaSigHashType::All`] + pub fn sighash_all(sig: secp256k1::Signature) -> EcdsaSig { + EcdsaSig { + sig, + hash_ty: EcdsaSigHashType::All + } + } /// Deserialize from slice pub fn from_slice(sl: &[u8]) -> Result {