@@ -336,10 +336,11 @@ pub fn create_chan_between_nodes_with_value<'a, 'b, 'c, 'd>(node_a: &'a Node<'b,
336
336
}
337
337
338
338
#[ macro_export]
339
+ /// Gets an RAA and CS which were sent in response to a commitment update
339
340
macro_rules! get_revoke_commit_msgs {
340
341
( $node: expr, $node_id: expr) => {
341
342
{
342
- use util:: events:: MessageSendEvent ;
343
+ use $crate :: util:: events:: MessageSendEvent ;
343
344
let events = $node. node. get_and_clear_pending_msg_events( ) ;
344
345
assert_eq!( events. len( ) , 2 ) ;
345
346
( match events[ 0 ] {
@@ -400,8 +401,8 @@ macro_rules! get_event {
400
401
}
401
402
}
402
403
403
- #[ cfg( test) ]
404
404
#[ macro_export]
405
+ /// Gets an UpdateHTLCs MessageSendEvent
405
406
macro_rules! get_htlc_update_msgs {
406
407
( $node: expr, $node_id: expr) => {
407
408
{
@@ -933,6 +934,9 @@ impl SendEvent {
933
934
}
934
935
}
935
936
937
+ #[ macro_export]
938
+ /// Performs the "commitment signed dance" - the series of message exchanges which occur after a
939
+ /// commitment update.
936
940
macro_rules! commitment_signed_dance {
937
941
( $node_a: expr, $node_b: expr, $commitment_signed: expr, $fail_backwards: expr, true /* skip last step */ ) => {
938
942
{
@@ -999,7 +1003,7 @@ macro_rules! commitment_signed_dance {
999
1003
{
1000
1004
commitment_signed_dance!( $node_a, $node_b, $commitment_signed, $fail_backwards, true ) ;
1001
1005
if $fail_backwards {
1002
- expect_pending_htlcs_forwardable!( $node_a) ;
1006
+ $crate :: expect_pending_htlcs_forwardable!( $node_a) ;
1003
1007
check_added_monitors!( $node_a, 1 ) ;
1004
1008
1005
1009
let channel_state = $node_a. node. channel_state. lock( ) . unwrap( ) ;
@@ -1057,6 +1061,8 @@ macro_rules! get_route_and_payment_hash {
1057
1061
} }
1058
1062
}
1059
1063
1064
+ #[ macro_export]
1065
+ /// Clears (and ignores) a PendingHTLCsForwardable event
1060
1066
macro_rules! expect_pending_htlcs_forwardable_ignore {
1061
1067
( $node: expr) => { {
1062
1068
let events = $node. node. get_and_clear_pending_events( ) ;
@@ -1068,9 +1074,11 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
1068
1074
} }
1069
1075
}
1070
1076
1077
+ #[ macro_export]
1078
+ /// Handles a PendingHTLCsForwardable event
1071
1079
macro_rules! expect_pending_htlcs_forwardable {
1072
1080
( $node: expr) => { {
1073
- expect_pending_htlcs_forwardable_ignore!( $node) ;
1081
+ $crate :: expect_pending_htlcs_forwardable_ignore!( $node) ;
1074
1082
$node. node. process_pending_htlc_forwards( ) ;
1075
1083
1076
1084
// Ensure process_pending_htlc_forwards is idempotent.
0 commit comments