@@ -389,7 +389,7 @@ fn creates_short_lived_offer() {
389
389
for path in offer. paths ( ) {
390
390
let introduction_node_id = resolve_introduction_node ( bob, & path) ;
391
391
assert_eq ! ( introduction_node_id, alice_id) ;
392
- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
392
+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
393
393
}
394
394
}
395
395
@@ -415,7 +415,7 @@ fn creates_long_lived_offer() {
415
415
assert_eq ! ( offer. absolute_expiry( ) , Some ( absolute_expiry) ) ;
416
416
assert ! ( !offer. paths( ) . is_empty( ) ) ;
417
417
for path in offer. paths ( ) {
418
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
418
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
419
419
}
420
420
421
421
let offer = alice. node
@@ -424,7 +424,7 @@ fn creates_long_lived_offer() {
424
424
assert_eq ! ( offer. absolute_expiry( ) , None ) ;
425
425
assert ! ( !offer. paths( ) . is_empty( ) ) ;
426
426
for path in offer. paths ( ) {
427
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
427
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
428
428
}
429
429
}
430
430
@@ -453,7 +453,7 @@ fn creates_short_lived_refund() {
453
453
for path in refund. paths ( ) {
454
454
let introduction_node_id = resolve_introduction_node ( alice, & path) ;
455
455
assert_eq ! ( introduction_node_id, bob_id) ;
456
- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
456
+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
457
457
}
458
458
}
459
459
@@ -480,7 +480,7 @@ fn creates_long_lived_refund() {
480
480
assert_eq ! ( refund. absolute_expiry( ) , Some ( absolute_expiry) ) ;
481
481
assert ! ( !refund. paths( ) . is_empty( ) ) ;
482
482
for path in refund. paths ( ) {
483
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
483
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
484
484
}
485
485
}
486
486
@@ -530,7 +530,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
530
530
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
531
531
assert ! ( !offer. paths( ) . is_empty( ) ) ;
532
532
for path in offer. paths ( ) {
533
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
533
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
534
534
}
535
535
536
536
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -559,7 +559,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
559
559
} ) ;
560
560
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
561
561
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
562
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
562
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
563
563
564
564
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
565
565
charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -631,7 +631,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
631
631
assert_ne ! ( refund. payer_id( ) , david_id) ;
632
632
assert ! ( !refund. paths( ) . is_empty( ) ) ;
633
633
for path in refund. paths ( ) {
634
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
634
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
635
635
}
636
636
expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
637
637
@@ -687,7 +687,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
687
687
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
688
688
assert ! ( !offer. paths( ) . is_empty( ) ) ;
689
689
for path in offer. paths ( ) {
690
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
690
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
691
691
}
692
692
693
693
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -708,7 +708,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
708
708
} ) ;
709
709
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
710
710
assert_ne ! ( invoice_request. payer_id( ) , bob_id) ;
711
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
711
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
712
712
713
713
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
714
714
bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -756,7 +756,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
756
756
assert_ne ! ( refund. payer_id( ) , bob_id) ;
757
757
assert ! ( !refund. paths( ) . is_empty( ) ) ;
758
758
for path in refund. paths ( ) {
759
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
759
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
760
760
}
761
761
expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
762
762
@@ -931,7 +931,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
931
931
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
932
932
assert ! ( !offer. paths( ) . is_empty( ) ) ;
933
933
for path in offer. paths ( ) {
934
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
934
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
935
935
}
936
936
937
937
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -950,7 +950,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
950
950
alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
951
951
952
952
let ( _, reply_path) = extract_invoice_request ( alice, & onion_message) ;
953
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
953
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
954
954
955
955
// Send, extract and verify the second Invoice Request message
956
956
let onion_message = david. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
@@ -960,7 +960,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
960
960
alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
961
961
962
962
let ( _, reply_path) = extract_invoice_request ( alice, & onion_message) ;
963
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
963
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
964
964
}
965
965
966
966
/// This test checks that when multiple potential introduction nodes are available for the payee,
@@ -1015,7 +1015,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1015
1015
. build ( ) . unwrap ( ) ;
1016
1016
assert_ne ! ( refund. payer_id( ) , alice_id) ;
1017
1017
for path in refund. paths ( ) {
1018
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1018
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1019
1019
}
1020
1020
expect_recent_payment ! ( alice, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1021
1021
@@ -1031,7 +1031,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1031
1031
let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
1032
1032
1033
1033
let ( _, reply_path) = extract_invoice ( alice, & onion_message) ;
1034
- assert_eq ! ( reply_path. unwrap( ) . 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1034
+ assert_eq ! ( reply_path. unwrap( ) . introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1035
1035
1036
1036
// Send, extract and verify the second Invoice Request message
1037
1037
let onion_message = david. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
@@ -1040,7 +1040,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1040
1040
let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
1041
1041
1042
1042
let ( _, reply_path) = extract_invoice ( alice, & onion_message) ;
1043
- assert_eq ! ( reply_path. unwrap( ) . 0 . introduction_node, IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
1043
+ assert_eq ! ( reply_path. unwrap( ) . introduction_node( ) , & IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
1044
1044
}
1045
1045
1046
1046
/// Checks that a deferred invoice can be paid asynchronously from an Event::InvoiceReceived.
@@ -1152,7 +1152,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
1152
1152
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1153
1153
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1154
1154
for path in offer. paths ( ) {
1155
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1155
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1156
1156
}
1157
1157
1158
1158
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1172,7 +1172,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
1172
1172
} ,
1173
1173
} ) ;
1174
1174
assert_ne ! ( invoice_request. payer_id( ) , bob_id) ;
1175
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
1175
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
1176
1176
1177
1177
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
1178
1178
bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1218,7 +1218,7 @@ fn creates_refund_with_blinded_path_using_unannounced_introduction_node() {
1218
1218
assert_ne ! ( refund. payer_id( ) , bob_id) ;
1219
1219
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1220
1220
for path in refund. paths ( ) {
1221
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
1221
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
1222
1222
}
1223
1223
expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1224
1224
@@ -1282,7 +1282,7 @@ fn fails_authentication_when_handling_invoice_request() {
1282
1282
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1283
1283
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1284
1284
for path in offer. paths ( ) {
1285
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1285
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1286
1286
}
1287
1287
1288
1288
let invalid_path = alice. node
@@ -1291,7 +1291,7 @@ fn fails_authentication_when_handling_invoice_request() {
1291
1291
. build ( ) . unwrap ( )
1292
1292
. paths ( ) . first ( ) . unwrap ( )
1293
1293
. clone ( ) ;
1294
- assert_eq ! ( invalid_path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1294
+ assert_eq ! ( invalid_path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1295
1295
1296
1296
// Send the invoice request directly to Alice instead of using a blinded path.
1297
1297
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1315,7 +1315,7 @@ fn fails_authentication_when_handling_invoice_request() {
1315
1315
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1316
1316
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1317
1317
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1318
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1318
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1319
1319
1320
1320
assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
1321
1321
@@ -1348,7 +1348,7 @@ fn fails_authentication_when_handling_invoice_request() {
1348
1348
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1349
1349
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1350
1350
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1351
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1351
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1352
1352
1353
1353
assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
1354
1354
}
@@ -1399,7 +1399,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
1399
1399
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1400
1400
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1401
1401
for path in offer. paths ( ) {
1402
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1402
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1403
1403
}
1404
1404
1405
1405
// Initiate an invoice request, but abandon tracking it.
@@ -1453,7 +1453,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
1453
1453
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1454
1454
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1455
1455
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1456
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1456
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1457
1457
1458
1458
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
1459
1459
charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1510,7 +1510,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
1510
1510
assert_ne ! ( refund. payer_id( ) , david_id) ;
1511
1511
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1512
1512
for path in refund. paths ( ) {
1513
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1513
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1514
1514
}
1515
1515
expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1516
1516
@@ -1547,7 +1547,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
1547
1547
assert_ne ! ( refund. payer_id( ) , david_id) ;
1548
1548
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1549
1549
for path in refund. paths ( ) {
1550
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1550
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1551
1551
}
1552
1552
1553
1553
let expected_invoice = alice. node . request_refund_payment ( & refund) . unwrap ( ) ;
0 commit comments