Skip to content

Commit d52efaf

Browse files
committed
f tweak test comments and remove excess stuff
1 parent 181a0e8 commit d52efaf

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

lightning/src/ln/onion_route_tests.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,30 +248,20 @@ const UPDATE: u16 = 0x1000;
248248

249249
#[test]
250250
fn test_fee_failures() {
251-
// When we check for amount_below_minimum below, we want to test that we're using the *right*
252-
// amount, thus we need different htlc_minimum_msat values. We set node[2]'s htlc_minimum_msat
253-
// to 2000, which is above the default value of 1000 set in create_node_chanmgrs.
254-
// This exposed a previous bug because we were using the wrong value all the way down in
255-
// Channel::get_counterparty_htlc_minimum_msat().
256-
let mut node_2_cfg: UserConfig = Default::default();
257-
node_2_cfg.own_channel_config.our_htlc_minimum_msat = 2000;
258-
node_2_cfg.channel_options.announced_channel = true;
259-
node_2_cfg.peer_channel_config_limits.force_announced_channel_preference = false;
260-
261251
// When this test was written, the default base fee floated based on the HTLC count.
262252
// It is now fixed, so we simply set the fee to the expected value here.
263253
let mut config = test_default_channel_config();
264254
config.channel_options.fee_base_msat = 196;
265255

266256
let chanmon_cfgs = create_chanmon_cfgs(3);
267257
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
268-
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[Some(config), Some(config), Some(node_2_cfg)]);
258+
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[Some(config), Some(config), Some(config)]);
269259
let mut nodes = create_network(3, &node_cfgs, &node_chanmgrs);
270260
let channels = [create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known()), create_announced_chan_between_nodes(&nodes, 1, 2, InitFeatures::known(), InitFeatures::known())];
271261
let logger = test_utils::TestLogger::new();
272262
let route = get_route(&nodes[0].node.get_our_node_id(), &nodes[0].net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 40_000, TEST_FINAL_CLTV, &logger).unwrap();
273263

274-
// positve case
264+
// positive case
275265
let (payment_preimage_success, payment_hash_success, payment_secret_success) = get_payment_preimage_hash!(nodes[2]);
276266
nodes[0].node.send_payment(&route, payment_hash_success, &Some(payment_secret_success)).unwrap();
277267
check_added_monitors!(nodes[0], 1);
@@ -286,8 +276,8 @@ fn test_fee_failures() {
286276
// In an earlier version, we spuriously failed to forward payments if the expected feerate
287277
// changed between the channel open and the payment.
288278
{
289-
let mut mutex = chanmon_cfgs[1].fee_estimator.sat_per_kw.lock().unwrap();
290-
*mutex *= 2;
279+
let mut feerate_lock = chanmon_cfgs[1].fee_estimator.sat_per_kw.lock().unwrap();
280+
*feerate_lock *= 2;
291281
}
292282

293283
let (payment_preimage_success, payment_hash_success, payment_secret_success) = get_payment_preimage_hash!(nodes[2]);

0 commit comments

Comments
 (0)