X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Ffunctional_tests.rs;h=044c1673011dd66d81112fe7c673a9aaf19287a0;hb=6de175575b6cd3e4f087a123a6dd699c9ec8ef00;hp=819fc23ba138b61d99cf36e95191b5efed54b8a6;hpb=ab8f5a8620760eaac3d5a150d06e35ac88ae1ea1;p=rust-lightning diff --git a/src/ln/functional_tests.rs b/src/ln/functional_tests.rs index 819fc23ba..044c16730 100644 --- a/src/ln/functional_tests.rs +++ b/src/ln/functional_tests.rs @@ -1246,7 +1246,6 @@ fn duplicate_htlc_test() { } fn do_channel_reserve_test(test_recv: bool) { - use std::sync::atomic::Ordering; use ln::msgs::HandleError; let mut nodes = create_network(3, &[None, None, None]); @@ -2030,11 +2029,16 @@ fn claim_htlc_outputs_single_tx() { assert_eq!(node_txn[1].input.len(), 1); assert_eq!(node_txn[2].input.len(), 1); - let mut revoked_tx_map = HashMap::new(); - revoked_tx_map.insert(revoked_local_txn[0].txid(), revoked_local_txn[0].clone()); - node_txn[0].verify(&revoked_tx_map).unwrap(); - node_txn[1].verify(&revoked_tx_map).unwrap(); - node_txn[2].verify(&revoked_tx_map).unwrap(); + fn get_txout(out_point: &BitcoinOutPoint, tx: &Transaction) -> Option { + if out_point.txid == tx.txid() { + tx.output.get(out_point.vout as usize).cloned() + } else { + None + } + } + node_txn[0].verify(|out|get_txout(out, &revoked_local_txn[0])).unwrap(); + node_txn[1].verify(|out|get_txout(out, &revoked_local_txn[0])).unwrap(); + node_txn[2].verify(|out|get_txout(out, &revoked_local_txn[0])).unwrap(); let mut witness_lens = BTreeSet::new(); witness_lens.insert(node_txn[0].input[0].witness.last().unwrap().len()); @@ -4513,7 +4517,6 @@ fn run_onion_failure_test_with_fail_intercept(_name: &str, test_case: F2: for <'a> FnMut(&'a mut msgs::UpdateFailHTLC), F3: FnMut(), { - use ln::msgs::HTLCFailChannelUpdate; // reset block height let header = BlockHeader { version: 0x20000000, prev_blockhash: Default::default(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };