Skip to content

Commit 21a7cfd

Browse files
committed
Update tests according to tparameterised errors.
TestLogger now has two additional methods 1. `assert_log_contains` which checks the logged messsage has entry which includes the specified string as a substring. 2. `aasert_log_regex` mostly same with above but it is more flexible that caller specifies regex which has to be satisfied instead of just a substring.
1 parent ede746a commit 21a7cfd

File tree

4 files changed

+57
-39
lines changed

4 files changed

+57
-39
lines changed

lightning/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ features = ["bitcoinconsensus"]
2828

2929
[dev-dependencies]
3030
hex = "0.3"
31+
regex = "1.3.9"

lightning/src/ln/functional_tests.rs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ fn test_insane_channel_opens() {
7777
nodes[1].node.handle_open_channel(&nodes[0].node.get_our_node_id(), InitFeatures::known(), &message_mutator(open_channel_message.clone()));
7878
let msg_events = nodes[1].node.get_and_clear_pending_msg_events();
7979
assert_eq!(msg_events.len(), 1);
80+
let expected_regex = regex::Regex::new(expected_error_str).unwrap();
8081
if let MessageSendEvent::HandleError { ref action, .. } = msg_events[0] {
8182
match action {
8283
&ErrorAction::SendErrorMessage { .. } => {
83-
nodes[1].logger.assert_log("lightning::ln::channelmanager".to_string(), expected_error_str.to_string(), 1);
84+
nodes[1].logger.assert_log_regex("lightning::ln::channelmanager".to_string(), expected_regex, 1);
8485
},
8586
_ => panic!("unexpected event!"),
8687
}
@@ -91,23 +92,23 @@ fn test_insane_channel_opens() {
9192
use ln::channelmanager::MAX_LOCAL_BREAKDOWN_TIMEOUT;
9293

9394
// Test all mutations that would make the channel open message insane
94-
insane_open_helper("funding value > 2^24", |mut msg| { msg.funding_satoshis = MAX_FUNDING_SATOSHIS; msg });
95+
insane_open_helper(format!("funding must be smaller than {}. It was {}", MAX_FUNDING_SATOSHIS, MAX_FUNDING_SATOSHIS).as_str(), |mut msg| { msg.funding_satoshis = MAX_FUNDING_SATOSHIS; msg });
9596

9697
insane_open_helper("Bogus channel_reserve_satoshis", |mut msg| { msg.channel_reserve_satoshis = msg.funding_satoshis + 1; msg });
9798

98-
insane_open_helper("push_msat larger than funding value", |mut msg| { msg.push_msat = (msg.funding_satoshis - msg.channel_reserve_satoshis) * 1000 + 1; msg });
99+
insane_open_helper(r"push_msat \d+ was larger than funding value \d+", |mut msg| { msg.push_msat = (msg.funding_satoshis - msg.channel_reserve_satoshis) * 1000 + 1; msg });
99100

100101
insane_open_helper("Peer never wants payout outputs?", |mut msg| { msg.dust_limit_satoshis = msg.funding_satoshis + 1 ; msg });
101102

102-
insane_open_helper("Bogus; channel reserve is less than dust limit", |mut msg| { msg.dust_limit_satoshis = msg.channel_reserve_satoshis + 1; msg });
103+
insane_open_helper(r"Bogus; channel reserve\(\d+\) is less than dust limit \(\d+\)", |mut msg| { msg.dust_limit_satoshis = msg.channel_reserve_satoshis + 1; msg });
103104

104-
insane_open_helper("Minimum htlc value is full channel value", |mut msg| { msg.htlc_minimum_msat = (msg.funding_satoshis - msg.channel_reserve_satoshis) * 1000; msg });
105+
insane_open_helper(r"Minimum htlc value \(\d+\) is full channel value \(\d+\)", |mut msg| { msg.htlc_minimum_msat = (msg.funding_satoshis - msg.channel_reserve_satoshis) * 1000; msg });
105106

106107
insane_open_helper("They wanted our payments to be delayed by a needlessly long period", |mut msg| { msg.to_self_delay = MAX_LOCAL_BREAKDOWN_TIMEOUT + 1; msg });
107108

108109
insane_open_helper("0 max_accpted_htlcs makes for a useless channel", |mut msg| { msg.max_accepted_htlcs = 0; msg });
109110

110-
insane_open_helper("max_accpted_htlcs > 483", |mut msg| { msg.max_accepted_htlcs = 484; msg });
111+
insane_open_helper("max_accpted_htlcs was 484. it must not be larger than 483", |mut msg| { msg.max_accepted_htlcs = 484; msg });
111112
}
112113

113114
#[test]
@@ -1270,7 +1271,7 @@ fn fake_network_test() {
12701271
route_over_limit(&nodes[0], &vec!(&nodes[1], &nodes[3])[..], 3000000);
12711272
let events = nodes[0].node.get_and_clear_pending_msg_events();
12721273
assert_eq!(events.len(), 0);
1273-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
1274+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
12741275

12751276
//TODO: Test that routes work again here as we've been notified that the channel is full
12761277

@@ -1324,7 +1325,7 @@ fn holding_cell_htlc_counting() {
13241325
unwrap_send_err!(nodes[1].node.send_payment(&route, payment_hash_1, &None), true, APIError::ChannelUnavailable { err },
13251326
assert!(err.contains("Cannot push more than their max accepted HTLCs")));
13261327
assert!(nodes[1].node.get_and_clear_pending_msg_events().is_empty());
1327-
nodes[1].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot push more than their max accepted HTLCs".to_string(), 1);
1328+
nodes[1].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot push more than their max accepted HTLCs".to_string(), 1);
13281329
}
13291330

13301331
// This should also be true if we try to forward a payment.
@@ -1542,14 +1543,14 @@ fn test_basic_channel_reserve() {
15421543
PaymentSendFailure::AllFailedRetrySafe(ref fails) => {
15431544
match &fails[0] {
15441545
APIError::ChannelUnavailable{err} =>
1545-
assert_eq!(err, "Cannot send value that would put us under local channel reserve value"),
1546+
assert!(err.contains("Cannot send value that would put us under local channel reserve value")),
15461547
_ => panic!("Unexpected error variant"),
15471548
}
15481549
},
15491550
_ => panic!("Unexpected error variant"),
15501551
}
15511552
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
1552-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 1);
1553+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 1);
15531554

15541555
send_payment(&nodes[0], &vec![&nodes[1]], max_can_send, max_can_send);
15551556
}
@@ -1930,9 +1931,9 @@ fn test_channel_reserve_holding_cell_htlcs() {
19301931
let (route, our_payment_hash, _) = get_route_and_payment_hash!(recv_value_0 + 1);
19311932
assert!(route.paths[0].iter().rev().skip(1).all(|h| h.fee_msat == feemsat));
19321933
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
1933-
assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight our peer will accept (10000000)"));
1934+
assert!(err.contains("Cannot send value that would put us over the max HTLC value in flight our peer will accept")));
19341935
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
1935-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
1936+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
19361937
}
19371938

