10
10
//! Onion message testing and test utilities live here.
11
11
12
12
use crate :: blinded_path:: EmptyNodeIdLookUp ;
13
- use crate :: blinded_path:: message:: { BlindedMessagePath , ForwardNode , MessageContext , OffersContext } ;
13
+ use crate :: blinded_path:: message:: { BlindedMessagePath , MessageForwardNode , MessageContext , OffersContext } ;
14
14
use crate :: events:: { Event , EventsProvider } ;
15
15
use crate :: ln:: features:: { ChannelFeatures , InitFeatures } ;
16
16
use crate :: ln:: msgs:: { self , DecodeError , OnionMessageHandler } ;
@@ -382,7 +382,7 @@ fn two_unblinded_two_blinded() {
382
382
let test_msg = TestCustomMessage :: Pong ;
383
383
384
384
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 } ] ;
386
386
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
387
387
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
388
388
let path = OnionMessagePath {
@@ -403,8 +403,8 @@ fn three_blinded_hops() {
403
403
404
404
let secp_ctx = Secp256k1 :: new ( ) ;
405
405
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 } ,
408
408
] ;
409
409
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
410
410
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() {
544
544
545
545
let secp_ctx = Secp256k1 :: new ( ) ;
546
546
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 } ,
549
549
] ;
550
550
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
551
551
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() {
556
556
pass_along_path ( & nodes) ;
557
557
558
558
// 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 } ] ;
560
560
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
561
561
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
562
562
let destination = Destination :: BlindedPath ( blinded_path) ;
@@ -573,7 +573,7 @@ fn invalid_blinded_path_error() {
573
573
let test_msg = TestCustomMessage :: Pong ;
574
574
575
575
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 } ] ;
577
577
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
578
578
let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
579
579
blinded_path. clear_blinded_hops ( ) ;
@@ -595,8 +595,8 @@ fn reply_path() {
595
595
first_node_addresses : None ,
596
596
} ;
597
597
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 } ,
600
600
] ;
601
601
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
602
602
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() {
610
610
611
611
// Destination::BlindedPath
612
612
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 } ,
615
615
] ;
616
616
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
617
617
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
618
618
let destination = Destination :: BlindedPath ( blinded_path) ;
619
619
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 } ,
622
622
] ;
623
623
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
624
624
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() {
701
701
let secp_ctx = Secp256k1 :: new ( ) ;
702
702
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
703
703
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 } ] ;
705
705
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
706
706
let blinded_path = BlindedMessagePath :: new (
707
707
& 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() {
740
740
let secp_ctx = Secp256k1 :: new ( ) ;
741
741
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
742
742
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 } ] ;
744
744
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
745
745
let blinded_path = BlindedMessagePath :: new (
746
746
& intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -791,7 +791,7 @@ fn intercept_offline_peer_oms() {
791
791
792
792
let message = TestCustomMessage :: Pong ;
793
793
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 } ] ;
795
795
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
796
796
let blinded_path = BlindedMessagePath :: new (
797
797
& intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx
0 commit comments