Browse Source

pytest: create a wallet for bitcoind if none is present

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
ppa-prep
Antoine Poinsot 4 years ago
committed by neil saitug
parent
commit
a561360334
  1. 8
      contrib/pyln-testing/pyln/testing/fixtures.py

8
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:

Loading…
Cancel
Save