X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Ffunctional_tests.rs;h=e37b63cc19f53a89dd310dba3687d96912fb4037;hb=5bb7ba5b7d7f81977705f0ed5652c9924c7a1d56;hp=819fc23ba138b61d99cf36e95191b5efed54b8a6;hpb=ab8f5a8620760eaac3d5a150d06e35ac88ae1ea1;p=rust-lightning diff --git a/src/ln/functional_tests.rs b/src/ln/functional_tests.rs index 819fc23b..e37b63cc 100644 --- a/src/ln/functional_tests.rs +++ b/src/ln/functional_tests.rs @@ -2030,11 +2030,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());