19381939
// channel reserve is bigger than their_max_htlc_value_in_flight_msat so loop to deplete
@@ -1994,7 +1995,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
19941995
{
19951996
let (route, our_payment_hash, _) = get_route_and_payment_hash!(recv_value_2 + 1);
19961997
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
1997-
assert_eq!(err, "Cannot send value that would put us under local channel reserve value"));
1998+
assert!(err.contains("Cannot send value that would put us under local channel reserve value")));
19981999
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
19992000
}
20002001

@@ -2020,9 +2021,9 @@ fn test_channel_reserve_holding_cell_htlcs() {
20202021
{
20212022
let (route, our_payment_hash, _) = get_route_and_payment_hash!(recv_value_22+1);
20222023
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
2023-
assert_eq!(err, "Cannot send value that would put us under local channel reserve value"));
2024+
assert!(err.contains("Cannot send value that would put us under local channel reserve value")));
20242025
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
2025-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 2);
2026+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 2);
20262027
}
20272028

20282029
let (route_22, our_payment_hash_22, our_payment_preimage_22) = get_route_and_payment_hash!(recv_value_22);
@@ -2107,14 +2108,14 @@ fn test_channel_reserve_holding_cell_htlcs() {
21072108
PaymentSendFailure::AllFailedRetrySafe(ref fails) => {
21082109
match &fails[0] {
21092110
APIError::ChannelUnavailable{err} =>
2110-
assert_eq!(err, "Cannot send value that would put us under local channel reserve value"),
2111+
assert!(err.contains("Cannot send value that would put us under local channel reserve value")),
21112112
_ => panic!("Unexpected error variant"),
21122113
}
21132114
},
21142115
_ => panic!("Unexpected error variant"),
21152116
}
21162117
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
2117-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 3);
2118+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us under local channel reserve value".to_string(), 3);
21182119
}
21192120

