@@ -372,7 +372,7 @@ fn one_blinded_hop() {
372
372
let test_msg = TestCustomMessage :: Pong ;
373
373
374
374
let secp_ctx = Secp256k1 :: new ( ) ;
375
- let blinded_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
375
+ let blinded_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
376
376
let destination = Destination :: BlindedPath ( blinded_path) ;
377
377
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
378
378
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -386,7 +386,7 @@ fn two_unblinded_two_blinded() {
386
386
387
387
let secp_ctx = Secp256k1 :: new ( ) ;
388
388
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
389
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 4 ] . node_id , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
389
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 4 ] . node_id , None , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
390
390
let path = OnionMessagePath {
391
391
intermediate_nodes : vec ! [ nodes[ 1 ] . node_id, nodes[ 2 ] . node_id] ,
392
392
destination : Destination :: BlindedPath ( blinded_path) ,
@@ -408,7 +408,7 @@ fn three_blinded_hops() {
408
408
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
409
409
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
410
410
] ;
411
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
411
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
412
412
let destination = Destination :: BlindedPath ( blinded_path) ;
413
413
414
414
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
@@ -430,7 +430,7 @@ fn async_response_over_one_blinded_hop() {
430
430
431
431
// 3. Simulate the creation of a Blinded Reply path provided by Bob.
432
432
let secp_ctx = Secp256k1 :: new ( ) ;
433
- let reply_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
433
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
434
434
435
435
// 4. Create a responder using the reply path for Alice.
436
436
let responder = Some ( Responder :: new ( reply_path) ) ;
@@ -465,7 +465,7 @@ fn async_response_with_reply_path_succeeds() {
465
465
466
466
// Alice receives a message from Bob with an added reply_path for responding back.
467
467
let message = TestCustomMessage :: Ping ;
468
- let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
468
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
469
469
470
470
// Alice asynchronously responds to Bob, expecting a response back from him.
471
471
let responder = Responder :: new ( reply_path) ;
@@ -501,7 +501,7 @@ fn async_response_with_reply_path_fails() {
501
501
502
502
// Alice receives a message from Bob with an added reply_path for responding back.
503
503
let message = TestCustomMessage :: Ping ;
504
- let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
504
+ let reply_path = BlindedPath :: new_for_message ( & [ ] , bob. node_id , None , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
505
505
506
506
// Alice tries to asynchronously respond to Bob, but fails because the nodes are unannounced and
507
507
// disconnected. Thus, a reply path could no be created for the response.
@@ -545,7 +545,7 @@ fn we_are_intro_node() {
545
545
ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
546
546
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
547
547
] ;
548
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
548
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
549
549
let destination = Destination :: BlindedPath ( blinded_path) ;
550
550
551
551
nodes[ 0 ] . messenger . send_onion_message ( test_msg. clone ( ) , destination, None ) . unwrap ( ) ;
@@ -554,7 +554,7 @@ fn we_are_intro_node() {
554
554
555
555
// Try with a two-hop blinded path where we are the introduction node.
556
556
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
557
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 1 ] . node_id , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
557
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 1 ] . node_id , None , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
558
558
let destination = Destination :: BlindedPath ( blinded_path) ;
559
559
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap ( ) ;
560
560
nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
@@ -570,7 +570,7 @@ fn invalid_blinded_path_error() {
570
570
571
571
let secp_ctx = Secp256k1 :: new ( ) ;
572
572
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
573
- let mut blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
573
+ let mut blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
574
574
blinded_path. blinded_hops . clear ( ) ;
575
575
let destination = Destination :: BlindedPath ( blinded_path) ;
576
576
let err = nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, None ) . unwrap_err ( ) ;
@@ -593,7 +593,7 @@ fn reply_path() {
593
593
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
594
594
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
595
595
] ;
596
- let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
596
+ let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
597
597
nodes[ 0 ] . messenger . send_onion_message_using_path ( path, test_msg. clone ( ) , Some ( reply_path) ) . unwrap ( ) ;
598
598
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
599
599
pass_along_path ( & nodes) ;
@@ -607,13 +607,13 @@ fn reply_path() {
607
607
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
608
608
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
609
609
] ;
610
- let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
610
+ let blinded_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 3 ] . node_id , None , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
611
611
let destination = Destination :: BlindedPath ( blinded_path) ;
612
612
let intermediate_nodes = [
613
613
ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
614
614
ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
615
615
] ;
616
- let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
616
+ let reply_path = BlindedPath :: new_for_message ( & intermediate_nodes, nodes[ 0 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
617
617
618
618
nodes[ 0 ] . messenger . send_onion_message ( test_msg, destination, Some ( reply_path) ) . unwrap ( ) ;
619
619
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
@@ -695,7 +695,7 @@ fn requests_peer_connection_for_buffered_messages() {
695
695
696
696
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
697
697
let blinded_path = BlindedPath :: new_for_message (
698
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx
698
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
699
699
) . unwrap ( ) ;
700
700
let destination = Destination :: BlindedPath ( blinded_path) ;
701
701
@@ -733,7 +733,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
733
733
734
734
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
735
735
let blinded_path = BlindedPath :: new_for_message (
736
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 0 ] . entropy_source , & secp_ctx
736
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 0 ] . entropy_source , & secp_ctx
737
737
) . unwrap ( ) ;
738
738
let destination = Destination :: BlindedPath ( blinded_path) ;
739
739
@@ -783,7 +783,7 @@ fn intercept_offline_peer_oms() {
783
783
let secp_ctx = Secp256k1 :: new ( ) ;
784
784
let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
785
785
let blinded_path = BlindedPath :: new_for_message (
786
- & intermediate_nodes, nodes[ 2 ] . node_id , & * nodes[ 2 ] . entropy_source , & secp_ctx
786
+ & intermediate_nodes, nodes[ 2 ] . node_id , None , & * nodes[ 2 ] . entropy_source , & secp_ctx
787
787
) . unwrap ( ) ;
788
788
let destination = Destination :: BlindedPath ( blinded_path) ;
789
789
0 commit comments