Skip to content

Commit

Permalink
fix: Return a signed txhandler in create_payout_txhandler and remove …
Browse files Browse the repository at this point in the history
…anchor output.
  • Loading branch information
ceyhunsen committed Feb 8, 2025
1 parent b24856d commit ccdf5f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/src/builder/transaction/operator_reimburse.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::input::SpendableTxIn;
use super::txhandler::DEFAULT_SEQUENCE;
use super::Signed;
use crate::builder::script::{CheckSig, SpendableScript, TimelockScript, WithdrawalScript};
use crate::builder::transaction::output::UnspentTxOut;
use crate::builder::transaction::txhandler::{TxHandler, TxHandlerBuilder};
Expand Down Expand Up @@ -213,7 +214,7 @@ pub fn create_payout_txhandler(
operator_idx: usize,
user_sig: Signature,
network: bitcoin::Network,
) -> Result<TxHandler, BridgeError> {
) -> Result<TxHandler<Signed>, BridgeError> {
let user_sig_wrapped = bitcoin::taproot::Signature {
signature: user_sig,
sighash_type: bitcoin::sighash::TapSighashType::SinglePlusAnyoneCanPay,
Expand All @@ -227,12 +228,9 @@ pub fn create_payout_txhandler(
vec![Arc::new(WithdrawalScript::new(operator_idx))];
let op_return_txout = UnspentTxOut::from_scripts(Amount::from_sat(0), scripts, None, network);

Ok(TxHandlerBuilder::new()
TxHandlerBuilder::new()
.add_input_with_witness(txin, DEFAULT_SEQUENCE, witness)
.add_output(output_txout)
.add_output(op_return_txout)
.add_output(UnspentTxOut::from_partial(
builder::transaction::anchor_output(),
))
.finalize())
.finalize_signed()
}

0 comments on commit ccdf5f0

Please sign in to comment.