Skip to content

Commit 9f57703

Browse files
committed
Rename expect_pending_htlcs_forwardable_conditions
1 parent cfd15ee commit 9f57703

12 files changed

+62
-78
lines changed

lightning/src/ln/async_payments_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ fn invalid_async_receive_with_retry<F1, F2>(
10811081
// Fail the HTLC backwards to enable us to more easily modify the now-Retryable outbound to test
10821082
// failures on the recipient's end.
10831083
nodes[2].node.fail_htlc_backwards(&payment_hash);
1084-
expect_pending_htlcs_forwardable_conditions(
1084+
expect_htlc_failure_conditions(
10851085
nodes[2].node.get_and_clear_pending_events(),
10861086
&[HTLCHandlingFailureType::Receive { payment_hash }],
10871087
);

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
742742

743743
if intercept_node_fails {
744744
nodes[1].node.fail_intercepted_htlc(intercept_id).unwrap();
745-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::InvalidForward { requested_forward_scid: intercept_scid }]);
745+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::InvalidForward { requested_forward_scid: intercept_scid }]);
746746
nodes[1].node.process_pending_htlc_forwards();
747747
check_added_monitors!(&nodes[1], 1);
748748
fail_blinded_htlc_backwards(payment_hash, 1, &[&nodes[0], &nodes[1]], false);
@@ -846,7 +846,7 @@ fn three_hop_blinded_path_fail() {
846846
pass_along_route(&nodes[0], &[&[&nodes[1], &nodes[2], &nodes[3]]], amt_msat, payment_hash, payment_secret);
847847

848848
nodes[3].node.fail_htlc_backwards(&payment_hash);
849-
expect_pending_htlcs_forwardable_conditions(
849+
expect_htlc_failure_conditions(
850850
nodes[3].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]
851851
);
852852
nodes[3].node.process_pending_htlc_forwards();
@@ -974,7 +974,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
974974
None, nodes[2].node.get_our_node_id()
975975
);
976976
nodes[2].node.fail_htlc_backwards(&payment_hash);
977-
expect_pending_htlcs_forwardable_conditions(
977+
expect_htlc_failure_conditions(
978978
nodes[2].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]
979979
);
980980
nodes[2].node.process_pending_htlc_forwards();
@@ -1040,7 +1040,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10401040
check_added_monitors!(nodes[2], 0);
10411041
do_commitment_signed_dance(&nodes[2], &nodes[1], &payment_event_1_2.commitment_msg, true, true);
10421042
expect_and_process_pending_htlcs(&nodes[2], true);
1043-
expect_pending_htlcs_forwardable_conditions(nodes[2].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]);
1043+
expect_htlc_failure_conditions(nodes[2].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]);
10441044
check_added_monitors!(nodes[2], 1);
10451045
},
10461046
ReceiveCheckFail::PaymentConstraints => {
@@ -1136,7 +1136,7 @@ fn blinded_path_retries() {
11361136
macro_rules! fail_payment_back {
11371137
($intro_node: expr) => {
11381138
nodes[3].node.fail_htlc_backwards(&payment_hash);
1139-
expect_pending_htlcs_forwardable_conditions(
1139+
expect_htlc_failure_conditions(
11401140
nodes[3].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]
11411141
);
11421142
nodes[3].node.process_pending_htlc_forwards();

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ fn test_monitor_update_fail_claim() {
18591859
let events = nodes[1].node.get_and_clear_pending_msg_events();
18601860
assert_eq!(events.len(), 0);
18611861
commitment_signed_dance!(nodes[1], nodes[2], payment_event.commitment_msg, false, true);
1862-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
1862+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
18631863

18641864
let (_, payment_hash_3, payment_secret_3) = get_payment_preimage_hash!(nodes[0]);
18651865
let id_3 = PaymentId(payment_hash_3.0);
@@ -2949,10 +2949,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
29492949
if htlc_status == HTLCStatusAtDupClaim::HoldingCell {
29502950
nodes[1].node.handle_revoke_and_ack(node_a_id, &as_raa.unwrap());
29512951
check_added_monitors!(nodes[1], 1);
2952-
expect_pending_htlcs_forwardable_conditions(
2953-
nodes[1].node.get_and_clear_pending_events(),
2954-
&[],
2955-
); // We finally receive the second payment, but don't claim it
2952+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]); // We finally receive the second payment, but don't claim it
29562953

29572954
bs_updates = Some(get_htlc_update_msgs!(nodes[1], node_a_id));
29582955
assert_eq!(bs_updates.as_ref().unwrap().update_fulfill_htlcs.len(), 1);

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16925,7 +16925,7 @@ mod tests {
1692516925
expect_and_process_pending_htlcs(&nodes[1], true);
1692616926
let events = nodes[1].node.get_and_clear_pending_events();
1692716927
let fail = HTLCHandlingFailureType::Receive { payment_hash: our_payment_hash };
16928-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
16928+
expect_htlc_failure_conditions(events, &[fail]);
1692916929
check_added_monitors!(nodes[1], 1);
1693016930
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1693116931
assert!(updates.update_add_htlcs.is_empty());
@@ -17147,7 +17147,7 @@ mod tests {
1714717147
expect_and_process_pending_htlcs(&nodes[1], true);
1714817148
let events = nodes[1].node.get_and_clear_pending_events();
1714917149
let fail = HTLCHandlingFailureType::Receive { payment_hash };
17150-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
17150+
expect_htlc_failure_conditions(events, &[fail]);
1715117151
nodes[1].node.get_and_clear_pending_events();
1715217152
check_added_monitors!(nodes[1], 1);
1715317153
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
@@ -17195,7 +17195,7 @@ mod tests {
1719517195
expect_and_process_pending_htlcs(&nodes[1], true);
1719617196
let events = nodes[1].node.get_and_clear_pending_events();
1719717197
let fail = HTLCHandlingFailureType::Receive { payment_hash };
17198-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
17198+
expect_htlc_failure_conditions(events, &[fail]);
1719917199
check_added_monitors!(nodes[1], 1);
1720017200
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1720117201
assert!(updates.update_add_htlcs.is_empty());
@@ -17244,7 +17244,7 @@ mod tests {
1724417244
expect_and_process_pending_htlcs(&nodes[1], true);
1724517245
let events = nodes[1].node.get_and_clear_pending_events();
1724617246
let fail = HTLCHandlingFailureType::Receive { payment_hash };
17247-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
17247+
expect_htlc_failure_conditions(events, &[fail]);
1724817248
check_added_monitors!(nodes[1], 1);
1724917249
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
1725017250
assert!(updates.update_add_htlcs.is_empty());

lightning/src/ln/functional_test_utils.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,10 +2373,9 @@ macro_rules! expect_htlc_handling_failed_destinations {
23732373
}};
23742374
}
23752375

2376-
/// Checks that an [`Event::PendingHTLCsForwardable`] is available in the given events and, if
2377-
/// there are any [`Event::HTLCHandlingFailed`] events their [`HTLCHandlingFailureType`] is included in the
2378-
/// `expected_failures` set.
2379-
pub fn expect_pending_htlcs_forwardable_conditions(
2376+
/// Checks that, if there are any [`Event::HTLCHandlingFailed`] events, their
2377+
/// [`HTLCHandlingFailureType`] is included in the `expected_failures` set.
2378+
pub fn expect_htlc_failure_conditions(
23802379
events: Vec<Event>, expected_failures: &[HTLCHandlingFailureType],
23812380
) {
23822381
assert_eq!(events.len(), expected_failures.len());
@@ -2389,7 +2388,7 @@ pub fn expect_and_process_pending_htlcs_and_htlc_handling_failed(
23892388
node: &Node<'_, '_, '_>, expected_failures: &[HTLCHandlingFailureType],
23902389
) {
23912390
let events = node.node.get_and_clear_pending_events();
2392-
expect_pending_htlcs_forwardable_conditions(events, expected_failures);
2391+
expect_htlc_failure_conditions(events, expected_failures);
23932392
expect_and_process_pending_htlcs(node, false);
23942393
assert!(node.node.get_and_clear_pending_events().is_empty());
23952394
}

lightning/src/ln/functional_tests.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6559,7 +6559,7 @@ pub fn test_check_htlc_underpaying() {
65596559
expect_and_process_pending_htlcs(&nodes[1], true);
65606560
let events = nodes[1].node.get_and_clear_pending_events();
65616561
let fail = HTLCHandlingFailureType::Receive { payment_hash: our_payment_hash };
6562-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
6562+
expect_htlc_failure_conditions(events, &[fail]);
65636563

65646564
// Node 3 is expecting payment of 100_000 but received 10_000,
65656565
// it should fail htlc like we didn't know the preimage.
@@ -6900,7 +6900,7 @@ pub fn test_bump_penalty_txn_on_revoked_htlcs() {
69006900
);
69016901
connect_block(&nodes[0], &block_129);
69026902
let events = nodes[0].node.get_and_clear_pending_events();
6903-
expect_pending_htlcs_forwardable_conditions(
6903+
expect_htlc_failure_conditions(
69046904
events[0..1].to_vec(),
69056905
&[HTLCHandlingFailureType::Receive { payment_hash: failed_payment_hash }],
69066906
);
@@ -7211,7 +7211,7 @@ pub fn test_bump_txn_sanitize_tracking_maps() {
72117211

72127212
// Broadcast set of revoked txn on A
72137213
connect_blocks(&nodes[0], TEST_FINAL_CLTV + 2 - CHAN_CONFIRM_DEPTH);
7214-
expect_pending_htlcs_forwardable_conditions(
7214+
expect_htlc_failure_conditions(
72157215
nodes[0].node.get_and_clear_pending_events(),
72167216
&[HTLCHandlingFailureType::Receive { payment_hash: payment_hash_2 }],
72177217
);
@@ -7990,7 +7990,7 @@ pub fn test_bad_secret_hash() {
79907990
expect_and_process_pending_htlcs(&nodes[1], true);
79917991
let events = nodes[1].node.get_and_clear_pending_events();
79927992
let fail = HTLCHandlingFailureType::Receive { payment_hash: $payment_hash };
7993-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
7993+
expect_htlc_failure_conditions(events, &[fail]);
79947994
check_added_monitors(&nodes[1], 1);
79957995

79967996
// We should fail the payment back
@@ -9498,7 +9498,7 @@ fn do_test_dup_htlc_second_rejected(test_for_second_fail_panic: bool) {
94989498
// the first HTLC delivered above.
94999499
}
95009500

9501-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
9501+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
95029502
nodes[1].node.process_pending_htlc_forwards();
95039503

95049504
if test_for_second_fail_panic {
@@ -9509,7 +9509,7 @@ fn do_test_dup_htlc_second_rejected(test_for_second_fail_panic: bool) {
95099509
HTLCHandlingFailureType::Receive { payment_hash: our_payment_hash },
95109510
HTLCHandlingFailureType::Receive { payment_hash: our_payment_hash },
95119511
];
9512-
expect_pending_htlcs_forwardable_conditions(
9512+
expect_htlc_failure_conditions(
95139513
nodes[1].node.get_and_clear_pending_events(),
95149514
expected_destinations,
95159515
);
@@ -9543,7 +9543,7 @@ fn do_test_dup_htlc_second_rejected(test_for_second_fail_panic: bool) {
95439543
}
95449544
} else {
95459545
// Let the second HTLC fail and claim the first
9546-
expect_pending_htlcs_forwardable_conditions(
9546+
expect_htlc_failure_conditions(
95479547
nodes[1].node.get_and_clear_pending_events(),
95489548
&[HTLCHandlingFailureType::Receive { payment_hash: our_payment_hash }],
95499549
);
@@ -9673,13 +9673,10 @@ pub fn test_inconsistent_mpp_params() {
96739673
// amount. It will assume the second is a privacy attack (no longer particularly relevant
96749674
// post-payment_secrets) and fail back the new HTLC.
96759675
}
9676-
expect_pending_htlcs_forwardable_conditions(nodes[3].node.get_and_clear_pending_events(), &[]);
9676+
expect_htlc_failure_conditions(nodes[3].node.get_and_clear_pending_events(), &[]);
96779677
nodes[3].node.process_pending_htlc_forwards();
96789678
let fail_type = HTLCHandlingFailureType::Receive { payment_hash: hash };
9679-
expect_pending_htlcs_forwardable_conditions(
9680-
nodes[3].node.get_and_clear_pending_events(),
9681-
&[fail_type],
9682-
);
9679+
expect_htlc_failure_conditions(nodes[3].node.get_and_clear_pending_events(), &[fail_type]);
96839680
nodes[3].node.process_pending_htlc_forwards();
96849681

96859682
check_added_monitors(&nodes[3], 1);
@@ -10758,7 +10755,7 @@ fn do_payment_with_custom_min_final_cltv_expiry(valid_delta: bool, use_user_hash
1075810755
expect_and_process_pending_htlcs(&nodes[1], true);
1075910756
let events = nodes[1].node.get_and_clear_pending_events();
1076010757
let fail_type = HTLCHandlingFailureType::Receive { payment_hash: hash };
10761-
expect_pending_htlcs_forwardable_conditions(events, &[fail_type]);
10758+
expect_htlc_failure_conditions(events, &[fail_type]);
1076210759

1076310760
check_added_monitors(&nodes[1], 1);
1076410761

lightning/src/ln/htlc_reserve_unit_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ pub fn holding_cell_htlc_counting() {
678678
expect_and_process_pending_htlcs(&nodes[1], true);
679679
let fail = HTLCHandlingFailureType::Forward { node_id: Some(node_c_id), channel_id: chan_2.2 };
680680
let events = nodes[1].node.get_and_clear_pending_events();
681-
expect_pending_htlcs_forwardable_conditions(events, &[fail]);
681+
expect_htlc_failure_conditions(events, &[fail]);
682682
check_added_monitors(&nodes[1], 1);
683683

684684
let bs_fail_updates = get_htlc_update_msgs!(nodes[1], node_a_id);

lightning/src/ln/monitor_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ fn test_no_preimage_inbound_htlc_balances() {
11821182
let as_htlc_timeout_claim = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().split_off(0);
11831183
assert_eq!(as_htlc_timeout_claim.len(), 1);
11841184
check_spends!(as_htlc_timeout_claim[0], as_txn[0]);
1185-
expect_pending_htlcs_forwardable_conditions(nodes[0].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash: to_a_failed_payment_hash }]);
1185+
expect_htlc_failure_conditions(nodes[0].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash: to_a_failed_payment_hash }]);
11861186
nodes[0].node.process_pending_htlc_forwards();
11871187

11881188
assert_eq!(as_pre_spend_claims,
@@ -1200,7 +1200,7 @@ fn test_no_preimage_inbound_htlc_balances() {
12001200
// The next few blocks for B look the same as for A, though for the opposite HTLC
12011201
nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap().clear();
12021202
connect_blocks(&nodes[1], TEST_FINAL_CLTV - (ANTI_REORG_DELAY - 1));
1203-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash: to_b_failed_payment_hash }]);
1203+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash: to_b_failed_payment_hash }]);
12041204
nodes[1].node.process_pending_htlc_forwards();
12051205
let bs_htlc_timeout_claim = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap().split_off(0);
12061206
assert_eq!(bs_htlc_timeout_claim.len(), 1);
@@ -1683,7 +1683,7 @@ fn do_test_revoked_counterparty_htlc_tx_balances(anchors: bool) {
16831683
// `COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE` blocks, making us consider all the HTLCs
16841684
// pinnable claims, which the remainder of the test assumes.
16851685
connect_blocks(&nodes[0], TEST_FINAL_CLTV - COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE);
1686-
expect_pending_htlcs_forwardable_conditions(nodes[0].node.get_and_clear_pending_events(),
1686+
expect_htlc_failure_conditions(nodes[0].node.get_and_clear_pending_events(),
16871687
&[HTLCHandlingFailureType::Receive { payment_hash: failed_payment_hash }]);
16881688
// A will generate justice tx from B's revoked commitment/HTLC tx
16891689
mine_transaction(&nodes[0], &revoked_local_txn[0]);

lightning/src/ln/onion_route_tests.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ fn test_phantom_onion_hmac_failure() {
24382438

24392439
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
24402440
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
2441-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2441+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
24422442
nodes[1].node.process_pending_update_add_htlcs();
24432443

24442444
// Modify the payload so the phantom hop's HMAC is bogus.
@@ -2461,7 +2461,7 @@ fn test_phantom_onion_hmac_failure() {
24612461
}
24622462
};
24632463
nodes[1].node.process_pending_htlc_forwards();
2464-
expect_pending_htlcs_forwardable_conditions(
2464+
expect_htlc_failure_conditions(
24652465
nodes[1].node.get_and_clear_pending_events(),
24662466
&[HTLCHandlingFailureType::Receive { payment_hash }],
24672467
);
@@ -2511,7 +2511,7 @@ fn test_phantom_invalid_onion_payload() {
25112511

25122512
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
25132513
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
2514-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2514+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
25152515
nodes[1].node.process_pending_update_add_htlcs();
25162516

25172517
// Modify the onion packet to have an invalid payment amount.
@@ -2562,7 +2562,7 @@ fn test_phantom_invalid_onion_payload() {
25622562
}
25632563
}
25642564
nodes[1].node.process_pending_htlc_forwards();
2565-
expect_pending_htlcs_forwardable_conditions(
2565+
expect_htlc_failure_conditions(
25662566
nodes[1].node.get_and_clear_pending_events(),
25672567
&[HTLCHandlingFailureType::Receive { payment_hash }],
25682568
);
@@ -2610,7 +2610,7 @@ fn test_phantom_final_incorrect_cltv_expiry() {
26102610

26112611
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
26122612
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
2613-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2613+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
26142614
nodes[1].node.process_pending_update_add_htlcs();
26152615

26162616
// Modify the payload so the phantom hop's HMAC is bogus.
@@ -2628,7 +2628,7 @@ fn test_phantom_final_incorrect_cltv_expiry() {
26282628
}
26292629
}
26302630
nodes[1].node.process_pending_htlc_forwards();
2631-
expect_pending_htlcs_forwardable_conditions(
2631+
expect_htlc_failure_conditions(
26322632
nodes[1].node.get_and_clear_pending_events(),
26332633
&[HTLCHandlingFailureType::Receive { payment_hash }],
26342634
);
@@ -2680,9 +2680,9 @@ fn test_phantom_failure_too_low_cltv() {
26802680
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
26812681
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
26822682

2683-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2683+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
26842684
nodes[1].node.process_pending_htlc_forwards();
2685-
expect_pending_htlcs_forwardable_conditions(
2685+
expect_htlc_failure_conditions(
26862686
nodes[1].node.get_and_clear_pending_events(),
26872687
&[HTLCHandlingFailureType::Receive { payment_hash }],
26882688
);
@@ -2838,11 +2838,11 @@ fn test_phantom_failure_too_low_recv_amt() {
28382838
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
28392839
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
28402840

2841-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2841+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
28422842
nodes[1].node.process_pending_htlc_forwards();
2843-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2843+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
28442844
nodes[1].node.process_pending_htlc_forwards();
2845-
expect_pending_htlcs_forwardable_conditions(
2845+
expect_htlc_failure_conditions(
28462846
nodes[1].node.get_and_clear_pending_events(),
28472847
&[HTLCHandlingFailureType::Receive { payment_hash: payment_hash.clone() }],
28482848
);
@@ -2958,9 +2958,9 @@ fn test_phantom_failure_reject_payment() {
29582958
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &update_add);
29592959
commitment_signed_dance!(nodes[1], nodes[0], &update_0.commitment_signed, false, true);
29602960

2961-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2961+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
29622962
nodes[1].node.process_pending_htlc_forwards();
2963-
expect_pending_htlcs_forwardable_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
2963+
expect_htlc_failure_conditions(nodes[1].node.get_and_clear_pending_events(), &[]);
29642964
nodes[1].node.process_pending_htlc_forwards();
29652965
expect_payment_claimable!(
29662966
nodes[1],
@@ -2971,7 +2971,7 @@ fn test_phantom_failure_reject_payment() {
29712971
route.paths[0].hops.last().unwrap().pubkey
29722972
);
29732973
nodes[1].node.fail_htlc_backwards(&payment_hash);
2974-
expect_pending_htlcs_forwardable_conditions(
2974+
expect_htlc_failure_conditions(
29752975
nodes[1].node.get_and_clear_pending_events(),
29762976
&[HTLCHandlingFailureType::Receive { payment_hash }],
29772977
);

0 commit comments

Comments
 (0)