@@ -3541,7 +3541,7 @@ fn build_route_from_hops_internal<L: Deref>(
35413541
35423542#[ cfg( test) ]
35433543mod tests {
3544- use crate :: blinded_path:: { BlindedHop , BlindedPath , IntroductionNode } ;
3544+ use crate :: blinded_path:: BlindedHop ;
35453545 use crate :: blinded_path:: payment:: BlindedPaymentPath ;
35463546 use crate :: routing:: gossip:: { NetworkGraph , P2PGossipSync , NodeId , EffectiveCapacity } ;
35473547 use crate :: routing:: utxo:: UtxoResult ;
@@ -7682,22 +7682,6 @@ mod tests {
76827682
76837683 #[ test]
76847684 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- } ;
77017685 // (De)serialize a Route with 1 blinded path out of two total paths.
77027686 let mut route = Route { paths : vec ! [ Path {
77037687 hops: vec![ RouteHop {
@@ -7710,8 +7694,11 @@ mod tests {
77107694 maybe_announced_channel: true ,
77117695 } ] ,
77127696 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 ) ,
77157702 excess_final_cltv_expiry_delta: 40 ,
77167703 final_value_msat: 100 ,
77177704 } ) } , Path {
@@ -7733,8 +7720,11 @@ mod tests {
77337720
77347721 // (De)serialize a Route with two paths, each containing a blinded tail.
77357722 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 ) ,
77387728 excess_final_cltv_expiry_delta : 41 ,
77397729 final_value_msat : 101 ,
77407730 } ) ;
@@ -7749,11 +7739,6 @@ mod tests {
77497739 // Ensure we'll score the channel that's inbound to a blinded path's introduction node, and
77507740 // account for the blinded tail's final amount_msat.
77517741 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- } ;
77577742 let path = Path {
77587743 hops : vec ! [ RouteHop {
77597744 pubkey: ln_test_utils:: pubkey( 42 ) ,
@@ -7774,8 +7759,8 @@ mod tests {
77747759 maybe_announced_channel: false ,
77757760 } ] ,
77767761 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 ) ,
77797764 excess_final_cltv_expiry_delta : 0 ,
77807765 final_value_msat : 200 ,
77817766 } ) ,
@@ -7788,14 +7773,6 @@ mod tests {
77887773 #[ test]
77897774 fn blinded_path_cltv_shadow_offset ( ) {
77907775 // 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- } ;
77997776 let mut route = Route { paths : vec ! [ Path {
78007777 hops: vec![ RouteHop {
78017778 pubkey: ln_test_utils:: pubkey( 42 ) ,
@@ -7817,8 +7794,11 @@ mod tests {
78177794 }
78187795 ] ,
78197796 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 ) ,
78227802 excess_final_cltv_expiry_delta: 0 ,
78237803 final_value_msat: 200 ,
78247804 } ) ,
0 commit comments