Skip to content

Commit

Permalink
make test_list_lsp_server more readable
Browse files Browse the repository at this point in the history
See comments from `fundchannel`

Remove spurious clone in list_lsp_servers

Code review comments from christian
  • Loading branch information
ErikDeSmedt committed Sep 14, 2023
1 parent 21fc6b0 commit 08cc17c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 4 additions & 4 deletions libs/gl-client/src/lsps/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ impl LspClient {
let response = self.cln_client.list_nodes(request).await?;

return Ok(response
.get_ref()
.into_inner()
.nodes
.iter()
.filter(|x| is_feature_bit_enabled(&x.features(), BITNUM_LSP_FEATURE))
.map(|n| n.nodeid.clone())
.into_iter()
.filter(|x| is_feature_bit_enabled(x.features(), BITNUM_LSP_FEATURE))
.map(|n| n.nodeid)
.collect());
}
}
11 changes: 3 additions & 8 deletions libs/gl-testing/tests/test_lsps.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,9 @@ def test_list_lsp_server(
)
n3: LightningNode = node_factory.get_node()

# Fund all nodes so they can open a channel
n1.fundwallet(100_000_000)
n2.fundwallet(100_000_000)
n3.fundwallet(100_000_000)

# Create a basic channel graph
n1.openchannel(n2, 500_000, connect=True)
n2.openchannel(n3, 500_000, connect=True)
# Create the channel-graph
n1.fundchannel(n2, announce_channel=True)
n2.fundchannel(n3, announce_channel=True)

# Initiate the greenlight node
c = clients.new()
Expand Down

0 comments on commit 08cc17c

Please sign in to comment.