@@ -841,30 +841,26 @@ pub fn get_updates_and_revoke<CM: AChannelManager, H: NodeHolder<CM=CM>>(node: &
841
841
/// Gets an RAA and CS which were sent in response to a commitment update
842
842
///
843
843
/// Don't use this, use the identically-named function instead.
844
- #[ rustfmt:: skip]
845
844
macro_rules! get_revoke_commit_msgs {
846
845
( $node: expr, $node_id: expr) => {
847
846
$crate:: ln:: functional_test_utils:: get_revoke_commit_msgs( & $node, & $node_id)
848
- }
847
+ } ;
849
848
}
850
849
851
850
/// Get an specific event message from the pending events queue.
852
851
#[ macro_export]
853
- #[ rustfmt:: skip]
854
852
macro_rules! get_event_msg {
855
- ( $node: expr, $event_type: path, $node_id: expr) => {
856
- {
857
- let events = $node. node. get_and_clear_pending_msg_events( ) ;
858
- assert_eq!( events. len( ) , 1 ) ;
859
- match events[ 0 ] {
860
- $event_type { ref node_id, ref msg } => {
861
- assert_eq!( * node_id, $node_id) ;
862
- ( * msg) . clone( )
863
- } ,
864
- _ => panic!( "Unexpected event {:?}" , events[ 0 ] ) ,
865
- }
853
+ ( $node: expr, $event_type: path, $node_id: expr) => { {
854
+ let events = $node. node. get_and_clear_pending_msg_events( ) ;
855
+ assert_eq!( events. len( ) , 1 ) ;
856
+ match events[ 0 ] {
857
+ $event_type { ref node_id, ref msg } => {
858
+ assert_eq!( * node_id, $node_id) ;
859
+ ( * msg) . clone( )
860
+ } ,
861
+ _ => panic!( "Unexpected event {:?}" , events[ 0 ] ) ,
866
862
}
867
- }
863
+ } } ;
868
864
}
869
865
870
866
/// Get an error message from the pending events queue.
@@ -925,11 +921,10 @@ pub fn get_htlc_update_msgs(node: &Node, recipient: &PublicKey) -> msgs::Commitm
925
921
/// Gets an UpdateHTLCs MessageSendEvent
926
922
///
927
923
/// Don't use this, use the identically-named function instead.
928
- #[ rustfmt:: skip]
929
924
macro_rules! get_htlc_update_msgs {
930
925
( $node: expr, $node_id: expr) => {
931
926
$crate:: ln:: functional_test_utils:: get_htlc_update_msgs( & $node, & $node_id)
932
- }
927
+ } ;
933
928
}
934
929
935
930
/// Fetches the first `msg_event` to the passed `node_id` in the passed `msg_events` vec.
@@ -1103,24 +1098,19 @@ macro_rules! get_channel_type_features {
1103
1098
1104
1099
/// Returns a channel monitor given a channel id, making some naive assumptions
1105
1100
#[ macro_export]
1106
- #[ rustfmt:: skip]
1107
1101
macro_rules! get_monitor {
1108
- ( $node: expr, $channel_id: expr) => {
1109
- {
1110
- $node. chain_monitor. chain_monitor. get_monitor( $channel_id) . unwrap( )
1111
- }
1112
- }
1102
+ ( $node: expr, $channel_id: expr) => { {
1103
+ $node. chain_monitor. chain_monitor. get_monitor( $channel_id) . unwrap( )
1104
+ } } ;
1113
1105
}
1114
1106
1115
1107
/// Returns any local commitment transactions for the channel.
1116
1108
#[ macro_export]
1117
- #[ rustfmt:: skip]
1118
1109
macro_rules! get_local_commitment_txn {
1119
- ( $node: expr, $channel_id: expr) => {
1120
- {
1121
- $crate:: get_monitor!( $node, $channel_id) . unsafe_get_latest_holder_commitment_txn( & $node. logger)
1122
- }
1123
- }
1110
+ ( $node: expr, $channel_id: expr) => { {
1111
+ $crate:: get_monitor!( $node, $channel_id)
1112
+ . unsafe_get_latest_holder_commitment_txn( & $node. logger)
1113
+ } } ;
1124
1114
}
1125
1115
1126
1116
/// Check the error from attempting a payment.
@@ -1172,11 +1162,10 @@ pub fn check_added_monitors<CM: AChannelManager, H: NodeHolder<CM=CM>>(node: &H,
1172
1162
///
1173
1163
/// Don't use this, use the identically-named function instead.
1174
1164
#[ macro_export]
1175
- #[ rustfmt:: skip]
1176
1165
macro_rules! check_added_monitors {
1177
1166
( $node: expr, $count: expr) => {
1178
1167
$crate:: ln:: functional_test_utils:: check_added_monitors( & $node, $count) ;
1179
- }
1168
+ } ;
1180
1169
}
1181
1170
1182
1171
#[ rustfmt:: skip]
@@ -1818,11 +1807,10 @@ pub fn check_closed_broadcast(node: &Node, num_channels: usize, with_error_msg:
1818
1807
///
1819
1808
/// Don't use this, use the identically-named function instead.
1820
1809
#[ macro_export]
1821
- #[ rustfmt:: skip]
1822
1810
macro_rules! check_closed_broadcast {
1823
1811
( $node: expr, $with_error_msg: expr) => {
1824
1812
$crate:: ln:: functional_test_utils:: check_closed_broadcast( & $node, 1 , $with_error_msg) . pop( )
1825
- }
1813
+ } ;
1826
1814
}
1827
1815
1828
1816
#[ derive( Default ) ]
@@ -1915,15 +1903,27 @@ pub fn check_closed_event(node: &Node, events_count: usize, expected_reason: Clo
1915
1903
///
1916
1904
/// Don't use this, use the identically-named function instead.
1917
1905
#[ macro_export]
1918
- #[ rustfmt:: skip]
1919
1906
macro_rules! check_closed_event {
1920
1907
( $node: expr, $events: expr, $reason: expr, $counterparty_node_ids: expr, $channel_capacity: expr) => {
1921
- check_closed_event!( $node, $events, $reason, false , $counterparty_node_ids, $channel_capacity) ;
1908
+ check_closed_event!(
1909
+ $node,
1910
+ $events,
1911
+ $reason,
1912
+ false ,
1913
+ $counterparty_node_ids,
1914
+ $channel_capacity
1915
+ ) ;
1922
1916
} ;
1923
1917
( $node: expr, $events: expr, $reason: expr, $is_check_discard_funding: expr, $counterparty_node_ids: expr, $channel_capacity: expr) => {
1924
- $crate:: ln:: functional_test_utils:: check_closed_event( & $node, $events, $reason,
1925
- $is_check_discard_funding, & $counterparty_node_ids, $channel_capacity) ;
1926
- }
1918
+ $crate:: ln:: functional_test_utils:: check_closed_event(
1919
+ & $node,
1920
+ $events,
1921
+ $reason,
1922
+ $is_check_discard_funding,
1923
+ & $counterparty_node_ids,
1924
+ $channel_capacity,
1925
+ ) ;
1926
+ } ;
1927
1927
}
1928
1928
1929
1929
#[ rustfmt:: skip]
@@ -2292,7 +2292,6 @@ pub fn get_payment_preimage_hash(recipient: &Node, min_value_msat: Option<u64>,
2292
2292
///
2293
2293
/// Don't use this, use the identically-named function instead.
2294
2294
#[ macro_export]
2295
- #[ rustfmt:: skip]
2296
2295
macro_rules! get_payment_preimage_hash {
2297
2296
( $dest_node: expr) => {
2298
2297
get_payment_preimage_hash!( $dest_node, None )
@@ -2301,7 +2300,11 @@ macro_rules! get_payment_preimage_hash {
2301
2300
crate :: get_payment_preimage_hash!( $dest_node, $min_value_msat, None )
2302
2301
} ;
2303
2302
( $dest_node: expr, $min_value_msat: expr, $min_final_cltv_expiry_delta: expr) => {
2304
- $crate:: ln:: functional_test_utils:: get_payment_preimage_hash( & $dest_node, $min_value_msat, $min_final_cltv_expiry_delta)
2303
+ $crate:: ln:: functional_test_utils:: get_payment_preimage_hash(
2304
+ & $dest_node,
2305
+ $min_value_msat,
2306
+ $min_final_cltv_expiry_delta,
2307
+ )
2305
2308
} ;
2306
2309
}
2307
2310
@@ -2344,24 +2347,41 @@ macro_rules! get_route {
2344
2347
}
2345
2348
2346
2349
#[ macro_export]
2347
- #[ rustfmt:: skip]
2348
2350
macro_rules! get_route_and_payment_hash {
2349
2351
( $send_node: expr, $recv_node: expr, $recv_value: expr) => { {
2350
- let payment_params = $crate:: routing:: router:: PaymentParameters :: from_node_id( $recv_node. node. get_our_node_id( ) , TEST_FINAL_CLTV )
2351
- . with_bolt11_features( $recv_node. node. bolt11_invoice_features( ) ) . unwrap( ) ;
2352
+ let payment_params = $crate:: routing:: router:: PaymentParameters :: from_node_id(
2353
+ $recv_node. node. get_our_node_id( ) ,
2354
+ TEST_FINAL_CLTV ,
2355
+ )
2356
+ . with_bolt11_features( $recv_node. node. bolt11_invoice_features( ) )
2357
+ . unwrap( ) ;
2352
2358
$crate:: get_route_and_payment_hash!( $send_node, $recv_node, payment_params, $recv_value)
2353
2359
} } ;
2354
2360
( $send_node: expr, $recv_node: expr, $payment_params: expr, $recv_value: expr) => { {
2355
- $crate:: get_route_and_payment_hash!( $send_node, $recv_node, $payment_params, $recv_value, None )
2361
+ $crate:: get_route_and_payment_hash!(
2362
+ $send_node,
2363
+ $recv_node,
2364
+ $payment_params,
2365
+ $recv_value,
2366
+ None
2367
+ )
2356
2368
} } ;
2357
2369
( $send_node: expr, $recv_node: expr, $payment_params: expr, $recv_value: expr, $max_total_routing_fee_msat: expr) => { {
2358
- let mut route_params = $crate:: routing:: router:: RouteParameters :: from_payment_params_and_value( $payment_params, $recv_value) ;
2370
+ let mut route_params =
2371
+ $crate:: routing:: router:: RouteParameters :: from_payment_params_and_value(
2372
+ $payment_params,
2373
+ $recv_value,
2374
+ ) ;
2359
2375
route_params. max_total_routing_fee_msat = $max_total_routing_fee_msat;
2360
2376
let ( payment_preimage, payment_hash, payment_secret) =
2361
- $crate:: ln:: functional_test_utils:: get_payment_preimage_hash( & $recv_node, Some ( $recv_value) , None ) ;
2377
+ $crate:: ln:: functional_test_utils:: get_payment_preimage_hash(
2378
+ & $recv_node,
2379
+ Some ( $recv_value) ,
2380
+ None ,
2381
+ ) ;
2362
2382
let route = $crate:: ln:: functional_test_utils:: get_route( & $send_node, & route_params) ;
2363
2383
( route. unwrap( ) , payment_hash, payment_preimage, payment_secret)
2364
- } }
2384
+ } } ;
2365
2385
}
2366
2386
2367
2387
#[ rustfmt:: skip]
@@ -2474,22 +2494,30 @@ pub fn expect_payment_sent<CM: AChannelManager, H: NodeHolder<CM=CM>>(node: &H,
2474
2494
}
2475
2495
2476
2496
#[ macro_export]
2477
- #[ rustfmt:: skip]
2478
2497
macro_rules! expect_payment_sent {
2479
2498
( $node: expr, $expected_payment_preimage: expr) => {
2480
2499
$crate:: expect_payment_sent!( $node, $expected_payment_preimage, None :: <u64 >, true )
2481
2500
} ;
2482
2501
( $node: expr, $expected_payment_preimage: expr, $expected_fee_msat_opt: expr) => {
2483
- $crate:: expect_payment_sent!( $node, $expected_payment_preimage, $expected_fee_msat_opt, true )
2502
+ $crate:: expect_payment_sent!(
2503
+ $node,
2504
+ $expected_payment_preimage,
2505
+ $expected_fee_msat_opt,
2506
+ true
2507
+ )
2484
2508
} ;
2485
2509
( $node: expr, $expected_payment_preimage: expr, $expected_fee_msat_opt: expr, $expect_paths: expr) => {
2486
- $crate:: ln:: functional_test_utils:: expect_payment_sent( & $node, $expected_payment_preimage,
2487
- $expected_fee_msat_opt. map( |o| Some ( o) ) , $expect_paths, true )
2488
- }
2510
+ $crate:: ln:: functional_test_utils:: expect_payment_sent(
2511
+ & $node,
2512
+ $expected_payment_preimage,
2513
+ $expected_fee_msat_opt. map( |o| Some ( o) ) ,
2514
+ $expect_paths,
2515
+ true ,
2516
+ )
2517
+ } ;
2489
2518
}
2490
2519
2491
2520
#[ macro_export]
2492
- #[ rustfmt:: skip]
2493
2521
macro_rules! expect_payment_path_successful {
2494
2522
( $node: expr) => {
2495
2523
let events = $node. node. get_and_clear_pending_events( ) ;
@@ -2498,7 +2526,7 @@ macro_rules! expect_payment_path_successful {
2498
2526
$crate:: events:: Event :: PaymentPathSuccessful { .. } => { } ,
2499
2527
_ => panic!( "Unexpected event" ) ,
2500
2528
}
2501
- }
2529
+ } ;
2502
2530
}
2503
2531
2504
2532
/// Returns the total fee earned by this HTLC forward, in msat.
0 commit comments