tests: use bitcoind.conf_file instead of hardcoded bitcoin.conf in RawProxy mocks
What changed, and why it matters
This change only updates internal test code to use the correct configuration file path when simulating Bitcoin RPC connections during automated tests. It does not alter the Core Lightning software that users run, and it has no security relevance for real deployments.
No security action required. This is a test-only maintenance change. Reviewers may verify that CI passes on liquid-regtest.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies three test helper functions in tests/test_misc.py and tests/test_plugin.py. Previously they constructed a python-bitcoinlib RawProxy using a hardcoded bitcoin.conf path inside bitcoind.bitcoin_dir. After a related refactor that deferred config writing and made ElementsD write only elements.conf, these mocks failed on liquid-regtest because no bitcoin.conf existed. The patch uses bitcoind.conf_file, which correctly resolves to elements.conf or bitcoin.conf depending on the daemon type. This is purely a test-infrastructure fix.
Changed components
tests/test_misc.pytests/test_plugin.pyInspect captured patch +3 / −6
diff --git a/tests/test_misc.py b/tests/test_misc.py
index b3370453..e8fcf7b4 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -174,8 +174,7 @@ def test_bitcoin_pruned(node_factory, bitcoind):
nonlocal fetched_peerblock
if fetched_peerblock:
fetched_peerblock = False
- conf_file = os.path.join(bitcoind.bitcoin_dir, "bitcoin.conf")
- brpc = RawProxy(btc_conf_file=conf_file)
+ brpc = RawProxy(btc_conf_file=bitcoind.conf_file)
return {
"result": brpc._call(r["method"], *r["params"]),
"error": None,
@@ -270,8 +269,7 @@ def test_lightningd_still_loading(node_factory, bitcoind, executor):
# This is slow enough that we're going to notice.
def mock_getblock(r):
- conf_file = os.path.join(bitcoind.bitcoin_dir, 'bitcoin.conf')
- brpc = RawProxy(btc_conf_file=conf_file)
+ brpc = RawProxy(btc_conf_file=bitcoind.conf_file)
if r['params'][0] == slow_blockid:
mock_release.wait(TIMEOUT)
return {
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index f0dc56c4..0025d4c3 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -2245,8 +2245,7 @@ def test_bcli_concurrent(node_factory, bitcoind, executor):
def mock_getblock(r):
if getblockfrompeer_count >= retry_count:
- conf_file = os.path.join(bitcoind.bitcoin_dir, "bitcoin.conf")
- brpc = RawProxy(btc_conf_file=conf_file)
+ brpc = RawProxy(btc_conf_file=bitcoind.conf_file)
return {
"result": brpc._call(r["method"], *r["params"]),
"error": None,
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.