Browse Source

Merge #796: Fix tests for Bitcoin Core v0.21+

92c1b1a472 Fix tests for Bitcoin Core v0.21+ (Kristaps Kaupe)

Pull request description:

  Bitcoin Core v0.21+ doesn't create default wallet.

Top commit has no ACKs.

Tree-SHA512: 2783b964c2dbc3de1adf8944f16de6dc7ef128bbefe6e4e31cfa8f641c4f5e9b0487e122df1d632297226c7eaee254e181b85c46be9dd2369ecf70015eec6bc7
master
Kristaps Kaupe 5 years ago
parent
commit
8b10dab4d3
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 9
      conftest.py
  2. 1
      test/regtest_joinmarket.cfg

9
conftest.py

@ -120,11 +120,16 @@ def setup(request):
root_cmd = [bitcoin_path + "bitcoin-cli", "-regtest",
"-rpcuser=" + bitcoin_rpcusername,
"-rpcpassword=" + bitcoin_rpcpassword]
# Bitcoin Core v0.21+ does not create default wallet
local_command(root_cmd + ["createwallet", "jm-test-wallet"])
local_command(root_cmd + ["loadwallet", "jm-test-wallet"])
for i in range(2):
cpe = local_command(root_cmd + ["getnewaddress"])
cpe = local_command(root_cmd + ["-rpcwallet=jm-test-wallet"] +
["getnewaddress"])
if cpe.returncode == 0:
destn_addr = cpe.stdout[:-1].decode('utf-8')
local_command(root_cmd + ["generatetoaddress", "301", destn_addr])
local_command(root_cmd + ["-rpcwallet=jm-test-wallet"] +
["generatetoaddress", "301", destn_addr])
else:
pytest.exit("Cannot setup tests, bitcoin-cli failing.\n" +
str(cpe.stdout))

1
test/regtest_joinmarket.cfg

@ -13,6 +13,7 @@ rpc_port = 18443
rpc_user = bitcoinrpc
rpc_password = 123456abcdef
network = testnet
rpc_wallet_file = jm-test-wallet
[MESSAGING:server1]
host = localhost

Loading…
Cancel
Save