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 } ;
@@ -382,7 +382,7 @@ fn two_unblinded_two_blinded() {
382382 let test_msg = TestCustomMessage :: Pong ;
383383
384384 let secp_ctx = Secp256k1 :: new ( ) ;
385- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
385+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 3 ] . node_id , short_channel_id : None } ] ;
386386 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
387387 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
388388 let path = OnionMessagePath {
@@ -403,8 +403,8 @@ fn three_blinded_hops() {
403403
404404 let secp_ctx = Secp256k1 :: new ( ) ;
405405 let intermediate_nodes = [
406- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
407- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
406+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
407+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
408408 ] ;
409409 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
410410 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -544,8 +544,8 @@ fn we_are_intro_node() {
544544
545545 let secp_ctx = Secp256k1 :: new ( ) ;
546546 let intermediate_nodes = [
547- ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
548- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
547+ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ,
548+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
549549 ] ;
550550 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
551551 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -556,7 +556,7 @@ fn we_are_intro_node() {
556556 pass_along_path ( & nodes) ;
557557
558558 // Try with a two-hop blinded path where we are the introduction node.
559- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
559+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 0 ] . node_id , short_channel_id : None } ] ;
560560 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
561561 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
562562 let destination = Destination :: BlindedPath ( blinded_path) ;
@@ -573,7 +573,7 @@ fn invalid_blinded_path_error() {
573573 let test_msg = TestCustomMessage :: Pong ;
574574
575575 let secp_ctx = Secp256k1 :: new ( ) ;
576- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
576+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
577577 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
578578 let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
579579 blinded_path. clear_blinded_hops ( ) ;
@@ -595,8 +595,8 @@ fn reply_path() {
595595 first_node_addresses : None ,
596596 } ;
597597 let intermediate_nodes = [
598- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
599- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
598+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
599+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
600600 ] ;
601601 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
602602 let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -610,15 +610,15 @@ fn reply_path() {
610610
611611 // Destination::BlindedPath
612612 let intermediate_nodes = [
613- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
614- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
613+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
614+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
615615 ] ;
616616 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
617617 let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
618618 let destination = Destination :: BlindedPath ( blinded_path) ;
619619 let intermediate_nodes = [
620- ForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
621- ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
620+ MessageForwardNode { node_id : nodes[ 2 ] . node_id , short_channel_id : None } ,
621+ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ,
622622 ] ;
623623 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
624624 let reply_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 0 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
@@ -701,7 +701,7 @@ fn requests_peer_connection_for_buffered_messages() {
701701 let secp_ctx = Secp256k1 :: new ( ) ;
702702 add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
703703
704- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
704+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
705705 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
706706 let blinded_path = BlindedMessagePath :: new (
707707 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -740,7 +740,7 @@ fn drops_buffered_messages_waiting_for_peer_connection() {
740740 let secp_ctx = Secp256k1 :: new ( ) ;
741741 add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
742742
743- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
743+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
744744 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
745745 let blinded_path = BlindedMessagePath :: new (
746746 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -791,7 +791,7 @@ fn intercept_offline_peer_oms() {
791791
792792 let message = TestCustomMessage :: Pong ;
793793 let secp_ctx = Secp256k1 :: new ( ) ;
794- let intermediate_nodes = [ ForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
794+ let intermediate_nodes = [ MessageForwardNode { node_id : nodes[ 1 ] . node_id , short_channel_id : None } ] ;
795795 let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
796796 let blinded_path = BlindedMessagePath :: new (
797797 & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx
0 commit comments