Skip to content

Commit 5acef01

Browse files
committed
WIP: Attempt at fixing test_bump_penalty_txn_on_revoked_htlcs
1 parent 71c7606 commit 5acef01

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7874,15 +7874,18 @@ fn test_bump_penalty_txn_on_revoked_htlcs() {
78747874
let penalty_txn;
78757875
{
78767876
let mut node_txn = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap();
7877-
assert_eq!(node_txn.len(), 5); // 3 penalty txn on revoked commitment tx + A commitment tx + 1 penalty tnx on revoked HTLC txn
7877+
for tx in node_txn.iter() {
7878+
eprintln!("{:#?}", tx);
7879+
}
7880+
assert_eq!(node_txn.len(), 4); // 3 penalty txn on revoked commitment tx + A commitment tx + 1 penalty tnx on revoked HTLC txn
78787881
// Verify claim tx are spending revoked HTLC txn
7879-
assert_eq!(node_txn[3].input.len(), 2);
7880-
assert_eq!(node_txn[3].output.len(), 1);
7881-
check_spends!(node_txn[3], revoked_htlc_txn[0], revoked_htlc_txn[1]);
7882-
first = node_txn[3].txid();
7882+
assert_eq!(node_txn[2].input.len(), 3);
7883+
assert_eq!(node_txn[2].output.len(), 1);
7884+
check_spends!(node_txn[2], revoked_htlc_txn[0], revoked_htlc_txn[1]);
7885+
first = node_txn[2].txid();
78837886
// Store both feerates for later comparison
7884-
let fee_1 = revoked_htlc_txn[0].output[0].value + revoked_htlc_txn[1].output[0].value - node_txn[3].output[0].value;
7885-
feerate_1 = fee_1 * 1000 / node_txn[3].get_weight() as u64;
7887+
let fee_1 = revoked_htlc_txn[0].output[0].value + revoked_htlc_txn[1].output[0].value - node_txn[2].output[0].value;
7888+
feerate_1 = fee_1 * 1000 / node_txn[2].get_weight() as u64;
78867889
penalty_txn = vec![node_txn[0].clone(), node_txn[1].clone(), node_txn[2].clone()];
78877890
node_txn.clear();
78887891
}

0 commit comments

Comments
 (0)