Skip to content

Commit

Permalink
add add_input_with_witness
Browse files Browse the repository at this point in the history
  • Loading branch information
atacann committed Feb 6, 2025
1 parent e941515 commit c626c92
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/src/builder/transaction/txhandler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::builder::script::SpendPath;
use crate::errors::BridgeError;
use crate::rpc::clementine::tagged_signature::SignatureId;
use crate::rpc::clementine::NormalSignatureKind;
use bitcoin::sighash::SighashCache;
use bitcoin::taproot::{self, LeafVersion};
use bitcoin::transaction::Version;
Expand Down Expand Up @@ -324,6 +325,23 @@ impl TxHandlerBuilder {
self
}

pub fn add_input_with_witness(
mut self,
spendable: SpendableTxIn,
sequence: Sequence,
witness: Witness,
) -> Self {
self.txins.push(SpentTxIn::from_spendable(
NormalSignatureKind::NormalSignatureUnknown.into(),
spendable,
SpendPath::Unknown,
sequence,
Some(witness),
));

self
}

pub fn add_output(mut self, output: UnspentTxOut) -> Self {
self.txouts.push(output);

Expand Down

0 comments on commit c626c92

Please sign in to comment.