From 3fd986570955282ef6154e68b9455e2f3e7647bf Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 22 Sep 2023 11:54:49 +0200 Subject: [PATCH] pytest: Fix elementsd tests --- tests/plugins/badestimate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/plugins/badestimate.py b/tests/plugins/badestimate.py index 84e9112df01a..a17467b54d61 100755 --- a/tests/plugins/badestimate.py +++ b/tests/plugins/badestimate.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import json import subprocess +import os from pyln.client import Plugin @@ -8,8 +9,12 @@ plugin = Plugin() +network = os.environ.get("TEST_NETWORK", "regtest") +cli = "bitcoin-cli" if network == "regtest" else "elements-cli" + + def bcli(plugin, cmd): - ret = subprocess.run(['bitcoin-cli', + ret = subprocess.run([cli, '-datadir={}'.format(plugin.get_option("bitcoin-datadir")), '-rpcuser={}'.format(plugin.get_option("bitcoin-rpcuser")), '-rpcpassword={}'.format(plugin.get_option("bitcoin-rpcpassword")),