Skip to content

Commit

Permalink
Get chan_id from create_announced_chan_between_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
waterson committed Oct 16, 2023
1 parent 2a7d1af commit f487ebe
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions lightning/src/ln/async_signer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,7 @@ fn test_async_commitment_signature_for_commitment_signed() {
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
create_announced_chan_between_nodes(&nodes, 0, 1);

let chan_id = {
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
let chan_ids = chan_lock.channel_by_id.keys().collect::<Vec<_>>();
assert_eq!(chan_ids.len(), 1, "expected one channel, not {}", chan_ids.len());
*chan_ids[0]
};
let (_, _, chan_id, _) = create_announced_chan_between_nodes(&nodes, 0, 1);

// Send a payment.
let src = &nodes[0];
Expand Down Expand Up @@ -278,15 +270,7 @@ fn test_async_commitment_signature_for_peer_disconnect() {
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
create_announced_chan_between_nodes(&nodes, 0, 1);

let chan_id = {
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
let chan_ids = chan_lock.channel_by_id.keys().collect::<Vec<_>>();
assert_eq!(chan_ids.len(), 1, "expected one channel, not {}", chan_ids.len());
*chan_ids[0]
};
let (_, _, chan_id, _) = create_announced_chan_between_nodes(&nodes, 0, 1);

// Send a payment.
let src = &nodes[0];
Expand Down

0 comments on commit f487ebe

Please sign in to comment.