@@ -402,7 +402,7 @@ fn creates_short_lived_offer() {
402402 for path in offer. paths ( ) {
403403 let introduction_node_id = resolve_introduction_node ( bob, & path) ;
404404 assert_eq ! ( introduction_node_id, alice_id) ;
405- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
405+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
406406 }
407407}
408408
@@ -428,7 +428,7 @@ fn creates_long_lived_offer() {
428428 assert_eq ! ( offer. absolute_expiry( ) , Some ( absolute_expiry) ) ;
429429 assert ! ( !offer. paths( ) . is_empty( ) ) ;
430430 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) ) ;
432432 }
433433
434434 let offer = alice. node
@@ -437,7 +437,7 @@ fn creates_long_lived_offer() {
437437 assert_eq ! ( offer. absolute_expiry( ) , None ) ;
438438 assert ! ( !offer. paths( ) . is_empty( ) ) ;
439439 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) ) ;
441441 }
442442}
443443
@@ -466,7 +466,7 @@ fn creates_short_lived_refund() {
466466 for path in refund. paths ( ) {
467467 let introduction_node_id = resolve_introduction_node ( alice, & path) ;
468468 assert_eq ! ( introduction_node_id, bob_id) ;
469- assert ! ( matches!( path. 0 . introduction_node, IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
469+ assert ! ( matches!( path. introduction_node( ) , & IntroductionNode :: DirectedShortChannelId ( ..) ) ) ;
470470 }
471471}
472472
@@ -493,7 +493,7 @@ fn creates_long_lived_refund() {
493493 assert_eq ! ( refund. absolute_expiry( ) , Some ( absolute_expiry) ) ;
494494 assert ! ( !refund. paths( ) . is_empty( ) ) ;
495495 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) ) ;
497497 }
498498}
499499
@@ -543,7 +543,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
543543 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
544544 assert ! ( !offer. paths( ) . is_empty( ) ) ;
545545 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) ) ;
547547 }
548548
549549 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -572,7 +572,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
572572 } ) ;
573573 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
574574 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) ) ;
576576
577577 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
578578 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() {
644644 assert_ne ! ( refund. payer_id( ) , david_id) ;
645645 assert ! ( !refund. paths( ) . is_empty( ) ) ;
646646 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) ) ;
648648 }
649649 expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
650650
@@ -700,7 +700,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
700700 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
701701 assert ! ( !offer. paths( ) . is_empty( ) ) ;
702702 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) ) ;
704704 }
705705
706706 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -721,7 +721,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
721721 } ) ;
722722 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
723723 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) ) ;
725725
726726 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
727727 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() {
769769 assert_ne ! ( refund. payer_id( ) , bob_id) ;
770770 assert ! ( !refund. paths( ) . is_empty( ) ) ;
771771 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) ) ;
773773 }
774774 expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
775775
@@ -944,7 +944,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
944944 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
945945 assert ! ( !offer. paths( ) . is_empty( ) ) ;
946946 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) ) ;
948948 }
949949
950950 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -963,7 +963,7 @@ fn send_invoice_requests_with_distinct_reply_path() {
963963 alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
964964
965965 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) ) ;
967967
968968 // Send, extract and verify the second Invoice Request message
969969 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() {
973973 alice. onion_messenger . handle_onion_message ( & bob_id, & onion_message) ;
974974
975975 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( ) ) ) ;
977977}
978978
979979/// 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() {
10281028 . build ( ) . unwrap ( ) ;
10291029 assert_ne ! ( refund. payer_id( ) , alice_id) ;
10301030 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) ) ;
10321032 }
10331033 expect_recent_payment ! ( alice, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
10341034
@@ -1044,7 +1044,7 @@ fn send_invoice_for_refund_with_distinct_reply_path() {
10441044 let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
10451045
10461046 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) ) ;
10481048
10491049 // Send, extract and verify the second Invoice Request message
10501050 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() {
10531053 let onion_message = bob. onion_messenger . next_onion_message_for_peer ( alice_id) . unwrap ( ) ;
10541054
10551055 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( ) ) ) ;
10571057}
10581058
10591059/// 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() {
11651165 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
11661166 assert ! ( !offer. paths( ) . is_empty( ) ) ;
11671167 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) ) ;
11691169 }
11701170
11711171 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1185,7 +1185,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
11851185 } ,
11861186 } ) ;
11871187 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) ) ;
11891189
11901190 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
11911191 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1231,7 +1231,7 @@ fn creates_refund_with_blinded_path_using_unannounced_introduction_node() {
12311231 assert_ne ! ( refund. payer_id( ) , bob_id) ;
12321232 assert ! ( !refund. paths( ) . is_empty( ) ) ;
12331233 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) ) ;
12351235 }
12361236 expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
12371237
@@ -1295,7 +1295,7 @@ fn fails_authentication_when_handling_invoice_request() {
12951295 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
12961296 assert ! ( !offer. paths( ) . is_empty( ) ) ;
12971297 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) ) ;
12991299 }
13001300
13011301 let invalid_path = alice. node
@@ -1304,7 +1304,7 @@ fn fails_authentication_when_handling_invoice_request() {
13041304 . build ( ) . unwrap ( )
13051305 . paths ( ) . first ( ) . unwrap ( )
13061306 . clone ( ) ;
1307- assert_eq ! ( invalid_path. 0 . introduction_node, IntroductionNode :: NodeId ( bob_id) ) ;
1307+ assert_eq ! ( invalid_path. introduction_node( ) , & IntroductionNode :: NodeId ( bob_id) ) ;
13081308
13091309 // Send the invoice request directly to Alice instead of using a blinded path.
13101310 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -1328,7 +1328,7 @@ fn fails_authentication_when_handling_invoice_request() {
13281328 let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
13291329 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
13301330 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) ) ;
13321332
13331333 assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
13341334
@@ -1361,7 +1361,7 @@ fn fails_authentication_when_handling_invoice_request() {
13611361 let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
13621362 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
13631363 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) ) ;
13651365
13661366 assert_eq ! ( alice. onion_messenger. next_onion_message_for_peer( charlie_id) , None ) ;
13671367}
@@ -1412,7 +1412,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
14121412 assert_ne ! ( offer. signing_pubkey( ) , Some ( alice_id) ) ;
14131413 assert ! ( !offer. paths( ) . is_empty( ) ) ;
14141414 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) ) ;
14161416 }
14171417
14181418 // Initiate an invoice request, but abandon tracking it.
@@ -1466,7 +1466,7 @@ fn fails_authentication_when_handling_invoice_for_offer() {
14661466 let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
14671467 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
14681468 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) ) ;
14701470
14711471 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
14721472 charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -1523,7 +1523,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
15231523 assert_ne ! ( refund. payer_id( ) , david_id) ;
15241524 assert ! ( !refund. paths( ) . is_empty( ) ) ;
15251525 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) ) ;
15271527 }
15281528 expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
15291529
@@ -1560,7 +1560,7 @@ fn fails_authentication_when_handling_invoice_for_refund() {
15601560 assert_ne ! ( refund. payer_id( ) , david_id) ;
15611561 assert ! ( !refund. paths( ) . is_empty( ) ) ;
15621562 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) ) ;
15641564 }
15651565
15661566 let expected_invoice = alice. node . request_refund_payment ( & refund) . unwrap ( ) ;
0 commit comments