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 } ;
@@ -386,7 +386,7 @@ fn two_unblinded_two_blinded() {
386
386
let test_msg = TestCustomMessage :: Pong ;
387
387
388
388
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 } ] ;
390
390
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
391
391
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 4 ] . node_id , context, & * nodes[ 4 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
392
392
let path = OnionMessagePath {
@@ -407,8 +407,8 @@ fn three_blinded_hops() {
407
407
408
408
let secp_ctx = Secp256k1 :: new ( ) ;
409
409
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 } ,
412
412
] ;
413
413
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
414
414
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() {
548
548
549
549
let secp_ctx = Secp256k1 :: new ( ) ;
550
550
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 } ,
553
553
] ;
554
554
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
555
555
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() {
560
560
pass_along_path ( & nodes) ;
561
561
562
562
// 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 } ] ;
564
564
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
565
565
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 1 ] . node_id , context, & * nodes[ 1 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
566
566
let destination = Destination :: BlindedPath ( blinded_path) ;
@@ -577,7 +577,7 @@ fn invalid_blinded_path_error() {
577
577
let test_msg = TestCustomMessage :: Pong ;
578
578
579
579
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 } ] ;
581
581
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
582
582
let mut blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
583
583
blinded_path. clear_blinded_hops ( ) ;
@@ -599,8 +599,8 @@ fn reply_path() {
599
599
first_node_addresses : None ,
600
600
} ;
601
601
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 } ,
604
604
] ;
605
605
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
606
606
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() {
614
614
615
615
// Destination::BlindedPath
616
616
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 } ,
619
619
] ;
620
620
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
621
621
let blinded_path = BlindedMessagePath :: new ( & intermediate_nodes, nodes[ 3 ] . node_id , context, & * nodes[ 3 ] . entropy_source , & secp_ctx) . unwrap ( ) ;
622
622
let destination = Destination :: BlindedPath ( blinded_path) ;
623
623
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 } ,
626
626
] ;
627
627
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
628
628
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() {
705
705
let secp_ctx = Secp256k1 :: new ( ) ;
706
706
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
707
707
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 } ] ;
709
709
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
710
710
let blinded_path = BlindedMessagePath :: new (
711
711
& 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() {
744
744
let secp_ctx = Secp256k1 :: new ( ) ;
745
745
add_channel_to_graph ( & nodes[ 0 ] , & nodes[ 1 ] , & secp_ctx, 42 ) ;
746
746
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 } ] ;
748
748
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
749
749
let blinded_path = BlindedMessagePath :: new (
750
750
& intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 0 ] . entropy_source , & secp_ctx
@@ -795,7 +795,7 @@ fn intercept_offline_peer_oms() {
795
795
796
796
let message = TestCustomMessage :: Pong ;
797
797
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 } ] ;
799
799
let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
800
800
let blinded_path = BlindedMessagePath :: new (
801
801
& intermediate_nodes, nodes[ 2 ] . node_id , context, & * nodes[ 2 ] . entropy_source , & secp_ctx
0 commit comments