Skip to content

Commit f1633de

Browse files
committed
Add functional test for using an override config when creating a channel
1 parent fbced4e commit f1633de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7298,3 +7298,21 @@ fn test_bump_txn_sanitize_tracking_maps() {
72987298
}
72997299
}
73007300
}
7301+
7302+
#[test]
7303+
fn test_override_channel_config() {
7304+
let node_cfgs = create_node_cfgs(2);
7305+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
7306+
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
7307+
7308+
// Node0 initiates a channel to node1 using the override config.
7309+
let mut override_config = UserConfig::default();
7310+
override_config.own_channel_config.our_to_self_delay = 200;
7311+
7312+
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 16_000_000, 12_000_000, 42, Some(override_config)).unwrap();
7313+
7314+
// Assert the channel created by node0 is using the override config.
7315+
let res = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
7316+
assert_eq!(res.channel_flags, 0);
7317+
assert_eq!(res.to_self_delay, 200);
7318+
}

0 commit comments

Comments
 (0)