Skip to content

Commit

Permalink
pytest: create a wallet for bitcoind if none presentwq
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
  • Loading branch information
darosior committed Nov 1, 2020
1 parent 3710c5e commit 8e9ea4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/pyln-testing/pyln/testing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ def bitcoind(directory, teardown_checks):
raise ValueError("bitcoind is too old. At least version 16000 (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:
Expand Down

0 comments on commit 8e9ea4f

Please sign in to comment.