Add EcdsaSig::sighash_all convenience constructor

This commit is contained in:
Dr Maxim Orlovsky 2022-01-06 12:00:29 +01:00
parent f332a1967e
commit c36a3da6f0
1 changed files with 7 additions and 0 deletions

View File

@ -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<Self, EcdsaSigError> {