21202121
send_payment(&nodes[0], &vec![&nodes[1], &nodes[2]][..], recv_value_3, recv_value_3);
@@ -6404,9 +6405,9 @@ fn test_update_add_htlc_bolt2_sender_value_below_minimum_msat() {
64046405
route.paths[0][0].fee_msat = 100;
64056406

64066407
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
6407-
assert_eq!(err, "Cannot send less than their minimum HTLC value"));
6408+
assert!(err.contains("Cannot send less than their minimum HTLC value")));
64086409
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
6409-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send less than their minimum HTLC value".to_string(), 1);
6410+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send less than their minimum HTLC value".to_string(), 1);
64106411
}
64116412

64126413
#[test]
@@ -6427,7 +6428,7 @@ fn test_update_add_htlc_bolt2_sender_zero_value_msat() {
64276428
assert_eq!(err, "Cannot send 0-msat HTLC"));
64286429

64296430
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
6430-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send 0-msat HTLC".to_string(), 1);
6431+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send 0-msat HTLC".to_string(), 1);
64316432
}
64326433

64336434
#[test]
@@ -6514,10 +6515,10 @@ fn test_update_add_htlc_bolt2_sender_exceed_max_htlc_num_and_htlc_id_increment()
65146515
let net_graph_msg_handler = &nodes[0].net_graph_msg_handler;
65156516
let route = get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[1].node.get_our_node_id(), None, &[], 100000, TEST_FINAL_CLTV, &logger).unwrap();
65166517
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
6517-
assert_eq!(err, "Cannot push more than their max accepted HTLCs"));
6518+
assert!(err.contains("Cannot push more than their max accepted HTLCs")));
65186519

65196520
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
6520-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot push more than their max accepted HTLCs".to_string(), 1);
6521+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot push more than their max accepted HTLCs".to_string(), 1);
65216522
}
65226523

65236524
#[test]
@@ -6538,10 +6539,10 @@ fn test_update_add_htlc_bolt2_sender_exceed_max_htlc_value_in_flight() {
65386539
let logger = test_utils::TestLogger::new();
65396540
let route = get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[1].node.get_our_node_id(), None, &[], max_in_flight+1, TEST_FINAL_CLTV, &logger).unwrap();
65406541
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &None), true, APIError::ChannelUnavailable { err },
6541-
assert_eq!(err, "Cannot send value that would put us over the max HTLC value in flight our peer will accept"));
6542+
assert!(err.contains("Cannot send value that would put us over the max HTLC value in flight our peer will accept")));
65426543

65436544
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
6544-
nodes[0].logger.assert_log("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
6545+
nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1);
65456546

65466547
send_payment(&nodes[0], &[&nodes[1]], max_in_flight, max_in_flight);
65476548
}
@@ -6573,7 +6574,7 @@ fn test_update_add_htlc_bolt2_receiver_check_amount_received_more_than_min() {
65736574
nodes[1].node.handle_update_add_htlc(&nodes[0].node.get_our_node_id(), &updates.update_add_htlcs[0]);
65746575
assert!(nodes[1].node.list_channels().is_empty());
65756576
let err_msg = check_closed_broadcast!(nodes[1], true).unwrap();
6576-
assert_eq!(err_msg.data, "Remote side tried to send less than our minimum HTLC value");
6577+
assert!(err_msg.data.contains("Remote side tried to send less than our minimum HTLC value"));
65776578
check_added_monitors!(nodes[1], 1);
65786579
}
65796580

@@ -6653,7 +6654,7 @@ fn test_update_add_htlc_bolt2_receiver_check_max_htlc_limit() {
66536654

66546655
assert!(nodes[1].node.list_channels().is_empty());
66556656
let err_msg = check_closed_broadcast!(nodes[1], true).unwrap();
6656-
assert_eq!(err_msg.data, "Remote tried to push more than our max accepted HTLCs");
6657+
assert!(err_msg.data.contains("Remote tried to push more than our max accepted HTLCs"));
66576658
check_added_monitors!(nodes[1], 1);
66586659
}
66596660

