From 3b405dcdc7008fb8e4ed132de371ebc662ae959f 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..328090215693 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 == "bitcoin" 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")),