@@ -3541,7 +3541,7 @@ fn build_route_from_hops_internal<L: Deref>(
3541
3541
3542
3542
#[ cfg( test) ]
3543
3543
mod tests {
3544
- use crate :: blinded_path:: { BlindedHop , BlindedPath , IntroductionNode } ;
3544
+ use crate :: blinded_path:: BlindedHop ;
3545
3545
use crate :: blinded_path:: payment:: BlindedPaymentPath ;
3546
3546
use crate :: routing:: gossip:: { NetworkGraph , P2PGossipSync , NodeId , EffectiveCapacity } ;
3547
3547
use crate :: routing:: utxo:: UtxoResult ;
@@ -7682,22 +7682,6 @@ mod tests {
7682
7682
7683
7683
#[ test]
7684
7684
fn blinded_route_ser ( ) {
7685
- let blinded_path_1 = BlindedPath {
7686
- introduction_node : IntroductionNode :: NodeId ( ln_test_utils:: pubkey ( 42 ) ) ,
7687
- blinding_point : ln_test_utils:: pubkey ( 43 ) ,
7688
- blinded_hops : vec ! [
7689
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 44 ) , encrypted_payload: Vec :: new( ) } ,
7690
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 45 ) , encrypted_payload: Vec :: new( ) }
7691
- ] ,
7692
- } ;
7693
- let blinded_path_2 = BlindedPath {
7694
- introduction_node : IntroductionNode :: NodeId ( ln_test_utils:: pubkey ( 46 ) ) ,
7695
- blinding_point : ln_test_utils:: pubkey ( 47 ) ,
7696
- blinded_hops : vec ! [
7697
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 48 ) , encrypted_payload: Vec :: new( ) } ,
7698
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 49 ) , encrypted_payload: Vec :: new( ) }
7699
- ] ,
7700
- } ;
7701
7685
// (De)serialize a Route with 1 blinded path out of two total paths.
7702
7686
let mut route = Route { paths : vec ! [ Path {
7703
7687
hops: vec![ RouteHop {
@@ -7710,8 +7694,11 @@ mod tests {
7710
7694
maybe_announced_channel: true ,
7711
7695
} ] ,
7712
7696
blinded_tail: Some ( BlindedTail {
7713
- hops: blinded_path_1. blinded_hops,
7714
- blinding_point: blinded_path_1. blinding_point,
7697
+ hops: vec![
7698
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 44 ) , encrypted_payload: Vec :: new( ) } ,
7699
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 45 ) , encrypted_payload: Vec :: new( ) }
7700
+ ] ,
7701
+ blinding_point: ln_test_utils:: pubkey( 43 ) ,
7715
7702
excess_final_cltv_expiry_delta: 40 ,
7716
7703
final_value_msat: 100 ,
7717
7704
} ) } , Path {
@@ -7733,8 +7720,11 @@ mod tests {
7733
7720
7734
7721
// (De)serialize a Route with two paths, each containing a blinded tail.
7735
7722
route. paths [ 1 ] . blinded_tail = Some ( BlindedTail {
7736
- hops : blinded_path_2. blinded_hops ,
7737
- blinding_point : blinded_path_2. blinding_point ,
7723
+ hops : vec ! [
7724
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 48 ) , encrypted_payload: Vec :: new( ) } ,
7725
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 49 ) , encrypted_payload: Vec :: new( ) }
7726
+ ] ,
7727
+ blinding_point : ln_test_utils:: pubkey ( 47 ) ,
7738
7728
excess_final_cltv_expiry_delta : 41 ,
7739
7729
final_value_msat : 101 ,
7740
7730
} ) ;
@@ -7749,11 +7739,6 @@ mod tests {
7749
7739
// Ensure we'll score the channel that's inbound to a blinded path's introduction node, and
7750
7740
// account for the blinded tail's final amount_msat.
7751
7741
let mut inflight_htlcs = InFlightHtlcs :: new ( ) ;
7752
- let blinded_path = BlindedPath {
7753
- introduction_node : IntroductionNode :: NodeId ( ln_test_utils:: pubkey ( 43 ) ) ,
7754
- blinding_point : ln_test_utils:: pubkey ( 48 ) ,
7755
- blinded_hops : vec ! [ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 49 ) , encrypted_payload: Vec :: new( ) } ] ,
7756
- } ;
7757
7742
let path = Path {
7758
7743
hops : vec ! [ RouteHop {
7759
7744
pubkey: ln_test_utils:: pubkey( 42 ) ,
@@ -7774,8 +7759,8 @@ mod tests {
7774
7759
maybe_announced_channel: false ,
7775
7760
} ] ,
7776
7761
blinded_tail : Some ( BlindedTail {
7777
- hops : blinded_path . blinded_hops ,
7778
- blinding_point : blinded_path . blinding_point ,
7762
+ hops : vec ! [ BlindedHop { blinded_node_id : ln_test_utils :: pubkey ( 49 ) , encrypted_payload : Vec :: new ( ) } ] ,
7763
+ blinding_point : ln_test_utils :: pubkey ( 48 ) ,
7779
7764
excess_final_cltv_expiry_delta : 0 ,
7780
7765
final_value_msat : 200 ,
7781
7766
} ) ,
@@ -7788,14 +7773,6 @@ mod tests {
7788
7773
#[ test]
7789
7774
fn blinded_path_cltv_shadow_offset ( ) {
7790
7775
// Make sure we add a shadow offset when sending to blinded paths.
7791
- let blinded_path = BlindedPath {
7792
- introduction_node : IntroductionNode :: NodeId ( ln_test_utils:: pubkey ( 43 ) ) ,
7793
- blinding_point : ln_test_utils:: pubkey ( 44 ) ,
7794
- blinded_hops : vec ! [
7795
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 45 ) , encrypted_payload: Vec :: new( ) } ,
7796
- BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 46 ) , encrypted_payload: Vec :: new( ) }
7797
- ] ,
7798
- } ;
7799
7776
let mut route = Route { paths : vec ! [ Path {
7800
7777
hops: vec![ RouteHop {
7801
7778
pubkey: ln_test_utils:: pubkey( 42 ) ,
@@ -7817,8 +7794,11 @@ mod tests {
7817
7794
}
7818
7795
] ,
7819
7796
blinded_tail: Some ( BlindedTail {
7820
- hops: blinded_path. blinded_hops,
7821
- blinding_point: blinded_path. blinding_point,
7797
+ hops: vec![
7798
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 45 ) , encrypted_payload: Vec :: new( ) } ,
7799
+ BlindedHop { blinded_node_id: ln_test_utils:: pubkey( 46 ) , encrypted_payload: Vec :: new( ) }
7800
+ ] ,
7801
+ blinding_point: ln_test_utils:: pubkey( 44 ) ,
7822
7802
excess_final_cltv_expiry_delta: 0 ,
7823
7803
final_value_msat: 200 ,
7824
7804
} ) ,
0 commit comments