Skip to content

Commit

Permalink
transaction_builder: Remove unused struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Sep 17, 2024
1 parent c07395f commit d754403
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 469 deletions.
14 changes: 7 additions & 7 deletions core/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
MuSigPartialSignature, MuSigPubNonce,
},
traits::rpc::AggregatorServer,
transaction_builder::TransactionBuilder,
transaction_builder,
utils::{self, handle_taproot_witness_new},
ByteArray32, ByteArray66, EVMAddress, UTXO,
};
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Aggregator {
agg_nonce: &MuSigAggNonce,
partial_sigs: Vec<MuSigPartialSignature>,
) -> Result<[u8; 64], BridgeError> {
let mut tx = TransactionBuilder::create_slash_or_take_tx(
let mut tx = transaction_builder::create_slash_or_take_tx(
deposit_outpoint,
kickoff_utxo,
&operator_xonly_pk,
Expand Down Expand Up @@ -102,7 +102,7 @@ impl Aggregator {
agg_nonce: &MuSigAggNonce,
partial_sigs: Vec<MuSigPartialSignature>,
) -> Result<[u8; 64], BridgeError> {
let move_tx_handler = TransactionBuilder::create_move_tx(
let move_tx_handler = transaction_builder::create_move_tx(
deposit_outpoint,
&EVMAddress([0u8; 20]),
Address::p2tr(
Expand All @@ -121,7 +121,7 @@ impl Aggregator {
txid: move_tx_handler.tx.compute_txid(),
vout: 0,
};
let slash_or_take_tx_handler = TransactionBuilder::create_slash_or_take_tx(
let slash_or_take_tx_handler = transaction_builder::create_slash_or_take_tx(
deposit_outpoint,
kickoff_utxo,
operator_xonly_pk,
Expand All @@ -144,7 +144,7 @@ impl Aggregator {
// serde_json::to_string(&slash_or_take_utxo)?
// );

let mut tx_handler = TransactionBuilder::create_operator_takes_tx(
let mut tx_handler = transaction_builder::create_operator_takes_tx(
bridge_fund_outpoint,
slash_or_take_utxo,
operator_xonly_pk,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl Aggregator {
agg_nonce: &MuSigAggNonce,
partial_sigs: Vec<MuSigPartialSignature>,
) -> Result<[u8; 64], BridgeError> {
let mut tx = TransactionBuilder::create_move_tx(
let mut tx = transaction_builder::create_move_tx(
deposit_outpoint,
evm_address,
recovery_taproot_address,
Expand Down Expand Up @@ -309,7 +309,7 @@ impl Aggregator {

let move_tx_sig = secp256k1::schnorr::Signature::from_slice(&agg_move_tx_final_sig)?;

let mut move_tx_handler = TransactionBuilder::create_move_tx(
let mut move_tx_handler = transaction_builder::create_move_tx(
deposit_outpoint,
&evm_address,
&recovery_taproot_address,
Expand Down
4 changes: 2 additions & 2 deletions core/src/extended_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This module provides helpful functions for Bitcoin RPC.
use crate::errors::BridgeError;
use crate::transaction_builder::TransactionBuilder;
use crate::transaction_builder;
use crate::EVMAddress;
use bitcoin::address::NetworkUnchecked;
use bitcoin::Address;
Expand Down Expand Up @@ -177,7 +177,7 @@ where
return Err(BridgeError::DepositNotFinalized);
}

let (deposit_address, _) = TransactionBuilder::generate_deposit_address(
let (deposit_address, _) = transaction_builder::generate_deposit_address(
nofn_xonly_pk,
recovery_taproot_address,
evm_address,
Expand Down
18 changes: 9 additions & 9 deletions core/src/musig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ mod tests {
actor::Actor,
errors::BridgeError,
musig2::{AggregateFromPublicKeys, MuSigPartialSignature},
transaction_builder::{TransactionBuilder, TxHandler},
transaction_builder::{self, TxHandler},
utils, ByteArray32,
};
use bitcoin::{
Expand Down Expand Up @@ -435,7 +435,7 @@ mod tests {
bitcoin::Network::Regtest,
);
let (sending_address, sending_address_spend_info) =
TransactionBuilder::create_taproot_address(
transaction_builder::create_taproot_address(
&scripts.clone(),
Some(untweaked_xonly_pubkey),
bitcoin::Network::Regtest,
Expand All @@ -448,12 +448,12 @@ mod tests {
txid: Txid::from_byte_array([0u8; 32]),
vout: 0,
};
let tx_outs = TransactionBuilder::create_tx_outs(vec![(
let tx_outs = transaction_builder::create_tx_outs(vec![(
Amount::from_sat(99_000_000),
receiving_address.script_pubkey(),
)]);
let tx_ins = TransactionBuilder::create_tx_ins(vec![utxo]);
let dummy_tx = TransactionBuilder::create_btc_tx(tx_ins, tx_outs);
let tx_ins = transaction_builder::create_tx_ins(vec![utxo]);
let dummy_tx = transaction_builder::create_btc_tx(tx_ins, tx_outs);
let mut tx_details = TxHandler {
tx: dummy_tx,
prevouts: vec![prevout],
Expand Down Expand Up @@ -525,7 +525,7 @@ mod tests {
bitcoin::Network::Regtest,
);
let (sending_address, sending_address_spend_info) =
TransactionBuilder::create_taproot_address(
transaction_builder::create_taproot_address(
&scripts.clone(),
None,
bitcoin::Network::Regtest,
Expand All @@ -538,12 +538,12 @@ mod tests {
txid: Txid::from_byte_array([0u8; 32]),
vout: 0,
};
let tx_outs = TransactionBuilder::create_tx_outs(vec![(
let tx_outs = transaction_builder::create_tx_outs(vec![(
Amount::from_sat(99_000_000),
receiving_address.script_pubkey(),
)]);
let tx_ins = TransactionBuilder::create_tx_ins(vec![utxo]);
let dummy_tx = TransactionBuilder::create_btc_tx(tx_ins, tx_outs);
let tx_ins = transaction_builder::create_tx_ins(vec![utxo]);
let dummy_tx = transaction_builder::create_btc_tx(tx_ins, tx_outs);
let mut tx_details = TxHandler {
tx: dummy_tx,
prevouts: vec![prevout],
Expand Down
Loading

0 comments on commit d754403

Please sign in to comment.