@@ -76,7 +76,7 @@ impl Drop for MessengerNode {
76
76
struct TestOffersMessageHandler { }
77
77
78
78
impl OffersMessageHandler for TestOffersMessageHandler {
79
- fn handle_message ( & self , _message : OffersMessage , _context : Option < OffersContext > , _responder : Option < Responder > ) -> Option < ( OffersMessage , ResponseInstruction ) > {
79
+ fn handle_message ( & self , _message : OffersMessage , _context : Option < OffersContext > , _custom_tlvs : Option < Vec < u8 > > , _responder : Option < Responder > ) -> Option < ( OffersMessage , ResponseInstruction ) > {
80
80
None
81
81
}
82
82
}
@@ -204,7 +204,7 @@ impl CustomOnionMessageHandler for TestCustomMessageHandler {
204
204
205
205
match responder {
206
206
Some ( responder) if expectation. include_reply_path => {
207
- Some ( ( response, responder. respond_with_reply_path ( MessageContext :: Custom ( context. unwrap_or_else ( Vec :: new) ) ) ) )
207
+ Some ( ( response, responder. respond_with_reply_path ( MessageContext :: Custom ( context. unwrap_or_else ( Vec :: new) ) , None ) ) )
208
208
} ,
209
209
Some ( responder) => Some ( ( response, responder. respond ( ) ) ) ,
210
210
None => None
@@ -391,7 +391,7 @@ fn one_blinded_hop() {
391
391
392
392
let secp_ctx = Secp256k1 :: new ( ) ;
393
393
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
394
- let blinded_path = BlindedMessagePath :: new ( & [ ] , nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
394
+ let blinded_path = BlindedMessagePath :: new ( & [ ] , nodes[ 1 ] . node_id , context, Vec :: new ( ) , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
395
395
let destination = Destination :: BlindedPath ( blinded_path) ;
396
396
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
397
397
nodes[ 0 ] . messenger . send_onion_message ( test_msg, instructions) . unwrap ( ) ;
@@ -407,7 +407,7 @@ fn two_unblinded_two_blinded() {
407
407
let secp_ctx = Secp256k1 :: new ( ) ;
408
408
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
409
409
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
410
- let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
410
+ let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, Vec :: new ( ) , & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
411
411
let path = OnionMessagePath {
412
412
intermediate_nodes : vec ! [ nodes[ 1 ] . node_id, nodes[ 2 ] . node_id] ,
413
413
destination : Destination :: BlindedPath ( blinded_path) ,
@@ -430,7 +430,7 @@ fn three_blinded_hops() {
430
430
MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
431
431
] ;
432
432
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
433
- let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
433
+ let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, Vec :: new ( ) , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
434
434
let destination = Destination :: BlindedPath ( blinded_path) ;
435
435
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
436
436
@@ -454,7 +454,7 @@ fn async_response_over_one_blinded_hop() {
454
454
// 3. Simulate the creation of a Blinded Reply path provided by Bob.
455
455
let secp_ctx = Secp256k1 :: new ( ) ;
456
456
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
457
- let reply_path = BlindedMessagePath :: new ( & [ ] , nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
457
+ let reply_path = BlindedMessagePath :: new ( & [ ] , nodes[ 1 ] . node_id , context, Vec :: new ( ) , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
458
458
459
459
// 4. Create a responder using the reply path for Alice.
460
460
let responder = Some ( Responder :: new ( reply_path) ) ;
@@ -491,7 +491,7 @@ fn async_response_with_reply_path_succeeds() {
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 context = MessageContext :: Custom ( Vec :: new ( ) ) ;
494
- let reply_path = BlindedMessagePath :: new ( & [ ] , bob. node_id , context, & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
494
+ let reply_path = BlindedMessagePath :: new ( & [ ] , bob. node_id , context, Vec :: new ( ) , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
495
495
496
496
// Alice asynchronously responds to Bob, expecting a response back from him.
497
497
let responder = Responder :: new ( reply_path) ;
@@ -529,7 +529,7 @@ fn async_response_with_reply_path_fails() {
529
529
// Alice receives a message from Bob with an added reply_path for responding back.
530
530
let message = TestCustomMessage :: Ping ;
531
531
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
532
- let reply_path = BlindedMessagePath :: new ( & [ ] , bob. node_id , context, & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
532
+ let reply_path = BlindedMessagePath :: new ( & [ ] , bob. node_id , context, Vec :: new ( ) , & * bob. entropy_source , & secp_ctx) . unwrap ( ) ;
533
533
534
534
// Alice tries to asynchronously respond to Bob, but fails because the nodes are unannounced and
535
535
// disconnected. Thus, a reply path could no be created for the response.
@@ -575,7 +575,7 @@ fn we_are_intro_node() {
575
575
MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
576
576
] ;
577
577
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
578
- let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
578
+ let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, Vec :: new ( ) , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
579
579
let destination = Destination :: BlindedPath ( blinded_path) ;
580
580
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
581
581
@@ -586,7 +586,7 @@ fn we_are_intro_node() {
586
586
// Try with a two-hop blinded path where we are the introduction node.
587
587
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
588
588
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
589
- let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
589
+ let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, Vec :: new ( ) , & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
590
590
let destination = Destination :: BlindedPath ( blinded_path) ;
591
591
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
592
592
@@ -605,7 +605,7 @@ fn invalid_blinded_path_error() {
605
605
let secp_ctx = Secp256k1 :: new ( ) ;
606
606
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
607
607
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
608
- let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
608
+ let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, Vec :: new ( ) , & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
609
609
blinded_path. clear_blinded_hops ( ) ;
610
610
let destination = Destination :: BlindedPath ( blinded_path) ;
611
611
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -631,7 +631,7 @@ fn reply_path() {
631
631
MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
632
632
] ;
633
633
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
634
- let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
634
+ let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, Vec :: new ( ) , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
635
635
nodes[ 0 ] . messenger . send_onion_message_using_path ( path, test_msg. clone ( ) , Some ( reply_path) ) . unwrap ( ) ;
636
636
nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
637
637
pass_along_path ( & nodes) ;
@@ -646,14 +646,14 @@ fn reply_path() {
646
646
MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
647
647
] ;
648
648
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
649
- let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
649
+ let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, Vec :: new ( ) , & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
650
650
let destination = Destination :: BlindedPath ( blinded_path) ;
651
651
let intermediate_nodes = [
652
652
MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
653
653
MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
654
654
] ;
655
655
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
656
- let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
656
+ let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, Vec :: new ( ) , & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
657
657
let instructions = MessageSendInstructions :: WithSpecifiedReplyPath { destination, reply_path } ;
658
658
659
659
nodes[ 0 ] . messenger . send_onion_message ( test_msg, instructions) . unwrap ( ) ;
@@ -746,7 +746,7 @@ fn requests_peer_connection_for_buffered_messages() {
746
746
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
747
747
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
748
748
let blinded_path = BlindedMessagePath :: new (
749
- & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
749
+ & intermediate_nodes, nodes[ 2 ] . node_id , context, Vec :: new ( ) , & * nodes[ 0 ] . entropy_source , & secp_ctx
750
750
) . unwrap ( ) ;
751
751
let destination = Destination :: BlindedPath ( blinded_path) ;
752
752
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -786,7 +786,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
786
786
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
787
787
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
788
788
let blinded_path = BlindedMessagePath :: new (
789
- & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
789
+ & intermediate_nodes, nodes[ 2 ] . node_id , context, Vec :: new ( ) , & * nodes[ 0 ] . entropy_source , & secp_ctx
790
790
) . unwrap ( ) ;
791
791
let destination = Destination :: BlindedPath ( blinded_path) ;
792
792
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -838,7 +838,7 @@ fn intercept_offline_peer_oms() {
838
838
let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
839
839
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
840
840
let blinded_path = BlindedMessagePath :: new (
841
- & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx
841
+ & intermediate_nodes, nodes[ 2 ] . node_id , context, Vec :: new ( ) , & * nodes[ 2 ] . entropy_source , & secp_ctx
842
842
) . unwrap ( ) ;
843
843
let destination = Destination :: BlindedPath ( blinded_path) ;
844
844
let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
0 commit comments