1010//! Onion message testing and test utilities live here.
1111
1212use crate :: blinded_path:: EmptyNodeIdLookUp ;
13- use crate :: blinded_path:: message:: { BlindedMessagePath , ForwardNode , MessageContext , OffersContext } ;
13+ use crate :: blinded_path:: message:: { BlindedMessagePath , MessageForwardNode , MessageContext , OffersContext } ;
1414use crate :: events:: { Event , EventsProvider } ;
1515use crate :: ln:: features:: { ChannelFeatures , InitFeatures } ;
1616use crate :: ln:: msgs:: { self , DecodeError , OnionMessageHandler } ;
@@ -386,7 +386,7 @@ fn two_unblinded_two_blinded() {
386386 let test_msg = TestCustomMessage :: Pong ;
387387
388388 let secp_ctx = Secp256k1 :: new ( ) ;
389- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
389+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
390390 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
391391 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
392392 let path = OnionMessagePath {
@@ -407,8 +407,8 @@ fn three_blinded_hops() {
407407
408408 let secp_ctx = Secp256k1 :: new ( ) ;
409409 let intermediate_nodes = [
410- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
411- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
410+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
411+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
412412 ] ;
413413 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
414414 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -548,8 +548,8 @@ fn we_are_intro_node() {
548548
549549 let secp_ctx = Secp256k1 :: new ( ) ;
550550 let intermediate_nodes = [
551- ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
552- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
551+ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
552+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
553553 ] ;
554554 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
555555 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -560,7 +560,7 @@ fn we_are_intro_node() {
560560 pass_along_path ( & nodes) ;
561561
562562 // Try with a two-hop blinded path where we are the introduction node.
563- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
563+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
564564 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
565565 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
566566 let destination = Destination :: BlindedPath ( blinded_path) ;
@@ -577,7 +577,7 @@ fn invalid_blinded_path_error() {
577577 let test_msg = TestCustomMessage :: Pong ;
578578
579579 let secp_ctx = Secp256k1 :: new ( ) ;
580- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
580+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
581581 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
582582 let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
583583 blinded_path. clear_blinded_hops ( ) ;
@@ -599,8 +599,8 @@ fn reply_path() {
599599 first_node_addresses : None ,
600600 } ;
601601 let intermediate_nodes = [
602- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
603- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
602+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
603+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
604604 ] ;
605605 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
606606 let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -614,15 +614,15 @@ fn reply_path() {
614614
615615 // Destination::BlindedPath
616616 let intermediate_nodes = [
617- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
618- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
617+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
618+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
619619 ] ;
620620 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
621621 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
622622 let destination = Destination :: BlindedPath ( blinded_path) ;
623623 let intermediate_nodes = [
624- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
625- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
624+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
625+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
626626 ] ;
627627 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
628628 let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -705,7 +705,7 @@ fn requests_peer_connection_for_buffered_messages() {
705705 let secp_ctx = Secp256k1 :: new ( ) ;
706706 add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
707707
708- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
708+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
709709 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
710710 let blinded_path = BlindedMessagePath :: new (
711711 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -744,7 +744,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
744744 let secp_ctx = Secp256k1 :: new ( ) ;
745745 add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
746746
747- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
747+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
748748 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
749749 let blinded_path = BlindedMessagePath :: new (
750750 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -795,7 +795,7 @@ fn intercept_offline_peer_oms() {
795795
796796 let message = TestCustomMessage :: Pong ;
797797 let secp_ctx = Secp256k1 :: new ( ) ;
798- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
798+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
799799 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
800800 let blinded_path = BlindedMessagePath :: new (
801801 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx
0 commit comments