Skip to content

Commit

Permalink
fix: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EdsonAlcala committed Oct 1, 2024
1 parent b77822a commit 27b208d
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions src/bitcoin/bitcoin_transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,55 +90,4 @@ mod tests {
.outputs(vec![])
.build();
}

// #[test]
// fn test_sighash_all() {
// -------------------------------------------------------------------------------------------------
// Create an equivalent transaction using the Bitcoin library
// let txin_btc = TxIn {
// previous_output: OutPoint::new(
// first_unspent["txid"].as_str().unwrap().parse()?,
// first_unspent["vout"].as_u64().unwrap() as u32,
// ),
// script_sig: ScriptBuf::new(), // Initially empty, will be filled later with the signature
// sequence: Sequence::MAX,
// witness: Witness::default(),
// };

// let txout_btc = TxOut {
// value: SPEND_AMOUNT,
// script_pubkey: alice.script_pubkey.clone(),
// };

// let utxo_amount_btc = Amount::from_btc(first_unspent["amount"].as_f64().unwrap())?;
// let change_amount: Amount = utxo_amount_btc - SPEND_AMOUNT - Amount::from_sat(1000); // 1000 satoshis for fee

// let change_txout_btc = TxOut {
// value: change_amount,
// script_pubkey: bob.script_pubkey.clone(),
// };

// let mut tx_btc = Transaction {
// version: transaction::Version::ONE,
// lock_time: LockTime::Blocks(Height::from_consensus(1).unwrap()),
// input: vec![txin_btc],
// output: vec![txout_btc, change_txout_btc],
// };

// // Get the sighash to sign.
// let sighasher = SighashCache::new(&mut tx_btc);
// let sighash_btc = sighasher
// .legacy_signature_hash(0, &bob.script_pubkey, sighash_type.to_u32())
// .expect("failed to create sighash");

// println!("sighash btc: {:?}", sighash_btc);
// println!("sighash: {:?}", sighash_omni.to_byte_array());
// println!("sighash btc: {:?}", sighash_btc.to_byte_array());

// assert_eq!(
// sighash_omni.to_byte_array(),
// sighash_btc.to_byte_array(),
// "sighash btc is not equal to sighash"
// );
// }
}

0 comments on commit 27b208d

Please sign in to comment.