Use TX IDs for Bitcoin Eventualities

They're a bit more binding, smaller, provided by the Rust bitcoin library,
sane, and we don't have to worry about malleability since all of our inputs are
SegWit.
This commit is contained in:
Luke Parker
2023-12-05 10:37:02 -05:00
parent 62fa31de07
commit 3a6c7ad796
5 changed files with 27 additions and 49 deletions

View File

@@ -279,6 +279,7 @@ async_sequential! {
FEE
).unwrap();
let needed_fee = tx.needed_fee();
let expected_id = tx.txid();
let tx = sign(&keys, tx);
assert_eq!(tx.output.len(), 3);
@@ -322,6 +323,7 @@ async_sequential! {
let mut hash = *tx.txid().as_raw_hash().as_byte_array();
hash.reverse();
assert_eq!(tx, rpc.get_transaction(&hash).await.unwrap());
assert_eq!(expected_id, hash);
}
async fn test_data() {