From a561360334da0baa9f38364ee68ca4fe6d08c97c Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sun, 1 Nov 2020 15:51:34 +0100 Subject: [PATCH] pytest: create a wallet for bitcoind if none is present Signed-off-by: Antoine Poinsot --- contrib/pyln-testing/pyln/testing/fixtures.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index ea6ccdc5f..2353dcf61 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -138,6 +138,14 @@ def bitcoind(directory, teardown_checks): raise ValueError("elementsd is too old. At least version 160000 (v0.16.0)" " is needed, current version is {}".format(info['version'])) + # Make sure we have a wallet, starting with 0.21 there is no default wallet + # anymore. + # FIXME: if we update the testsuite to use the upcoming 0.21 release we + # could switch to descriptor wallets and speed bitcoind operations + # consequently. + if not bitcoind.rpc.listwallets(): + bitcoind.rpc.createwallet("lightningd-tests") + info = bitcoind.rpc.getblockchaininfo() # Make sure we have some spendable funds if info['blocks'] < 101: