@@ -846,30 +846,26 @@ pub fn get_updates_and_revoke<CM: AChannelManager, H: NodeHolder<CM=CM>>(node: &
846
846
/// Gets an RAA and CS which were sent in response to a commitment update
847
847
///
848
848
/// Don't use this, use the identically-named function instead.
849
- #[ rustfmt:: skip]
850
849
macro_rules! get_revoke_commit_msgs {
851
850
( $node: expr, $node_id: expr) => {
852
851
$crate:: ln:: functional_test_utils:: get_revoke_commit_msgs( & $node, & $node_id)
853
- }
852
+ } ;
854
853
}
855
854
856
855
/// Get an specific event message from the pending events queue.
857
856
#[ macro_export]
858
- #[ rustfmt:: skip]
859
857
macro_rules! get_event_msg {
860
- ( $node: expr, $event_type: path, $node_id: expr) => {
861
- {
862
- let events = $node. node. get_and_clear_pending_msg_events( ) ;
863
- assert_eq!( events. len( ) , 1 ) ;
864
- match events[ 0 ] {
865
- $event_type { ref node_id, ref msg } => {
866
- assert_eq!( * node_id, $node_id) ;
867
- ( * msg) . clone( )
868
- } ,
869
- _ => panic!( "Unexpected event {:?}" , events[ 0 ] ) ,
870
- }
858
+ ( $node: expr, $event_type: path, $node_id: expr) => { {
859
+ let events = $node. node. get_and_clear_pending_msg_events( ) ;
860
+ assert_eq!( events. len( ) , 1 ) ;
861
+ match events[ 0 ] {
862
+ $event_type { ref node_id, ref msg } => {
863
+ assert_eq!( * node_id, $node_id) ;
864
+ ( * msg) . clone( )
865
+ } ,
866
+ _ => panic!( "Unexpected event {:?}" , events[ 0 ] ) ,
871
867
}
872
- }
868
+ } } ;
873
869
}
874
870
875
871
/// Get an error message from the pending events queue.
@@ -930,11 +926,10 @@ pub fn get_htlc_update_msgs(node: &Node, recipient: &PublicKey) -> msgs::Commitm
930
926
/// Gets an UpdateHTLCs MessageSendEvent
931
927
///
932
928
/// Don't use this, use the identically-named function instead.
933
- #[ rustfmt:: skip]
934
929
macro_rules! get_htlc_update_msgs {
935
930
( $node: expr, $node_id: expr) => {
936
931
$crate:: ln:: functional_test_utils:: get_htlc_update_msgs( & $node, & $node_id)
937
- }
932
+ } ;
938
933
}
939
934
940
935
/// Fetches the first `msg_event` to the passed `node_id` in the passed `msg_events` vec.
@@ -1108,24 +1103,19 @@ macro_rules! get_channel_type_features {
1108
1103
1109
1104
/// Returns a channel monitor given a channel id, making some naive assumptions
1110
1105
#[ macro_export]
1111
- #[ rustfmt:: skip]
1112
1106
macro_rules! get_monitor {
1113
- ( $node: expr, $channel_id: expr) => {
1114
- {
1115
- $node. chain_monitor. chain_monitor. get_monitor( $channel_id) . unwrap( )
1116
- }
1117
- }
1107
+ ( $node: expr, $channel_id: expr) => { {
1108
+ $node. chain_monitor. chain_monitor. get_monitor( $channel_id) . unwrap( )
1109
+ } } ;
1118
1110
}
1119
1111
1120
1112
/// Returns any local commitment transactions for the channel.
1121
1113
#[ macro_export]
1122
- #[ rustfmt:: skip]
1123
1114
macro_rules! get_local_commitment_txn {
1124
- ( $node: expr, $channel_id: expr) => {
1125
- {
1126
- $crate:: get_monitor!( $node, $channel_id) . unsafe_get_latest_holder_commitment_txn( & $node. logger)
1127
- }
1128
- }
1115
+ ( $node: expr, $channel_id: expr) => { {
1116
+ $crate:: get_monitor!( $node, $channel_id)
1117
+ . unsafe_get_latest_holder_commitment_txn( & $node. logger)
1118
+ } } ;
1129
1119
}
1130
1120
1131
1121
/// Check the error from attempting a payment.
@@ -1176,11 +1166,10 @@ pub fn check_added_monitors<CM: AChannelManager, H: NodeHolder<CM = CM>>(node: &
1176
1166
///
1177
1167
/// Don't use this, use the identically-named function instead.
1178
1168
#[ macro_export]
1179
- #[ rustfmt:: skip]
1180
1169
macro_rules! check_added_monitors {
1181
1170
( $node: expr, $count: expr) => {
1182
1171
$crate:: ln:: functional_test_utils:: check_added_monitors( & $node, $count) ;
1183
- }
1172
+ } ;
1184
1173
}
1185
1174
1186
1175
#[ rustfmt:: skip]
@@ -1828,11 +1817,10 @@ pub fn check_closed_broadcast(node: &Node, num_channels: usize, with_error_msg:
1828
1817
///
1829
1818
/// Don't use this, use the identically-named function instead.
1830
1819
#[ macro_export]
1831
- #[ rustfmt:: skip]
1832
1820
macro_rules! check_closed_broadcast {
1833
1821
( $node: expr, $with_error_msg: expr) => {
1834
1822
$crate:: ln:: functional_test_utils:: check_closed_broadcast( & $node, 1 , $with_error_msg) . pop( )
1835
- }
1823
+ } ;
1836
1824
}
1837
1825
1838
1826
#[ derive( Default ) ]
@@ -1926,15 +1914,27 @@ pub fn check_closed_event(node: &Node, events_count: usize, expected_reason: Clo
1926
1914
///
1927
1915
/// Don't use this, use the identically-named function instead.
1928
1916
#[ macro_export]
1929
- #[ rustfmt:: skip]
1930
1917
macro_rules! check_closed_event {
1931
1918
( $node: expr, $events: expr, $reason: expr, $counterparty_node_ids: expr, $channel_capacity: expr) => {
1932
- check_closed_event!( $node, $events, $reason, false , $counterparty_node_ids, $channel_capacity) ;
1919
+ check_closed_event!(
1920
+ $node,
1921
+ $events,
1922
+ $reason,
1923
+ false ,
1924
+ $counterparty_node_ids,
1925
+ $channel_capacity
1926
+ ) ;
1933
1927
} ;
1934
1928
( $node: expr, $events: expr, $reason: expr, $is_check_discard_funding: expr, $counterparty_node_ids: expr, $channel_capacity: expr) => {
1935
- $crate:: ln:: functional_test_utils:: check_closed_event( & $node, $events, $reason,
1936
- $is_check_discard_funding, & $counterparty_node_ids, $channel_capacity) ;
1937
- }
1929
+ $crate:: ln:: functional_test_utils:: check_closed_event(
1930
+ & $node,
1931
+ $events,
1932
+ $reason,
1933
+ $is_check_discard_funding,
1934
+ & $counterparty_node_ids,
1935
+ $channel_capacity,
1936
+ ) ;
1937
+ } ;
1938
1938
}
1939
1939
1940
1940
#[ rustfmt:: skip]
@@ -2303,7 +2303,6 @@ pub fn get_payment_preimage_hash(recipient: &Node, min_value_msat: Option<u64>,
2303
2303
///
2304
2304
/// Don't use this, use the identically-named function instead.
2305
2305
#[ macro_export]
2306
- #[ rustfmt:: skip]
2307
2306
macro_rules! get_payment_preimage_hash {
2308
2307
( $dest_node: expr) => {
2309
2308
get_payment_preimage_hash!( $dest_node, None )
@@ -2312,7 +2311,11 @@ macro_rules! get_payment_preimage_hash {
2312
2311
crate :: get_payment_preimage_hash!( $dest_node, $min_value_msat, None )
2313
2312
} ;
2314
2313
( $dest_node: expr, $min_value_msat: expr, $min_final_cltv_expiry_delta: expr) => {
2315
- $crate:: ln:: functional_test_utils:: get_payment_preimage_hash( & $dest_node, $min_value_msat, $min_final_cltv_expiry_delta)
2314
+ $crate:: ln:: functional_test_utils:: get_payment_preimage_hash(
2315
+ & $dest_node,
2316
+ $min_value_msat,
2317
+ $min_final_cltv_expiry_delta,
2318
+ )
2316
2319
} ;
2317
2320
}
2318
2321
@@ -2355,24 +2358,41 @@ macro_rules! get_route {
2355
2358
}
2356
2359
2357
2360
#[ macro_export]
2358
- #[ rustfmt:: skip]
2359
2361
macro_rules! get_route_and_payment_hash {
2360
2362
( $send_node: expr, $recv_node: expr, $recv_value: expr) => { {
2361
- let payment_params = $crate:: routing:: router:: PaymentParameters :: from_node_id( $recv_node. node. get_our_node_id( ) , TEST_FINAL_CLTV )
2362
- . with_bolt11_features( $recv_node. node. bolt11_invoice_features( ) ) . unwrap( ) ;
2363
+ let payment_params = $crate:: routing:: router:: PaymentParameters :: from_node_id(
2364
+ $recv_node. node. get_our_node_id( ) ,
2365
+ TEST_FINAL_CLTV ,
2366
+ )
2367
+ . with_bolt11_features( $recv_node. node. bolt11_invoice_features( ) )
2368
+ . unwrap( ) ;
2363
2369
$crate:: get_route_and_payment_hash!( $send_node, $recv_node, payment_params, $recv_value)
2364
2370
} } ;
2365
2371
( $send_node: expr, $recv_node: expr, $payment_params: expr, $recv_value: expr) => { {
2366
- $crate:: get_route_and_payment_hash!( $send_node, $recv_node, $payment_params, $recv_value, None )
2372
+ $crate:: get_route_and_payment_hash!(
2373
+ $send_node,
2374
+ $recv_node,
2375
+ $payment_params,
2376
+ $recv_value,
2377
+ None
2378
+ )
2367
2379
} } ;
2368
2380
( $send_node: expr, $recv_node: expr, $payment_params: expr, $recv_value: expr, $max_total_routing_fee_msat: expr) => { {
2369
- let mut route_params = $crate:: routing:: router:: RouteParameters :: from_payment_params_and_value( $payment_params, $recv_value) ;
2381
+ let mut route_params =
2382
+ $crate:: routing:: router:: RouteParameters :: from_payment_params_and_value(
2383
+ $payment_params,
2384
+ $recv_value,
2385
+ ) ;
2370
2386
route_params. max_total_routing_fee_msat = $max_total_routing_fee_msat;
2371
2387
let ( payment_preimage, payment_hash, payment_secret) =
2372
- $crate:: ln:: functional_test_utils:: get_payment_preimage_hash( & $recv_node, Some ( $recv_value) , None ) ;
2388
+ $crate:: ln:: functional_test_utils:: get_payment_preimage_hash(
2389
+ & $recv_node,
2390
+ Some ( $recv_value) ,
2391
+ None ,
2392
+ ) ;
2373
2393
let route = $crate:: ln:: functional_test_utils:: get_route( & $send_node, & route_params) ;
2374
2394
( route. unwrap( ) , payment_hash, payment_preimage, payment_secret)
2375
- } }
2395
+ } } ;
2376
2396
}
2377
2397
2378
2398
#[ rustfmt:: skip]
@@ -2485,22 +2505,30 @@ pub fn expect_payment_sent<CM: AChannelManager, H: NodeHolder<CM=CM>>(node: &H,
2485
2505
}
2486
2506
2487
2507
#[ macro_export]
2488
- #[ rustfmt:: skip]
2489
2508
macro_rules! expect_payment_sent {
2490
2509
( $node: expr, $expected_payment_preimage: expr) => {
2491
2510
$crate:: expect_payment_sent!( $node, $expected_payment_preimage, None :: <u64 >, true )
2492
2511
} ;
2493
2512
( $node: expr, $expected_payment_preimage: expr, $expected_fee_msat_opt: expr) => {
2494
- $crate:: expect_payment_sent!( $node, $expected_payment_preimage, $expected_fee_msat_opt, true )
2513
+ $crate:: expect_payment_sent!(
2514
+ $node,
2515
+ $expected_payment_preimage,
2516
+ $expected_fee_msat_opt,
2517
+ true
2518
+ )
2495
2519
} ;
2496
2520
( $node: expr, $expected_payment_preimage: expr, $expected_fee_msat_opt: expr, $expect_paths: expr) => {
2497
- $crate:: ln:: functional_test_utils:: expect_payment_sent( & $node, $expected_payment_preimage,
2498
- $expected_fee_msat_opt. map( |o| Some ( o) ) , $expect_paths, true )
2499
- }
2521
+ $crate:: ln:: functional_test_utils:: expect_payment_sent(
2522
+ & $node,
2523
+ $expected_payment_preimage,
2524
+ $expected_fee_msat_opt. map( |o| Some ( o) ) ,
2525
+ $expect_paths,
2526
+ true ,
2527
+ )
2528
+ } ;
2500
2529
}
2501
2530
2502
2531
#[ macro_export]
2503
- #[ rustfmt:: skip]
2504
2532
macro_rules! expect_payment_path_successful {
2505
2533
( $node: expr) => {
2506
2534
let events = $node. node. get_and_clear_pending_events( ) ;
@@ -2509,7 +2537,7 @@ macro_rules! expect_payment_path_successful {
2509
2537
$crate:: events:: Event :: PaymentPathSuccessful { .. } => { } ,
2510
2538
_ => panic!( "Unexpected event" ) ,
2511
2539
}
2512
- }
2540
+ } ;
2513
2541
}
2514
2542
2515
2543
/// Returns the total fee earned by this HTLC forward, in msat.
0 commit comments