@@ -6678,7 +6679,7 @@ fn test_update_add_htlc_bolt2_receiver_check_max_in_flight_msat() {
66786679

66796680
assert!(nodes[1].node.list_channels().is_empty());
66806681
let err_msg = check_closed_broadcast!(nodes[1], true).unwrap();
6681-
assert_eq!(err_msg.data,"Remote HTLC add would put them over our max HTLC value");
6682+
assert!(err_msg.data.contains("Remote HTLC add would put them over our max HTLC value"));
66826683
check_added_monitors!(nodes[1], 1);
66836684
}
66846685

@@ -6752,7 +6753,7 @@ fn test_update_add_htlc_bolt2_receiver_check_repeated_id_ignore() {
67526753

67536754
assert!(nodes[1].node.list_channels().is_empty());
67546755
let err_msg = check_closed_broadcast!(nodes[1], true).unwrap();
6755-
assert_eq!(err_msg.data, "Remote skipped HTLC ID");
6756+
assert!(err_msg.data.contains("Remote skipped HTLC ID"));
67566757
check_added_monitors!(nodes[1], 1);
67576758
}
67586759

@@ -6785,7 +6786,7 @@ fn test_update_fulfill_htlc_bolt2_update_fulfill_htlc_before_commitment() {
67856786

67866787
assert!(nodes[0].node.list_channels().is_empty());
67876788
let err_msg = check_closed_broadcast!(nodes[0], true).unwrap();
6788-
assert_eq!(err_msg.data, "Remote tried to fulfill/fail HTLC before it had been committed");
6789+
assert!(regex::Regex::new(r"Remote tried to fulfill/fail HTLC \(\d+\) before it had been committed").unwrap().is_match(err_msg.data.as_str()));
67896790
check_added_monitors!(nodes[0], 1);
67906791
}
67916792

@@ -6818,7 +6819,7 @@ fn test_update_fulfill_htlc_bolt2_update_fail_htlc_before_commitment() {
68186819

68196820
assert!(nodes[0].node.list_channels().is_empty());
68206821
let err_msg = check_closed_broadcast!(nodes[0], true).unwrap();
6821-
assert_eq!(err_msg.data, "Remote tried to fulfill/fail HTLC before it had been committed");
6822+
assert!(regex::Regex::new(r"Remote tried to fulfill/fail HTLC \(\d+\) before it had been committed").unwrap().is_match(err_msg.data.as_str()));
68226823
check_added_monitors!(nodes[0], 1);
68236824
}
68246825

@@ -6852,7 +6853,7 @@ fn test_update_fulfill_htlc_bolt2_update_fail_malformed_htlc_before_commitment()
68526853

68536854
assert!(nodes[0].node.list_channels().is_empty());
68546855
let err_msg = check_closed_broadcast!(nodes[0], true).unwrap();
6855-
assert_eq!(err_msg.data, "Remote tried to fulfill/fail HTLC before it had been committed");
6856+
assert!(regex::Regex::new(r"Remote tried to fulfill/fail HTLC \(\d+\) before it had been committed").unwrap().is_match(err_msg.data.as_str()));
68566857
check_added_monitors!(nodes[0], 1);
68576858
}
68586859

@@ -6934,7 +6935,7 @@ fn test_update_fulfill_htlc_bolt2_wrong_preimage() {
69346935

69356936
assert!(nodes[0].node.list_channels().is_empty());
69366937
let err_msg = check_closed_broadcast!(nodes[0], true).unwrap();
6937-
assert_eq!(err_msg.data, "Remote tried to fulfill HTLC with an incorrect preimage");
6938+
assert!(regex::Regex::new(r"Remote tried to fulfill HTLC \(\d+\) with an incorrect preimage").unwrap().is_match(err_msg.data.as_str()));
69386939
check_added_monitors!(nodes[0], 1);
69396940
}
69406941

