Skip to content

Commit febe8ef

Browse files
committed
Export several additional macros from functional_test_utils
...and clean up their use of references to imported/local structs.
1 parent ea89286 commit febe8ef

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,11 @@ pub fn create_chan_between_nodes_with_value<'a, 'b, 'c, 'd>(node_a: &'a Node<'b,
337337
(announcement, as_update, bs_update, channel_id, tx)
338338
}
339339

340+
#[macro_export]
340341
macro_rules! get_revoke_commit_msgs {
341342
($node: expr, $node_id: expr) => {
342343
{
344+
use $crate::util::events::MessageSendEvent;
343345
let events = $node.node.get_and_clear_pending_msg_events();
344346
assert_eq!(events.len(), 2);
345347
(match events[0] {
@@ -400,7 +402,7 @@ macro_rules! get_event {
400402
}
401403
}
402404

403-
#[cfg(test)]
405+
#[macro_export]
404406
macro_rules! get_htlc_update_msgs {
405407
($node: expr, $node_id: expr) => {
406408
{
@@ -921,6 +923,7 @@ impl SendEvent {
921923
}
922924
}
923925

926+
#[macro_export]
924927
macro_rules! commitment_signed_dance {
925928
($node_a: expr, $node_b: expr, $commitment_signed: expr, $fail_backwards: expr, true /* skip last step */) => {
926929
{
@@ -987,7 +990,7 @@ macro_rules! commitment_signed_dance {
987990
{
988991
commitment_signed_dance!($node_a, $node_b, $commitment_signed, $fail_backwards, true);
989992
if $fail_backwards {
990-
expect_pending_htlcs_forwardable!($node_a);
993+
$crate::expect_pending_htlcs_forwardable!($node_a);
991994
check_added_monitors!($node_a, 1);
992995

993996
let channel_state = $node_a.node.channel_state.lock().unwrap();
@@ -1042,6 +1045,7 @@ macro_rules! get_route_and_payment_hash {
10421045
}}
10431046
}
10441047

1048+
#[macro_export]
10451049
macro_rules! expect_pending_htlcs_forwardable_ignore {
10461050
($node: expr) => {{
10471051
let events = $node.node.get_and_clear_pending_events();
@@ -1053,9 +1057,10 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
10531057
}}
10541058
}
10551059

1060+
#[macro_export]
10561061
macro_rules! expect_pending_htlcs_forwardable {
10571062
($node: expr) => {{
1058-
expect_pending_htlcs_forwardable_ignore!($node);
1063+
$crate::expect_pending_htlcs_forwardable_ignore!($node);
10591064
$node.node.process_pending_htlc_forwards();
10601065
}}
10611066
}

0 commit comments

Comments
 (0)