@@ -76,7 +76,7 @@ impl Drop for MessengerNode {
7676struct TestOffersMessageHandler { }
7777
7878impl 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 ) > {
8080 None
8181 }
8282}
@@ -204,7 +204,7 @@ impl CustomOnionMessageHandler for TestCustomMessageHandler {
204204
205205 match responder {
206206 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 ) ) )
208208 } ,
209209 Some ( responder) => Some ( ( response, responder. respond ( ) ) ) ,
210210 None => None
@@ -391,7 +391,7 @@ fn one_blinded_hop() {
391391
392392 let secp_ctx = Secp256k1 :: new ( ) ;
393393 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 ( ) ;
395395 let destination = Destination :: BlindedPath ( blinded_path) ;
396396 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
397397 nodes[ 0 ] . messenger . send_onion_message ( test_msg, instructions) . unwrap ( ) ;
@@ -407,7 +407,7 @@ fn two_unblinded_two_blinded() {
407407 let secp_ctx = Secp256k1 :: new ( ) ;
408408 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
409409 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 ( ) ;
411411 let path = OnionMessagePath {
412412 intermediate_nodes : vec ! [ nodes[ 1 ] . node_id, nodes[ 2 ] . node_id] ,
413413 destination : Destination :: BlindedPath ( blinded_path) ,
@@ -430,7 +430,7 @@ fn three_blinded_hops() {
430430 MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
431431 ] ;
432432 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 ( ) ;
434434 let destination = Destination :: BlindedPath ( blinded_path) ;
435435 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
436436
@@ -454,7 +454,7 @@ fn async_response_over_one_blinded_hop() {
454454 // 3. Simulate the creation of a Blinded Reply path provided by Bob.
455455 let secp_ctx = Secp256k1 :: new ( ) ;
456456 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 ( ) ;
458458
459459 // 4. Create a responder using the reply path for Alice.
460460 let responder = Some ( Responder :: new ( reply_path) ) ;
@@ -491,7 +491,7 @@ fn async_response_with_reply_path_succeeds() {
491491 // Alice receives a message from Bob with an added reply_path for responding back.
492492 let message = TestCustomMessage :: Ping ;
493493 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 ( ) ;
495495
496496 // Alice asynchronously responds to Bob, expecting a response back from him.
497497 let responder = Responder :: new ( reply_path) ;
@@ -529,7 +529,7 @@ fn async_response_with_reply_path_fails() {
529529 // Alice receives a message from Bob with an added reply_path for responding back.
530530 let message = TestCustomMessage :: Ping ;
531531 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 ( ) ;
533533
534534 // Alice tries to asynchronously respond to Bob, but fails because the nodes are unannounced and
535535 // disconnected. Thus, a reply path could no be created for the response.
@@ -575,7 +575,7 @@ fn we_are_intro_node() {
575575 MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
576576 ] ;
577577 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 ( ) ;
579579 let destination = Destination :: BlindedPath ( blinded_path) ;
580580 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
581581
@@ -586,7 +586,7 @@ fn we_are_intro_node() {
586586 // Try with a two-hop blinded path where we are the introduction node.
587587 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
588588 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 ( ) ;
590590 let destination = Destination :: BlindedPath ( blinded_path) ;
591591 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
592592
@@ -605,7 +605,7 @@ fn invalid_blinded_path_error() {
605605 let secp_ctx = Secp256k1 :: new ( ) ;
606606 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
607607 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 ( ) ;
609609 blinded_path. clear_blinded_hops ( ) ;
610610 let destination = Destination :: BlindedPath ( blinded_path) ;
611611 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -631,7 +631,7 @@ fn reply_path() {
631631 MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
632632 ] ;
633633 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 ( ) ;
635635 nodes[ 0 ] . messenger . send_onion_message_using_path ( path, test_msg. clone ( ) , Some ( reply_path) ) . unwrap ( ) ;
636636 nodes[ 3 ] . custom_message_handler . expect_message ( TestCustomMessage :: Ping ) ;
637637 pass_along_path ( & nodes) ;
@@ -646,14 +646,14 @@ fn reply_path() {
646646 MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
647647 ] ;
648648 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 ( ) ;
650650 let destination = Destination :: BlindedPath ( blinded_path) ;
651651 let intermediate_nodes = [
652652 MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
653653 MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
654654 ] ;
655655 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 ( ) ;
657657 let instructions = MessageSendInstructions :: WithSpecifiedReplyPath { destination, reply_path } ;
658658
659659 nodes[ 0 ] . messenger . send_onion_message ( test_msg, instructions) . unwrap ( ) ;
@@ -746,7 +746,7 @@ fn requests_peer_connection_for_buffered_messages() {
746746 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
747747 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
748748 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
750750 ) . unwrap ( ) ;
751751 let destination = Destination :: BlindedPath ( blinded_path) ;
752752 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -786,7 +786,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
786786 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
787787 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
788788 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
790790 ) . unwrap ( ) ;
791791 let destination = Destination :: BlindedPath ( blinded_path) ;
792792 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
@@ -838,7 +838,7 @@ fn intercept_offline_peer_oms() {
838838 let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
839839 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
840840 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
842842 ) . unwrap ( ) ;
843843 let destination = Destination :: BlindedPath ( blinded_path) ;
844844 let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
0 commit comments