Browse Source

Merge JoinMarket-Org/joinmarket-clientserver#1619: Support Bitcoin Core v26 for tests

d234731022 Add -allowignoredconf=1 for Bitcoin Core v26+ (Kristaps Kaupe)
8684853117 Support Bitcoin Core v26 for tests (Kristaps Kaupe)

Pull request description:

  Bitcoin Core config needs to be hacked with `deprecatedrpc=create_bdb` for v26 until #1571 is solved.

Top commit has no ACKs.

Tree-SHA512: cc30afe05af7df2c73f60436ee43efe6c2cbda50539052a28bd72fa27dcab91eb6d0c0ba1d42cf37d589f9e00bbc87dbf05d9ac34acc559387aa05b38f18f87f
master
Kristaps Kaupe 2 years ago
parent
commit
867dd53b6e
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 2
      .github/workflows/unittests.yml
  2. 6
      conftest.py
  3. 10
      test/run_tests.sh

2
.github/workflows/unittests.yml

@ -10,7 +10,7 @@ jobs:
matrix: matrix:
os: [macos-latest, ubuntu-latest] os: [macos-latest, ubuntu-latest]
python-version: ["3.7", "3.11"] python-version: ["3.7", "3.11"]
bitcoind-version: ["0.18.0", "25.1"] bitcoind-version: ["0.18.0", "26.0"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

6
conftest.py

@ -138,12 +138,16 @@ def setup_regtest_bitcoind(pytestconfig):
bitcoincli_path = os.path.join(bitcoin_path, "bitcoin-cli") bitcoincli_path = os.path.join(bitcoin_path, "bitcoin-cli")
start_cmd = f'{bitcoind_path} -regtest -daemon -conf={conf}' start_cmd = f'{bitcoind_path} -regtest -daemon -conf={conf}'
stop_cmd = f'{bitcoincli_path} -regtest -rpcuser={rpcuser} -rpcpassword={rpcpassword} stop' stop_cmd = f'{bitcoincli_path} -regtest -rpcuser={rpcuser} -rpcpassword={rpcpassword} stop'
local_command(start_cmd, bg=True)
# determine bitcoind version # determine bitcoind version
try: try:
bitcoind_version = get_bitcoind_version(bitcoind_path) bitcoind_version = get_bitcoind_version(bitcoind_path)
except RuntimeError as exc: except RuntimeError as exc:
pytest.exit(f"Cannot setup tests, bitcoind failing.\n{exc}") pytest.exit(f"Cannot setup tests, bitcoind failing.\n{exc}")
if bitcoind_version[0] >= 26:
start_cmd += ' -allowignoredconf=1'
local_command(start_cmd, bg=True)
root_cmd = f'{bitcoincli_path} -regtest -rpcuser={rpcuser} -rpcpassword={rpcpassword}' root_cmd = f'{bitcoincli_path} -regtest -rpcuser={rpcuser} -rpcpassword={rpcpassword}'
wallet_name = 'jm-test-wallet' wallet_name = 'jm-test-wallet'
# Bitcoin Core v0.21+ does not create default wallet # Bitcoin Core v0.21+ does not create default wallet

10
test/run_tests.sh

@ -204,6 +204,16 @@ run_jm_tests ()
if [[ -z "$btcconf" ]]; then if [[ -z "$btcconf" ]]; then
btcconf="${jm_test_datadir}/bitcoin.conf" btcconf="${jm_test_datadir}/bitcoin.conf"
cp -f ./test/bitcoin.conf "${jm_test_datadir}/bitcoin.conf" cp -f ./test/bitcoin.conf "${jm_test_datadir}/bitcoin.conf"
# Temporary hack until we support descriptor wallets.
# https://github.com/JoinMarket-Org/joinmarket-clientserver/issues/1571
if [[ -n $btcroot ]]; then
bitcoind="$btcroot/bitcoind"
else
bitcoind="bitcoind"
fi
if [[ "$($bitcoind -version | grep -Eo 'v[0-9]+')" == "v26" ]]; then
echo "deprecatedrpc=create_bdb" >> "${jm_test_datadir}/bitcoin.conf"
fi
fi fi
${orig_umask} ${orig_umask}
echo "datadir=${jm_test_datadir}" >> "${jm_test_datadir}/bitcoin.conf" echo "datadir=${jm_test_datadir}" >> "${jm_test_datadir}/bitcoin.conf"

Loading…
Cancel
Save