@@ -402,7 +402,7 @@ fn creates_short_lived_offer() {
402
402
for path in offer. paths ( ) {
403
403
let introduction_node_id = resolve_introduction_node ( bob, & path) ;
404
404
assert_eq ! ( introduction_node_id, alice_id) ;
405
- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
405
+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
406
406
}
407
407
}
408
408
@@ -428,7 +428,7 @@ fn creates_long_lived_offer() {
428
428
assert_eq ! ( offer. absolute_expiry( ) , Some ( absolute_expiry) ) ;
429
429
assert ! ( !offer. paths( ) . is_empty( ) ) ;
430
430
for path in offer. paths ( ) {
431
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
431
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
432
432
}
433
433
434
434
let offer = alice. node
@@ -437,7 +437,7 @@ fn creates_long_lived_offer() {
437
437
assert_eq ! ( offer. absolute_expiry( ) , None ) ;
438
438
assert ! ( !offer. paths( ) . is_empty( ) ) ;
439
439
for path in offer. paths ( ) {
440
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
440
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
441
441
}
442
442
}
443
443
@@ -466,7 +466,7 @@ fn creates_short_lived_refund() {
466
466
for path in refund. paths ( ) {
467
467
let introduction_node_id = resolve_introduction_node ( alice, & path) ;
468
468
assert_eq ! ( introduction_node_id, bob_id) ;
469
- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
469
+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
470
470
}
471
471
}
472
472
@@ -493,7 +493,7 @@ fn creates_long_lived_refund() {
493
493
assert_eq ! ( refund. absolute_expiry( ) , Some ( absolute_expiry) ) ;
494
494
assert ! ( !refund. paths( ) . is_empty( ) ) ;
495
495
for path in refund. paths ( ) {
496
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
496
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
497
497
}
498
498
}
499
499
@@ -543,7 +543,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
543
543
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
544
544
assert ! ( !offer. paths( ) . is_empty( ) ) ;
545
545
for path in offer. paths ( ) {
546
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
546
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
547
547
}
548
548
549
549
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -572,7 +572,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
572
572
} ) ;
573
573
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
574
574
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
575
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
575
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
576
576
577
577
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
578
578
charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -644,7 +644,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
644
644
assert_ne ! ( refund. payer_id( ) , david_id) ;
645
645
assert ! ( !refund. paths( ) . is_empty( ) ) ;
646
646
for path in refund. paths ( ) {
647
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
647
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
648
648
}
649
649
expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
650
650
@@ -700,7 +700,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
700
700
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
701
701
assert ! ( !offer. paths( ) . is_empty( ) ) ;
702
702
for path in offer. paths ( ) {
703
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
703
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
704
704
}
705
705
706
706
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -721,7 +721,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
721
721
} ) ;
722
722
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
723
723
assert_ne ! ( invoice_request. payer_id( ) , bob_id) ;
724
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
724
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
725
725
726
726
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
727
727
bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -769,7 +769,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
769
769
assert_ne ! ( refund. payer_id( ) , bob_id) ;
770
770
assert ! ( !refund. paths( ) . is_empty( ) ) ;
771
771
for path in refund. paths ( ) {
772
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
772
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
773
773
}
774
774
expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
775
775
@@ -944,7 +944,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
944
944
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
945
945
assert ! ( !offer. paths( ) . is_empty( ) ) ;
946
946
for path in offer. paths ( ) {
947
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
947
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
948
948
}
949
949
950
950
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -963,7 +963,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
963
963
alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
964
964
965
965
let ( _, reply_path) = extract_invoice_request ( alice, & onion_message) ;
966
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
966
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
967
967
968
968
// Send, extract and verify the second Invoice Request message
969
969
let onion_message = david. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
@@ -973,7 +973,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
973
973
alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
974
974
975
975
let ( _, reply_path) = extract_invoice_request ( alice, & onion_message) ;
976
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
976
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
977
977
}
978
978
979
979
/// This test checks that when multiple potential introduction nodes are available for the payee,
@@ -1028,7 +1028,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1028
1028
. build ( ) . unwrap ( ) ;
1029
1029
assert_ne ! ( refund. payer_id( ) , alice_id) ;
1030
1030
for path in refund. paths ( ) {
1031
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1031
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1032
1032
}
1033
1033
expect_recent_payment ! ( alice, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1034
1034
@@ -1044,7 +1044,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1044
1044
let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
1045
1045
1046
1046
let ( _, reply_path) = extract_invoice ( alice, & onion_message) ;
1047
- assert_eq ! ( reply_path. unwrap( ) . 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1047
+ assert_eq ! ( reply_path. unwrap( ) . introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1048
1048
1049
1049
// Send, extract and verify the second Invoice Request message
1050
1050
let onion_message = david. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
@@ -1053,7 +1053,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
1053
1053
let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
1054
1054
1055
1055
let ( _, reply_path) = extract_invoice ( alice, & onion_message) ;
1056
- assert_eq ! ( reply_path. unwrap( ) . 0 . introduction_node, IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
1056
+ assert_eq ! ( reply_path. unwrap( ) . introduction_node( ) , & IntroductionNode :: NodeId ( nodes[ 6 ] . node. get_our_node_id( ) ) ) ;
1057
1057
}
1058
1058
1059
1059
/// Checks that a deferred invoice can be paid asynchronously from an Event::InvoiceReceived.
@@ -1165,7 +1165,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
1165
1165
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1166
1166
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1167
1167
for path in offer. paths ( ) {
1168
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1168
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1169
1169
}
1170
1170
1171
1171
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1185,7 +1185,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
1185
1185
} ,
1186
1186
} ) ;
1187
1187
assert_ne ! ( invoice_request. payer_id( ) , bob_id) ;
1188
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
1188
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
1189
1189
1190
1190
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
1191
1191
bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1231,7 +1231,7 @@ fn creates_refund_with_blinded_path_using_unannounced_introduction_node() {
1231
1231
assert_ne ! ( refund. payer_id( ) , bob_id) ;
1232
1232
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1233
1233
for path in refund. paths ( ) {
1234
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( alice_id) ) ;
1234
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( alice_id) ) ;
1235
1235
}
1236
1236
expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1237
1237
@@ -1295,7 +1295,7 @@ fn fails_authentication_when_handling_invoice_request() {
1295
1295
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1296
1296
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1297
1297
for path in offer. paths ( ) {
1298
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1298
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1299
1299
}
1300
1300
1301
1301
let invalid_path = alice. node
@@ -1304,7 +1304,7 @@ fn fails_authentication_when_handling_invoice_request() {
1304
1304
. build ( ) . unwrap ( )
1305
1305
. paths ( ) . first ( ) . unwrap ( )
1306
1306
. clone ( ) ;
1307
- assert_eq ! ( invalid_path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1307
+ assert_eq ! ( invalid_path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1308
1308
1309
1309
// Send the invoice request directly to Alice instead of using a blinded path.
1310
1310
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1328,7 +1328,7 @@ fn fails_authentication_when_handling_invoice_request() {
1328
1328
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1329
1329
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1330
1330
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1331
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1331
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1332
1332
1333
1333
assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
1334
1334
@@ -1361,7 +1361,7 @@ fn fails_authentication_when_handling_invoice_request() {
1361
1361
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1362
1362
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1363
1363
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1364
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1364
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1365
1365
1366
1366
assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
1367
1367
}
@@ -1412,7 +1412,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
1412
1412
assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
1413
1413
assert ! ( !offer. paths( ) . is_empty( ) ) ;
1414
1414
for path in offer. paths ( ) {
1415
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1415
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
1416
1416
}
1417
1417
1418
1418
// Initiate an invoice request, but abandon tracking it.
@@ -1466,7 +1466,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
1466
1466
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
1467
1467
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
1468
1468
assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
1469
- assert_eq ! ( reply_path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1469
+ assert_eq ! ( reply_path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1470
1470
1471
1471
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
1472
1472
charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1523,7 +1523,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
1523
1523
assert_ne ! ( refund. payer_id( ) , david_id) ;
1524
1524
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1525
1525
for path in refund. paths ( ) {
1526
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1526
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1527
1527
}
1528
1528
expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
1529
1529
@@ -1560,7 +1560,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
1560
1560
assert_ne ! ( refund. payer_id( ) , david_id) ;
1561
1561
assert ! ( !refund. paths( ) . is_empty( ) ) ;
1562
1562
for path in refund. paths ( ) {
1563
- assert_eq ! ( path. 0 . introduction_node, IntroductionNode :: NodeId ( charlie_id) ) ;
1563
+ assert_eq ! ( path. introduction_node( ) , & IntroductionNode :: NodeId ( charlie_id) ) ;
1564
1564
}
1565
1565
1566
1566
let expected_invoice = alice. node . request_refund_payment ( & refund) . unwrap ( ) ;
0 commit comments