42
42
43
43
use bitcoin:: network:: constants:: Network ;
44
44
use core:: time:: Duration ;
45
- use crate :: blinded_path:: BlindedPath ;
45
+ use crate :: blinded_path:: { BlindedPath , IntroductionNode } ;
46
46
use crate :: events:: { Event , MessageSendEventsProvider , PaymentPurpose } ;
47
47
use crate :: ln:: channelmanager:: { PaymentId , RecentPaymentDetails , Retry , self } ;
48
48
use crate :: ln:: functional_test_utils:: * ;
@@ -260,8 +260,8 @@ fn prefers_non_tor_nodes_in_blinded_paths() {
260
260
assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
261
261
assert ! ( !offer. paths( ) . is_empty( ) ) ;
262
262
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) ) ;
265
265
}
266
266
267
267
// 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() {
275
275
assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
276
276
assert ! ( !offer. paths( ) . is_empty( ) ) ;
277
277
for path in offer. paths ( ) {
278
- assert_eq ! ( path. introduction_node_id , bob_id) ;
278
+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
279
279
}
280
280
}
281
281
@@ -325,7 +325,7 @@ fn prefers_more_connected_nodes_in_blinded_paths() {
325
325
assert_ne ! ( offer. signing_pubkey( ) , bob_id) ;
326
326
assert ! ( !offer. paths( ) . is_empty( ) ) ;
327
327
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( ) ) ) ;
329
329
}
330
330
}
331
331
@@ -374,7 +374,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
374
374
assert_ne ! ( offer. signing_pubkey( ) , alice_id) ;
375
375
assert ! ( !offer. paths( ) . is_empty( ) ) ;
376
376
for path in offer. paths ( ) {
377
- assert_eq ! ( path. introduction_node_id , bob_id) ;
377
+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
378
378
}
379
379
380
380
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -395,7 +395,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
395
395
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
396
396
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
397
397
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) ) ;
399
399
400
400
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( charlie_id) . unwrap ( ) ;
401
401
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() {
408
408
assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
409
409
assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
410
410
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) ) ;
412
412
}
413
413
414
414
route_bolt12_payment ( david, & [ charlie, bob, alice] , & invoice) ;
@@ -469,7 +469,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
469
469
assert_ne ! ( refund. payer_id( ) , david_id) ;
470
470
assert ! ( !refund. paths( ) . is_empty( ) ) ;
471
471
for path in refund. paths ( ) {
472
- assert_eq ! ( path. introduction_node_id , charlie_id) ;
472
+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( charlie_id) ) ;
473
473
}
474
474
expect_recent_payment ! ( david, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
475
475
@@ -488,7 +488,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
488
488
assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
489
489
assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
490
490
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) ) ;
492
492
}
493
493
494
494
route_bolt12_payment ( david, & [ charlie, bob, alice] , & invoice) ;
@@ -522,7 +522,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
522
522
assert_ne ! ( offer. signing_pubkey( ) , alice_id) ;
523
523
assert ! ( !offer. paths( ) . is_empty( ) ) ;
524
524
for path in offer. paths ( ) {
525
- assert_eq ! ( path. introduction_node_id , alice_id) ;
525
+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( alice_id) ) ;
526
526
}
527
527
528
528
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
@@ -535,7 +535,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
535
535
let ( invoice_request, reply_path) = extract_invoice_request ( alice, & onion_message) ;
536
536
assert_eq ! ( invoice_request. amount_msats( ) , None ) ;
537
537
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) ) ;
539
539
540
540
let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
541
541
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() {
545
545
assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
546
546
assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
547
547
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) ) ;
549
549
}
550
550
551
551
route_bolt12_payment ( bob, & [ alice] , & invoice) ;
@@ -585,7 +585,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
585
585
assert_ne ! ( refund. payer_id( ) , bob_id) ;
586
586
assert ! ( !refund. paths( ) . is_empty( ) ) ;
587
587
for path in refund. paths ( ) {
588
- assert_eq ! ( path. introduction_node_id , bob_id) ;
588
+ assert_eq ! ( path. introduction_node , IntroductionNode :: NodeId ( bob_id) ) ;
589
589
}
590
590
expect_recent_payment ! ( bob, RecentPaymentDetails :: AwaitingInvoice , payment_id) ;
591
591
@@ -599,7 +599,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
599
599
assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
600
600
assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
601
601
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) ) ;
603
603
}
604
604
605
605
route_bolt12_payment ( bob, & [ alice] , & invoice) ;
0 commit comments