@@ -358,7 +358,7 @@ fn one_blinded_hop() {
358
358
let test_msg = TestCustomMessage :: Pong ;
359
359
360
360
let secp_ctx = Secp256k1 :: new ( ) ;
361
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id ] , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
361
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id ] , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
362
362
let destination = Destination :: BlindedPath ( blinded_path) ;
363
363
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
364
364
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -371,7 +371,7 @@ fn two_unblinded_two_blinded() {
371
371
let test_msg = TestCustomMessage :: Pong ;
372
372
373
373
let secp_ctx = Secp256k1 :: new ( ) ;
374
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 3 ] . node_id , nodes[ 4 ] . node_id ] , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
374
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 3 ] . node_id , nodes[ 4 ] . node_id ] , None , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
375
375
let path = OnionMessagePath {
376
376
intermediate_nodes : vec ! [ nodes[ 1 ] . node_id, nodes[ 2 ] . node_id] ,
377
377
destination : Destination :: BlindedPath ( blinded_path) ,
@@ -389,7 +389,7 @@ fn three_blinded_hops() {
389
389
let test_msg = TestCustomMessage :: Pong ;
390
390
391
391
let secp_ctx = Secp256k1 :: new ( ) ;
392
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id , nodes[ 3 ] . node_id ] , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
392
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id , nodes[ 3 ] . node_id ] , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
393
393
let destination = Destination :: BlindedPath ( blinded_path) ;
394
394
395
395
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
@@ -412,7 +412,7 @@ fn async_response_over_one_blinded_hop() {
412
412
413
413
// 3. Simulate the creation of a Blinded Reply path provided by Bob.
414
414
let secp_ctx = Secp256k1 :: new ( ) ;
415
- let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id ] , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
415
+ let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id ] , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
416
416
417
417
// 4. Create a responder using the reply path for Alice.
418
418
let responder = Some ( Responder :: new ( reply_path, path_id) ) ;
@@ -448,7 +448,9 @@ fn async_response_with_reply_path_succeeds() {
448
448
// Alice receives a message from Bob with an added reply_path for responding back.
449
449
let message = TestCustomMessage :: Ping ;
450
450
let path_id = Some ( [ 2 ; 32 ] ) ;
451
- let reply_path = BlindedPath :: new_for_message ( & [ bob. node_id ] , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
451
+
452
+ let secp_ctx = Secp256k1 :: new ( ) ;
453
+ let reply_path = BlindedPath :: new_for_message ( & [ bob. node_id ] , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
452
454
453
455
// Alice asynchronously responds to Bob, expecting a response back from him.
454
456
let responder = Responder :: new ( reply_path, path_id) ;
@@ -485,7 +487,7 @@ fn async_response_with_reply_path_fails() {
485
487
// Alice receives a message from Bob with an added reply_path for responding back.
486
488
let message = TestCustomMessage :: Ping ;
487
489
let path_id = Some ( [ 2 ; 32 ] ) ;
488
- let reply_path = BlindedPath :: new_for_message ( & [ bob. node_id ] , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
490
+ let reply_path = BlindedPath :: new_for_message ( & [ bob. node_id ] , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
489
491
490
492
// Alice tries to asynchronously respond to Bob, but fails because the nodes are unannounced.
491
493
// Therefore, the reply_path cannot be used for the response.
@@ -524,15 +526,15 @@ fn we_are_intro_node() {
524
526
let test_msg = TestCustomMessage :: Pong ;
525
527
526
528
let secp_ctx = Secp256k1 :: new ( ) ;
527
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 0 ] . node_id , nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
529
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 0 ] . node_id , nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
528
530
let destination = Destination :: BlindedPath ( blinded_path) ;
529
531
530
532
nodes[ 0 ] . messenger . send_onion_message ( test_msg. clone ( ) , destination, None ) . unwrap ( ) ;
531
533
nodes[ 2 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
532
534
pass_along_path ( & nodes) ;
533
535
534
536
// Try with a two-hop blinded path where we are the introduction node.
535
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 0 ] . node_id , nodes[ 1 ] . node_id ] , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
537
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 0 ] . node_id , nodes[ 1 ] . node_id ] , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
536
538
let destination = Destination :: BlindedPath ( blinded_path) ;
537
539
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
538
540
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -547,7 +549,7 @@ fn invalid_blinded_path_error() {
547
549
let test_msg = TestCustomMessage :: Pong ;
548
550
549
551
let secp_ctx = Secp256k1 :: new ( ) ;
550
- let mut blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
552
+ let mut blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
551
553
blinded_path. blinded_hops . clear ( ) ;
552
554
let destination = Destination :: BlindedPath ( blinded_path) ;
553
555
let err = nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap_err ( ) ;
@@ -566,7 +568,7 @@ fn reply_path() {
566
568
destination : Destination :: Node ( nodes[ 3 ] . node_id ) ,
567
569
first_node_addresses : None ,
568
570
} ;
569
- let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id , nodes[ 1 ] . node_id , nodes[ 0 ] . node_id ] , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
571
+ let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id , nodes[ 1 ] . node_id , nodes[ 0 ] . node_id ] , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
570
572
nodes[ 0 ] . messenger . send_onion_message_using_path ( path, test_msg. clone ( ) , Some ( reply_path) ) . unwrap ( ) ;
571
573
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
572
574
pass_along_path ( & nodes) ;
@@ -576,9 +578,9 @@ fn reply_path() {
576
578
pass_along_path ( & nodes) ;
577
579
578
580
// Destination::BlindedPath
579
- let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id , nodes[ 3 ] . node_id ] , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
581
+ let blinded_path = BlindedPath :: new_for_message ( & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id , nodes[ 3 ] . node_id ] , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
580
582
let destination = Destination :: BlindedPath ( blinded_path) ;
581
- let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id , nodes[ 1 ] . node_id , nodes[ 0 ] . node_id ] , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
583
+ let reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id , nodes[ 1 ] . node_id , nodes[ 0 ] . node_id ] , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
582
584
583
585
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, Some ( reply_path) ) . unwrap ( ) ;
584
586
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
@@ -659,7 +661,7 @@ fn requests_peer_connection_for_buffered_messages() {
659
661
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
660
662
661
663
let blinded_path = BlindedPath :: new_for_message (
662
- & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , & * nodes[ 0 ] . entropy_source , & secp_ctx
664
+ & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
663
665
) . unwrap ( ) ;
664
666
let destination = Destination :: BlindedPath ( blinded_path) ;
665
667
@@ -696,7 +698,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
696
698
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
697
699
698
700
let blinded_path = BlindedPath :: new_for_message (
699
- & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , & * nodes[ 0 ] . entropy_source , & secp_ctx
701
+ & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
700
702
) . unwrap ( ) ;
701
703
let destination = Destination :: BlindedPath ( blinded_path) ;
702
704
@@ -745,7 +747,7 @@ fn intercept_offline_peer_oms() {
745
747
let message = TestCustomMessage :: Pong ;
746
748
let secp_ctx = Secp256k1 :: new ( ) ;
747
749
let blinded_path = BlindedPath :: new_for_message (
748
- & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , & * nodes[ 2 ] . entropy_source , & secp_ctx
750
+ & [ nodes[ 1 ] . node_id , nodes[ 2 ] . node_id ] , None , & * nodes[ 2 ] . entropy_source , & secp_ctx
749
751
) . unwrap ( ) ;
750
752
let destination = Destination :: BlindedPath ( blinded_path) ;
751
753
0 commit comments