Skip to content

Commit

Permalink
fix: Make some txhandler functions available for both signed and unsi…
Browse files Browse the repository at this point in the history
…gned variants.
  • Loading branch information
ceyhunsen committed Feb 8, 2025
1 parent df5a4be commit b24856d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/builder/transaction/txhandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ impl<T: State> TxHandler<T> {
let txin = self.txins.get(idx).ok_or(BridgeError::TxInputNotFound)?;
Ok(txin.get_signature_id())
}
}

impl TxHandler<Unsigned> {
pub fn get_cached_tx(&self) -> &Transaction {
&self.cached_tx
}
Expand Down Expand Up @@ -150,7 +148,9 @@ impl TxHandler<Unsigned> {

Ok(sig_hash)
}
}

impl TxHandler<Unsigned> {
pub fn promote(self) -> Result<TxHandler<Signed>, BridgeError> {
if self.txins.iter().any(|s| s.get_witness().is_none()) {
return Err(BridgeError::MissingWitnessData);
Expand All @@ -164,9 +164,7 @@ impl TxHandler<Unsigned> {
phantom: PhantomData::<Signed>,
})
}
}

impl TxHandler<Unsigned> {
/// Constructs the witness for a script path spend of a transaction input.
///
/// # Arguments
Expand Down

0 comments on commit b24856d

Please sign in to comment.