@@ -359,7 +359,7 @@ fn one_blinded_hop() {
359
359
let test_msg = TestCustomMessage :: Pong ;
360
360
361
361
let secp_ctx = Secp256k1 :: new ( ) ;
362
- let blinded_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
362
+ let blinded_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
363
363
let destination = Destination :: BlindedPath ( blinded_path) ;
364
364
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
365
365
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -373,7 +373,7 @@ fn two_unblinded_two_blinded() {
373
373
374
374
let secp_ctx = Secp256k1 :: new ( ) ;
375
375
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
376
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 4 ] . node_id , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
376
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 4 ] . node_id , None , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
377
377
let path = OnionMessagePath {
378
378
intermediate_nodes : vec ! [ nodes[ 1 ] . node_id, nodes[ 2 ] . node_id] ,
379
379
destination : Destination :: BlindedPath ( blinded_path) ,
@@ -395,7 +395,7 @@ fn three_blinded_hops() {
395
395
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
396
396
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
397
397
] ;
398
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
398
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
399
399
let destination = Destination :: BlindedPath ( blinded_path) ;
400
400
401
401
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
@@ -418,7 +418,7 @@ fn async_response_over_one_blinded_hop() {
418
418
419
419
// 3. Simulate the creation of a Blinded Reply path provided by Bob.
420
420
let secp_ctx = Secp256k1 :: new ( ) ;
421
- let reply_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
421
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
422
422
423
423
// 4. Create a responder using the reply path for Alice.
424
424
let responder = Some ( Responder :: new ( reply_path, path_id) ) ;
@@ -454,7 +454,7 @@ fn async_response_with_reply_path_succeeds() {
454
454
// Alice receives a message from Bob with an added reply_path for responding back.
455
455
let message = TestCustomMessage :: Ping ;
456
456
let path_id = Some ( [ 2 ; 32 ] ) ;
457
- let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
457
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
458
458
459
459
// Alice asynchronously responds to Bob, expecting a response back from him.
460
460
let responder = Responder :: new ( reply_path, path_id) ;
@@ -491,7 +491,7 @@ fn async_response_with_reply_path_fails() {
491
491
// Alice receives a message from Bob with an added reply_path for responding back.
492
492
let message = TestCustomMessage :: Ping ;
493
493
let path_id = Some ( [ 2 ; 32 ] ) ;
494
- let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
494
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
495
495
496
496
// Alice tries to asynchronously respond to Bob, but fails because the nodes are unannounced.
497
497
// Therefore, the reply_path cannot be used for the response.
@@ -534,7 +534,7 @@ fn we_are_intro_node() {
534
534
ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
535
535
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
536
536
] ;
537
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
537
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
538
538
let destination = Destination :: BlindedPath ( blinded_path) ;
539
539
540
540
nodes[ 0 ] . messenger . send_onion_message ( test_msg. clone ( ) , destination, None ) . unwrap ( ) ;
@@ -543,7 +543,7 @@ fn we_are_intro_node() {
543
543
544
544
// Try with a two-hop blinded path where we are the introduction node.
545
545
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
546
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
546
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
547
547
let destination = Destination :: BlindedPath ( blinded_path) ;
548
548
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
549
549
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -559,7 +559,7 @@ fn invalid_blinded_path_error() {
559
559
560
560
let secp_ctx = Secp256k1 :: new ( ) ;
561
561
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
562
- let mut blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
562
+ let mut blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
563
563
blinded_path. blinded_hops . clear ( ) ;
564
564
let destination = Destination :: BlindedPath ( blinded_path) ;
565
565
let err = nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap_err ( ) ;
@@ -582,7 +582,7 @@ fn reply_path() {
582
582
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
583
583
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
584
584
] ;
585
- let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
585
+ let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
586
586
nodes[ 0 ] . messenger . send_onion_message_using_path ( path, test_msg. clone ( ) , Some ( reply_path) ) . unwrap ( ) ;
587
587
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
588
588
pass_along_path ( & nodes) ;
@@ -596,13 +596,13 @@ fn reply_path() {
596
596
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
597
597
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
598
598
] ;
599
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
599
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
600
600
let destination = Destination :: BlindedPath ( blinded_path) ;
601
601
let intermediate_nodes = [
602
602
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
603
603
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
604
604
] ;
605
- let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
605
+ let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
606
606
607
607
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, Some ( reply_path) ) . unwrap ( ) ;
608
608
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
@@ -684,7 +684,7 @@ fn requests_peer_connection_for_buffered_messages() {
684
684
685
685
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
686
686
let blinded_path = BlindedPath :: new_for_message (
687
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx
687
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
688
688
) . unwrap ( ) ;
689
689
let destination = Destination :: BlindedPath ( blinded_path) ;
690
690
@@ -722,7 +722,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
722
722
723
723
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
724
724
let blinded_path = BlindedPath :: new_for_message (
725
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx
725
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
726
726
) . unwrap ( ) ;
727
727
let destination = Destination :: BlindedPath ( blinded_path) ;
728
728
@@ -772,7 +772,7 @@ fn intercept_offline_peer_oms() {
772
772
let secp_ctx = Secp256k1 :: new ( ) ;
773
773
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
774
774
let blinded_path = BlindedPath :: new_for_message (
775
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx
775
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx
776
776
) . unwrap ( ) ;
777
777
let destination = Destination :: BlindedPath ( blinded_path) ;
778
778
0 commit comments