Skip to content

Commit dd30a77

Browse files
committed
Remove some unnecessary vecs from chanmon_update_fail_tests
1 parent 1d36d1d commit dd30a77

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn test_monitor_and_persister_update_fail() {
5252
let chan = create_announced_chan_between_nodes(&nodes, 0, 1);
5353

5454
// Rebalance the network to generate htlc in the two directions
55-
send_payment(&nodes[0], &vec![&nodes[1]][..], 10_000_000);
55+
send_payment(&nodes[0], &[&nodes[1]], 10_000_000);
5656

5757
// Route an HTLC from node 0 to node 1 (but don't settle)
5858
let (preimage, payment_hash, ..) = route_payment(&nodes[0], &[&nodes[1]], 9_000_000);
@@ -237,7 +237,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
237237
assert_eq!(payment_hash_1, *payment_hash);
238238
assert_eq!(amount_msat, 1_000_000);
239239
assert_eq!(receiver_node_id.unwrap(), nodes[1].node.get_our_node_id());
240-
assert_eq!(*via_channel_ids, vec![(channel_id, Some(user_channel_id))]);
240+
assert_eq!(*via_channel_ids, &[(channel_id, Some(user_channel_id))]);
241241
match &purpose {
242242
PaymentPurpose::Bolt11InvoicePayment {
243243
payment_preimage, payment_secret, ..
@@ -547,7 +547,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
547547
assert!(bs_resp.2.as_ref().unwrap().update_fail_htlcs.is_empty());
548548
assert!(bs_resp.2.as_ref().unwrap().update_fail_malformed_htlcs.is_empty());
549549
assert!(bs_resp.2.as_ref().unwrap().update_fee.is_none());
550-
assert!(bs_resp.2.as_ref().unwrap().update_fulfill_htlcs == vec![bs_initial_fulfill]);
550+
assert_eq!(bs_resp.2.as_ref().unwrap().update_fulfill_htlcs, [bs_initial_fulfill]);
551551
assert!(bs_resp.2.as_ref().unwrap().commitment_signed == bs_initial_commitment_signed);
552552

553553
assert!(as_resp.1.is_none());
@@ -779,7 +779,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
779779
assert_eq!(payment_hash_2, *payment_hash);
780780
assert_eq!(amount_msat, 1_000_000);
781781
assert_eq!(receiver_node_id.unwrap(), nodes[1].node.get_our_node_id());
782-
assert_eq!(*via_channel_ids, vec![(channel_id, Some(user_channel_id))]);
782+
assert_eq!(via_channel_ids, [(channel_id, Some(user_channel_id))]);
783783
match &purpose {
784784
PaymentPurpose::Bolt11InvoicePayment {
785785
payment_preimage, payment_secret, ..
@@ -940,7 +940,7 @@ fn test_monitor_update_fail_cs() {
940940
assert_eq!(payment_hash, our_payment_hash);
941941
assert_eq!(amount_msat, 1_000_000);
942942
assert_eq!(receiver_node_id.unwrap(), nodes[1].node.get_our_node_id());
943-
assert_eq!(*via_channel_ids, vec![(channel_id, Some(user_channel_id))]);
943+
assert_eq!(via_channel_ids, [(channel_id, Some(user_channel_id))]);
944944
match &purpose {
945945
PaymentPurpose::Bolt11InvoicePayment {
946946
payment_preimage, payment_secret, ..
@@ -1171,7 +1171,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
11711171
nodes[2].node.fail_htlc_backwards(&payment_hash_1);
11721172
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
11731173
nodes[2],
1174-
vec![HTLCHandlingFailureType::Receive { payment_hash: payment_hash_1 }]
1174+
[HTLCHandlingFailureType::Receive { payment_hash: payment_hash_1 }]
11751175
);
11761176
check_added_monitors!(nodes[2], 1);
11771177

@@ -1303,7 +1303,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
13031303
check_added_monitors!(nodes[1], 0);
13041304
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
13051305
nodes[1],
1306-
vec![HTLCHandlingFailureType::Forward {
1306+
[HTLCHandlingFailureType::Forward {
13071307
node_id: Some(nodes[2].node.get_our_node_id()),
13081308
channel_id: chan_2.2
13091309
}]
@@ -2509,7 +2509,7 @@ fn test_monitor_update_fail_claim() {
25092509
assert_eq!(payment_hash_3, *payment_hash);
25102510
assert_eq!(1_000_000, amount_msat);
25112511
assert_eq!(receiver_node_id.unwrap(), nodes[0].node.get_our_node_id());
2512-
assert_eq!(*via_channel_ids, vec![(channel_id, Some(42))]);
2512+
assert_eq!(via_channel_ids, [(channel_id, Some(42))]);
25132513
match &purpose {
25142514
PaymentPurpose::Bolt11InvoicePayment {
25152515
payment_preimage, payment_secret, ..
@@ -2544,7 +2544,7 @@ fn test_monitor_update_on_pending_forwards() {
25442544
nodes[2].node.fail_htlc_backwards(&payment_hash_1);
25452545
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
25462546
nodes[2],
2547-
vec![HTLCHandlingFailureType::Receive { payment_hash: payment_hash_1 }]
2547+
[HTLCHandlingFailureType::Receive { payment_hash: payment_hash_1 }]
25482548
);
25492549
check_added_monitors!(nodes[2], 1);
25502550

@@ -2580,7 +2580,7 @@ fn test_monitor_update_on_pending_forwards() {
25802580
chanmon_cfgs[1].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
25812581
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
25822582
nodes[1],
2583-
vec![HTLCHandlingFailureType::Forward {
2583+
[HTLCHandlingFailureType::Forward {
25842584
node_id: Some(nodes[2].node.get_our_node_id()),
25852585
channel_id: chan_2.2
25862586
}]
@@ -3252,7 +3252,7 @@ fn test_fail_htlc_on_broadcast_after_claim() {
32523252
check_added_monitors!(nodes[1], 1);
32533253
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
32543254
nodes[1],
3255-
vec![HTLCHandlingFailureType::Forward {
3255+
[HTLCHandlingFailureType::Forward {
32563256
node_id: Some(nodes[2].node.get_our_node_id()),
32573257
channel_id: chan_id_2
32583258
}]
@@ -3754,7 +3754,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
37543754
nodes[2].node.fail_htlc_backwards(&payment_hash);
37553755
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
37563756
nodes[2],
3757-
vec![HTLCHandlingFailureType::Receive { payment_hash }]
3757+
[HTLCHandlingFailureType::Receive { payment_hash }]
37583758
);
37593759
check_added_monitors!(nodes[2], 1);
37603760
get_htlc_update_msgs!(nodes[2], nodes[1].node.get_our_node_id());
@@ -3803,7 +3803,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
38033803
reconnect_nodes(reconnect_args);
38043804
expect_pending_htlcs_forwardable_and_htlc_handling_failed!(
38053805
nodes[1],
3806-
vec![HTLCHandlingFailureType::Forward {
3806+
[HTLCHandlingFailureType::Forward {
38073807
node_id: Some(nodes[2].node.get_our_node_id()),
38083808
channel_id: chan_id_2
38093809
}]

0 commit comments

Comments
 (0)