From 382c8f9e4f91bb06b41938c7d9d1acaa02d9f398 Mon Sep 17 00:00:00 2001 From: sanket1729 Date: Fri, 14 Jan 2022 04:06:12 +0530 Subject: [PATCH] Introduce PsbtSigHashType --- src/util/psbt/map/input.rs | 54 +++++++++++++++++++++++++++++++++++--- src/util/psbt/map/mod.rs | 2 +- src/util/psbt/mod.rs | 7 ++--- src/util/psbt/serialize.rs | 17 ++++-------- src/util/sighash.rs | 4 +-- 5 files changed, 63 insertions(+), 21 deletions(-) diff --git a/src/util/psbt/map/input.rs b/src/util/psbt/map/input.rs index 970e7849..bc6772b7 100644 --- a/src/util/psbt/map/input.rs +++ b/src/util/psbt/map/input.rs @@ -19,7 +19,7 @@ use ::{EcdsaSig, io}; use secp256k1; use blockdata::script::Script; use blockdata::witness::Witness; -use blockdata::transaction::{EcdsaSigHashType, Transaction, TxOut}; +use blockdata::transaction::{Transaction, TxOut, NonStandardSigHashType}; use consensus::encode; use hashes::{self, hash160, ripemd160, sha256, sha256d}; use secp256k1::XOnlyPublicKey; @@ -32,6 +32,8 @@ use util::psbt::{Error, error}; use ::{SchnorrSig}; use util::taproot::{ControlBlock, LeafVersion, TapLeafHash, TapBranchHash}; +use util::sighash; +use {EcdsaSigHashType, SchnorrSigHashType}; /// Type: Non-Witness UTXO PSBT_IN_NON_WITNESS_UTXO = 0x00 const PSBT_IN_NON_WITNESS_UTXO: u8 = 0x00; @@ -92,7 +94,7 @@ pub struct Input { pub partial_sigs: BTreeMap, /// The sighash type to be used for this input. Signatures for this input /// must use the sighash type. - pub sighash_type: Option, + pub sighash_type: Option, /// The redeem script for this input. pub redeem_script: Option