@@ -7328,7 +7329,7 @@ fn test_upfront_shutdown_script() {
73287329
node_0_shutdown.scriptpubkey = Builder::new().push_opcode(opcodes::all::OP_RETURN).into_script().to_p2sh();
73297330
// Test we enforce upfront_scriptpbukey if by providing a diffrent one at closing that we disconnect peer
73307331
nodes[2].node.handle_shutdown(&nodes[0].node.get_our_node_id(), &node_0_shutdown);
7331-
assert_eq!(check_closed_broadcast!(nodes[2], true).unwrap().data, "Got shutdown request with a scriptpubkey which did not match their previous scriptpubkey");
7332+
assert!(regex::Regex::new(r"Got shutdown request with a scriptpubkey \([A-Fa-f0-9]+\) which did not match their previous scriptpubkey.").unwrap().is_match(check_closed_broadcast!(nodes[2], true).unwrap().data.as_str()));
73327333
check_added_monitors!(nodes[2], 1);
73337334

73347335
// We test that in case of peer committing upfront to a script, if it doesn't change at closing, we sign
@@ -7409,7 +7410,7 @@ fn test_user_configurable_csv_delay() {
74097410
let keys_manager: Arc<KeysInterface<ChanKeySigner = EnforcingChannelKeys>> = Arc::new(test_utils::TestKeysInterface::new(&nodes[0].node_seed, Network::Testnet));
74107411
if let Err(error) = Channel::new_outbound(&&test_utils::TestFeeEstimator { sat_per_kw: 253 }, &keys_manager, nodes[1].node.get_our_node_id(), 1000000, 1000000, 0, &low_our_to_self_config) {
74117412
match error {
7412-
APIError::APIMisuseError { err } => { assert_eq!(err, "Configured with an unreasonable our_to_self_delay putting user funds at risks"); },
7413+
APIError::APIMisuseError { err } => { assert!(regex::Regex::new(r"Configured with an unreasonable our_to_self_delay \(\d+\) putting user funds at risks").unwrap().is_match(err.as_str())); },
74137414
_ => panic!("Unexpected event"),
74147415
}
74157416
} else { assert!(false) }
@@ -7420,7 +7421,7 @@ fn test_user_configurable_csv_delay() {
74207421
open_channel.to_self_delay = 200;
74217422
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: 253 }, &keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), &open_channel, 0, &low_our_to_self_config) {
74227423
match error {
7423-
ChannelError::Close(err) => { assert_eq!(err, "Configured with an unreasonable our_to_self_delay putting user funds at risks"); },
7424+
ChannelError::Close(err) => { assert!(regex::Regex::new(r"Configured with an unreasonable our_to_self_delay \(\d+\) putting user funds at risks").unwrap().is_match(err.as_str())); },
74247425
_ => panic!("Unexpected event"),
74257426
}
74267427
} else { assert!(false); }
@@ -7434,7 +7435,7 @@ fn test_user_configurable_csv_delay() {
74347435
if let MessageSendEvent::HandleError { ref action, .. } = nodes[0].node.get_and_clear_pending_msg_events()[0] {
74357436
match action {
74367437
&ErrorAction::SendErrorMessage { ref msg } => {
7437-
assert_eq!(msg.data,"They wanted our payments to be delayed by a needlessly long period");
7438+
assert!(regex::Regex::new(r"They wanted our payments to be delayed by a needlessly long period\. upper limit: \d+\. actual: \d+").unwrap().is_match(msg.data.as_str()));
74387439
},
74397440
_ => { assert!(false); }
74407441
}
@@ -7446,7 +7447,7 @@ fn test_user_configurable_csv_delay() {
74467447
open_channel.to_self_delay = 200;
74477448
if let Err(error) = Channel::new_from_req(&&test_utils::TestFeeEstimator { sat_per_kw: 253 }, &keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), &open_channel, 0, &high_their_to_self_config) {
74487449
match error {
7449-
ChannelError::Close(err) => { assert_eq!(err, "They wanted our payments to be delayed by a needlessly long period"); },
7450+
ChannelError::Close(err) => { assert!(regex::Regex::new(r"They wanted our payments to be delayed by a needlessly long period\. upper limit: \d+\. actual: \d+").unwrap().is_match(err.as_str())); },
74507451
_ => panic!("Unexpected event"),
74517452
}
74527453
} else { assert!(false); }

0 commit comments

Comments
 (0)