4242
4343use bitcoin:: network:: constants:: Network ;
4444use core:: time:: Duration ;
45- use crate :: blinded_path:: BlindedPath ;
45+ use crate :: blinded_path:: { BlindedPath , IntroductionNode } ;
4646use crate :: events:: { Event , MessageSendEventsProvider , PaymentPurpose } ;
4747use crate :: ln:: channelmanager:: { PaymentId , RecentPaymentDetails , Retry , self } ;
4848use crate :: ln:: functional_test_utils:: * ;
@@ -260,8 +260,8 @@ fn prefers_non_tor_nodes_in_blinded_paths() {
260260 assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
261261 assert ! ( !offer. paths( ) . is_empty( ) ) ;
262262 for path in offer. paths ( ) {
263- assert_ne ! ( path. introduction_node_id , bob_id) ;
264- assert_ne ! ( path. introduction_node_id , charlie_id) ;
263+ assert_ne ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
264+ assert_ne ! ( path. introduction_node , IntroductionNode :: NodeId ( charlie_id) ) ;
265265 }
266266
267267 // Use a one-hop blinded path when Bob is announced and all his peers are Tor-only.
@@ -275,7 +275,7 @@ fn prefers_non_tor_nodes_in_blinded_paths() {
275275 assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
276276 assert ! ( !offer. paths( ) . is_empty( ) ) ;
277277 for path in offer. paths ( ) {
278- assert_eq ! ( path. introduction_node_id , bob_id) ;
278+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
279279 }
280280}
281281
@@ -325,7 +325,7 @@ fn prefers_more_connected_nodes_in_blinded_paths() {
325325 assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
326326 assert ! ( !offer. paths( ) . is_empty( ) ) ;
327327 for path in offer. paths ( ) {
328- assert_eq ! ( path. introduction_node_id , nodes[ 4 ] . node. get_our_node_id( ) ) ;
328+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( nodes[ 4 ] . node. get_our_node_id( ) ) ) ;
329329 }
330330}
331331
@@ -374,7 +374,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
374374 assert_ne ! ( offer. signing_pubkey( ) , alice_id) ;
375375 assert ! ( !offer. paths( ) . is_empty( ) ) ;
376376 for path in offer. paths ( ) {
377- assert_eq ! ( path. introduction_node_id , bob_id) ;
377+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
378378 }
379379
380380 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -395,7 +395,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
395395 let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
396396 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
397397 assert_ne ! ( invoice_request. payer_id( ) , david_id) ;
398- assert_eq ! ( reply_path. unwrap( ) . introduction_node_id , charlie_id) ;
398+ assert_eq ! ( reply_path. unwrap( ) . introduction_node , IntroductionNode :: NodeId ( charlie_id) ) ;
399399
400400 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
401401 charlie. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -408,7 +408,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
408408 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
409409 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
410410 for ( _, path) in invoice. payment_paths ( ) {
411- assert_eq ! ( path. introduction_node_id , bob_id) ;
411+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
412412 }
413413
414414 route_bolt12_payment ( david, & [ charlie, bob, alice] , & invoice) ;
@@ -469,7 +469,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
469469 assert_ne ! ( refund. payer_id( ) , david_id) ;
470470 assert ! ( !refund. paths( ) . is_empty( ) ) ;
471471 for path in refund. paths ( ) {
472- assert_eq ! ( path. introduction_node_id , charlie_id) ;
472+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( charlie_id) ) ;
473473 }
474474 expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
475475
@@ -488,7 +488,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
488488 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
489489 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
490490 for ( _, path) in invoice. payment_paths ( ) {
491- assert_eq ! ( path. introduction_node_id , bob_id) ;
491+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
492492 }
493493
494494 route_bolt12_payment ( david, & [ charlie, bob, alice] , & invoice) ;
@@ -522,7 +522,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
522522 assert_ne ! ( offer. signing_pubkey( ) , alice_id) ;
523523 assert ! ( !offer. paths( ) . is_empty( ) ) ;
524524 for path in offer. paths ( ) {
525- assert_eq ! ( path. introduction_node_id , alice_id) ;
525+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( alice_id) ) ;
526526 }
527527
528528 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -535,7 +535,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
535535 let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
536536 assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
537537 assert_ne ! ( invoice_request. payer_id( ) , bob_id) ;
538- assert_eq ! ( reply_path. unwrap( ) . introduction_node_id , bob_id) ;
538+ assert_eq ! ( reply_path. unwrap( ) . introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
539539
540540 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
541541 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
@@ -545,7 +545,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
545545 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
546546 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
547547 for ( _, path) in invoice. payment_paths ( ) {
548- assert_eq ! ( path. introduction_node_id , alice_id) ;
548+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( alice_id) ) ;
549549 }
550550
551551 route_bolt12_payment ( bob, & [ alice] , & invoice) ;
@@ -585,7 +585,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
585585 assert_ne ! ( refund. payer_id( ) , bob_id) ;
586586 assert ! ( !refund. paths( ) . is_empty( ) ) ;
587587 for path in refund. paths ( ) {
588- assert_eq ! ( path. introduction_node_id , bob_id) ;
588+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
589589 }
590590 expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
591591
@@ -599,7 +599,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
599599 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
600600 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
601601 for ( _, path) in invoice. payment_paths ( ) {
602- assert_eq ! ( path. introduction_node_id , alice_id) ;
602+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( alice_id) ) ;
603603 }
604604
605605 route_bolt12_payment ( bob, & [ alice] , & invoice) ;
0 commit comments