Skip to content

Commit

Permalink
builder: Use version 3 as the transaction type.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Dec 18, 2024
1 parent 8820baf commit 032d463
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mod tests {
let mut tx_handler = create_invalid_mock_tx_handler(actor);

let prev_tx: Transaction = Transaction {
version: Version::TWO,
version: Version(3),
lock_time: bitcoin::absolute::LockTime::Blocks(Height::ZERO),
input: vec![],
output: tx_handler.prevouts.clone(),
Expand Down Expand Up @@ -390,7 +390,7 @@ mod tests {
}];

let tx = Transaction {
version: Version::TWO,
version: Version(3),
lock_time: bitcoin::absolute::LockTime::Blocks(Height::ZERO),
input: vec![],
output: vec![TxOut {
Expand Down
2 changes: 1 addition & 1 deletion core/src/builder/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ pub fn create_operator_takes_tx(

pub fn create_btc_tx(tx_ins: Vec<TxIn>, tx_outs: Vec<TxOut>) -> bitcoin::Transaction {
bitcoin::Transaction {
version: bitcoin::transaction::Version(2),
version: bitcoin::transaction::Version(3),
lock_time: absolute::LockTime::from_consensus(0),
input: tx_ins,
output: tx_outs,
Expand Down
3 changes: 3 additions & 0 deletions core/tests/musig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ async fn key_spend() {
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
rpc.mine_blocks(1).await.unwrap();

tx_details.tx.input[0].witness.push(final_signature);
rpc.client
Expand Down Expand Up @@ -246,6 +247,7 @@ async fn key_spend_with_script() {
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
rpc.mine_blocks(1).await.unwrap();

tx_details.tx.input[0].witness.push(final_signature);
rpc.client
Expand Down Expand Up @@ -350,6 +352,7 @@ async fn script_spend() {
let schnorr_sig = secp256k1::schnorr::Signature::from_slice(&final_signature).unwrap();
let witness_elements = vec![schnorr_sig.as_ref()];
handle_taproot_witness_new(&mut tx_details, &witness_elements, 0, Some(0)).unwrap();
rpc.mine_blocks(1).await.unwrap();

rpc.client
.send_raw_transaction(&tx_details.tx)
Expand Down
1 change: 1 addition & 0 deletions core/tests/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async fn create_address_and_transaction_then_sign_transaction() {
.sign_taproot_script_spend_tx_new_tweaked(&mut tx_details, 0, 0)
.unwrap();
handle_taproot_witness_new(&mut tx_details, &[sig.as_ref()], 0, Some(0)).unwrap();
rpc.mine_blocks(1).await.unwrap();

// New transaction should be OK to send.
rpc.client
Expand Down

0 comments on commit 032d463

Please sign in to comment.