tests: use fundwallet instead of manually funding the lsp
What changed, and why it matters
This commit is a minor cleanup of test code only. It replaces a manual three-step process for adding money to a test Lightning node with a single helper call. No production code was changed, and there is no security relevance.
No action needed; this is a benign test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/test_cln_lsps.py, replacing explicit bitcoind funding (newaddr + sendtoaddress + generate_block) with the existing l2.fundwallet(1_000_000) helper in three test functions. This is purely a test refactor with no functional or security changes to Core Lightning itself.
Changed components
tests/test_cln_lsps.pyInspect captured patch +3 / −9
diff --git a/tests/test_cln_lsps.py b/tests/test_cln_lsps.py
index 256a37a9..e2ce15b0 100644
--- a/tests/test_cln_lsps.py
+++ b/tests/test_cln_lsps.py
@@ -140,9 +140,7 @@ def test_lsps2_buyjitchannel_no_mpp_var_invoice(node_factory, bitcoind):
)
# Give the LSP some funds to open jit-channels
- addr = l2.rpc.newaddr()["bech32"]
- bitcoind.rpc.sendtoaddress(addr, 1)
- bitcoind.generate_block(1)
+ l2.fundwallet(1_000_000)
node_factory.join_nodes([l3, l2], fundchannel=True, wait_for_announce=True)
node_factory.join_nodes([l1, l2], fundchannel=False)
@@ -231,9 +229,7 @@ def test_lsps2_buyjitchannel_mpp_fixed_invoice(node_factory, bitcoind):
)
# Give the LSP some funds to open jit-channels
- addr = l2.rpc.newaddr()["bech32"]
- bitcoind.rpc.sendtoaddress(addr, 1)
- bitcoind.generate_block(1)
+ l2.fundwallet(1_000_000)
node_factory.join_nodes([l3, l2], fundchannel=True, wait_for_announce=True)
node_factory.join_nodes([l1, l2], fundchannel=False)
@@ -320,9 +316,7 @@ def test_lsps2_non_approved_zero_conf(node_factory, bitcoind):
)
# Give the LSP some funds to open jit-channels
- addr = l2.rpc.newaddr()["bech32"]
- bitcoind.rpc.sendtoaddress(addr, 1)
- bitcoind.generate_block(1)
+ l2.fundwallet(1_000_000)
node_factory.join_nodes([l3, l2], fundchannel=True, wait_for_announce=True)
node_factory.join_nodes([l1, l2], fundchannel=False)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.