@@ -4054,7 +4054,7 @@ mod tests {
40544054
40554055 // Simple route to 2 via 1
40564056
4057- let our_chans = vec ! [ get_channel_details( Some ( 2 ) , our_id, InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 100000 ) ] ;
4057+ let our_chans = [ get_channel_details ( Some ( 2 ) , our_id, InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 100000 ) ] ;
40584058
40594059 let route_params = RouteParameters :: from_payment_params_and_value ( payment_params, 100 ) ;
40604060 if let Err ( err) = get_route ( & our_id,
@@ -4473,7 +4473,7 @@ mod tests {
44734473 } else { panic ! ( ) ; }
44744474
44754475 // If we specify a channel to node7, that overrides our local channel view and that gets used
4476- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 7 ] . clone( ) ,
4476+ let our_chans = [ get_channel_details ( Some ( 42 ) , nodes[ 7 ] . clone ( ) ,
44774477 InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 250_000_000 ) ] ;
44784478 route_params. payment_params . max_path_length = 2 ;
44794479 let route = get_route ( & our_id, & route_params, & network_graph. read_only ( ) ,
@@ -4521,7 +4521,7 @@ mod tests {
45214521 } else { panic ! ( ) ; }
45224522
45234523 // If we specify a channel to node7, that overrides our local channel view and that gets used
4524- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 7 ] . clone( ) ,
4524+ let our_chans = [ get_channel_details ( Some ( 42 ) , nodes[ 7 ] . clone ( ) ,
45254525 InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 250_000_000 ) ] ;
45264526 let route = get_route ( & our_id, & route_params, & network_graph. read_only ( ) ,
45274527 Some ( & our_chans. iter ( ) . collect :: < Vec < _ > > ( ) ) , Arc :: clone ( & logger) , & scorer,
@@ -4586,7 +4586,7 @@ mod tests {
45864586 // If we specify a channel to node7, that overrides our local channel view and that gets used
45874587 let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] , 42 ) ;
45884588 let route_params = RouteParameters :: from_payment_params_and_value ( payment_params, 100 ) ;
4589- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 7 ] . clone( ) ,
4589+ let our_chans = [ get_channel_details ( Some ( 42 ) , nodes[ 7 ] . clone ( ) ,
45904590 InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 250_000_000 ) ] ;
45914591 let route = get_route ( & our_id, & route_params, & network_graph. read_only ( ) ,
45924592 Some ( & our_chans. iter ( ) . collect :: < Vec < _ > > ( ) ) , Arc :: clone ( & logger) , & scorer,
@@ -5137,7 +5137,7 @@ mod tests {
51375137 let random_seed_bytes = [ 42 ; 32 ] ;
51385138
51395139 // Simple test with outbound channel to 4 to test that last_hops and first_hops connect
5140- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 3 ] . clone( ) , InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 250_000_000 ) ] ;
5140+ let our_chans = [ get_channel_details ( Some ( 42 ) , nodes[ 3 ] . clone ( ) , InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 250_000_000 ) ] ;
51415141 let mut last_hops = last_hops ( & nodes) ;
51425142 let payment_params = PaymentParameters :: from_node_id ( nodes[ 6 ] , 42 )
51435143 . with_route_hints ( last_hops. clone ( ) ) . unwrap ( ) ;
@@ -5265,7 +5265,7 @@ mod tests {
52655265 htlc_maximum_msat: last_hop_htlc_max,
52665266 } ] ) ;
52675267 let payment_params = PaymentParameters :: from_node_id ( target_node_id, 42 ) . with_route_hints ( vec ! [ last_hops] ) . unwrap ( ) ;
5268- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , middle_node_id, InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , outbound_capacity_msat) ] ;
5268+ let our_chans = [ get_channel_details ( Some ( 42 ) , middle_node_id, InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , outbound_capacity_msat) ] ;
52695269 let scorer = ln_test_utils:: TestScorer :: new ( ) ;
52705270 let random_seed_bytes = [ 42 ; 32 ] ;
52715271 let logger = ln_test_utils:: TestLogger :: new ( ) ;
@@ -5442,7 +5442,7 @@ mod tests {
54425442 } ) ;
54435443
54445444 // Now, limit the first_hop by the next_outbound_htlc_limit_msat of 200_000 sats.
5445- let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 0 ] . clone( ) , InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 200_000_000 ) ] ;
5445+ let our_chans = [ get_channel_details ( Some ( 42 ) , nodes[ 0 ] . clone ( ) , InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 200_000_000 ) ] ;
54465446
54475447 {
54485448 // Attempt to route more than available results in a failure.
@@ -7827,7 +7827,7 @@ mod tests {
78277827
78287828 let our_node_id = ln_test_utils:: pubkey ( 42 ) ;
78297829 let intermed_node_id = ln_test_utils:: pubkey ( 43 ) ;
7830- let first_hop = vec ! [ get_channel_details( Some ( 42 ) , intermed_node_id, InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 10_000_000 ) ] ;
7830+ let first_hop = [ get_channel_details ( Some ( 42 ) , intermed_node_id, InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 10_000_000 ) ] ;
78317831
78327832 let amt_msat = 900_000 ;
78337833 let max_htlc_msat = 500_000 ;
@@ -7874,7 +7874,7 @@ mod tests {
78747874
78757875 // Re-run but with two first hop channels connected to the same route hint peers that must be
78767876 // split between.
7877- let first_hops = vec ! [
7877+ let first_hops = [
78787878 get_channel_details ( Some ( 42 ) , intermed_node_id, InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , amt_msat - 10 ) ,
78797879 get_channel_details ( Some ( 43 ) , intermed_node_id, InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , amt_msat - 10 ) ,
78807880 ] ;
@@ -8286,8 +8286,9 @@ mod tests {
82868286 fee_proportional_millionths : 0 ,
82878287 excess_data : Vec :: new ( )
82888288 } ) ;
8289- let first_hops = vec ! [
8290- get_channel_details( Some ( 1 ) , nodes[ 1 ] , InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 10_000_000 ) ] ;
8289+ let first_hops = [
8290+ get_channel_details ( Some ( 1 ) , nodes[ 1 ] , InitFeatures :: from_le_bytes ( vec ! [ 0b11 ] ) , 10_000_000 )
8291+ ] ;
82918292
82928293 let blinded_payinfo = BlindedPayInfo {
82938294 fee_base_msat : 1000 ,
@@ -8347,9 +8348,10 @@ mod tests {
83478348 // Values are taken from the fuzz input that uncovered this panic.
83488349 let amt_msat = 21_7020_5185_1403_2640 ;
83498350 let ( _, _, _, nodes) = get_nodes ( & secp_ctx) ;
8350- let first_hops = vec ! [
8351+ let first_hops = [
83518352 get_channel_details ( Some ( 1 ) , nodes[ 1 ] , channelmanager:: provided_init_features ( & config) ,
8352- 18446744073709551615 ) ] ;
8353+ 18446744073709551615 ) ,
8354+ ] ;
83538355
83548356 let blinded_payinfo = BlindedPayInfo {
83558357 fee_base_msat : 5046_2720 ,
@@ -8493,7 +8495,7 @@ mod tests {
84938495 let amt_msat = 7_4009_8048 ;
84948496 let ( _, our_id, _, nodes) = get_nodes ( & secp_ctx) ;
84958497 let first_hop_outbound_capacity = 2_7345_2000 ;
8496- let first_hops = vec ! [ get_channel_details(
8498+ let first_hops = [ get_channel_details (
84978499 Some ( 200 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) ,
84988500 first_hop_outbound_capacity
84998501 ) ] ;
@@ -8566,7 +8568,7 @@ mod tests {
85668568 // Values are taken from the fuzz input that uncovered this panic.
85678569 let amt_msat = 52_4288 ;
85688570 let ( _, our_id, _, nodes) = get_nodes ( & secp_ctx) ;
8569- let first_hops = vec ! [ get_channel_details(
8571+ let first_hops = [ get_channel_details (
85708572 Some ( 161 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 486_4000
85718573 ) , get_channel_details (
85728574 Some ( 122 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 179_5000
@@ -8641,7 +8643,7 @@ mod tests {
86418643 // Values are taken from the fuzz input that uncovered this panic.
86428644 let amt_msat = 7_4009_8048 ;
86438645 let ( _, our_id, privkeys, nodes) = get_nodes ( & secp_ctx) ;
8644- let first_hops = vec ! [ get_channel_details(
8646+ let first_hops = [ get_channel_details (
86458647 Some ( 200 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 2_7345_2000
86468648 ) ] ;
86478649
@@ -8705,7 +8707,7 @@ mod tests {
87058707 // Values are taken from the fuzz input that uncovered this panic.
87068708 let amt_msat = 562_0000 ;
87078709 let ( _, our_id, _, nodes) = get_nodes ( & secp_ctx) ;
8708- let first_hops = vec ! [
8710+ let first_hops = [
87098711 get_channel_details (
87108712 Some ( 83 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 2199_0000 ,
87118713 ) ,
@@ -8849,9 +8851,8 @@ mod tests {
88498851
88508852 // First create an insufficient first hop for channel with SCID 1 and check we'd use the
88518853 // route hint.
8852- let first_hop = get_channel_details ( Some ( 1 ) , nodes[ 0 ] ,
8853- channelmanager:: provided_init_features ( & config) , 999_999 ) ;
8854- let first_hops = vec ! [ first_hop] ;
8854+ let first_hops = [ get_channel_details ( Some ( 1 ) , nodes[ 0 ] ,
8855+ channelmanager:: provided_init_features ( & config) , 999_999 ) ] ;
88558856
88568857 let route = get_route ( & our_node_id, & route_params. clone ( ) , & network_graph. read_only ( ) ,
88578858 Some ( & first_hops. iter ( ) . collect :: < Vec < _ > > ( ) ) , Arc :: clone ( & logger) , & scorer,
@@ -8867,7 +8868,7 @@ mod tests {
88678868 // for a first hop channel.
88688869 let mut first_hop = get_channel_details ( Some ( 1 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 999_999 ) ;
88698870 first_hop. outbound_scid_alias = Some ( 44 ) ;
8870- let first_hops = vec ! [ first_hop] ;
8871+ let first_hops = [ first_hop] ;
88718872
88728873 let route_res = get_route ( & our_node_id, & route_params. clone ( ) , & network_graph. read_only ( ) ,
88738874 Some ( & first_hops. iter ( ) . collect :: < Vec < _ > > ( ) ) , Arc :: clone ( & logger) , & scorer,
@@ -8879,7 +8880,7 @@ mod tests {
88798880 let mut first_hop = get_channel_details ( Some ( 1 ) , nodes[ 0 ] ,
88808881 channelmanager:: provided_init_features ( & config) , 10_000_000 ) ;
88818882 first_hop. outbound_scid_alias = Some ( 44 ) ;
8882- let first_hops = vec ! [ first_hop] ;
8883+ let first_hops = [ first_hop] ;
88838884
88848885 let route = get_route ( & our_node_id, & route_params. clone ( ) , & network_graph. read_only ( ) ,
88858886 Some ( & first_hops. iter ( ) . collect :: < Vec < _ > > ( ) ) , Arc :: clone ( & logger) , & scorer,
@@ -9002,8 +9003,9 @@ mod tests {
90029003 let amt_msat = 1_000_000 ;
90039004 let dest_node_id = nodes[ 1 ] ;
90049005
9005- let first_hop = get_channel_details ( Some ( 1 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 10_000_000 ) ;
9006- let first_hops = vec ! [ first_hop] ;
9006+ let first_hops = [
9007+ get_channel_details ( Some ( 1 ) , nodes[ 0 ] , channelmanager:: provided_init_features ( & config) , 10_000_000 ) ,
9008+ ] ;
90079009
90089010 let route_hint = RouteHint ( vec ! [ RouteHintHop {
90099011 src_node_id: our_node_id,
0 commit comments