X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ffunctional_test_utils.rs;h=a2d9631716c4c23098135a8f95ee37a1fc5a6949;hb=c80d9a74b5437dd7c82fab40806adeb995219fc2;hp=5828ca8038ca241a8d8c6d96464cbe3555bfc1ef;hpb=9856fb67106316ca66ef278cdc0cac9a52fad763;p=rust-lightning diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 5828ca80..a2d96317 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -1536,6 +1536,18 @@ pub struct ExpectedCloseEvent { pub reason: Option, } +impl ExpectedCloseEvent { + pub fn from_id_reason(channel_id: ChannelId, discard_funding: bool, reason: ClosureReason) -> Self { + Self { + channel_capacity_sats: None, + channel_id: Some(channel_id), + counterparty_node_id: None, + discard_funding, + reason: Some(reason), + } + } +} + /// Check that multiple channel closing events have been issued. pub fn check_closed_events(node: &Node, expected_close_events: &[ExpectedCloseEvent]) { let closed_events_count = expected_close_events.len();