Skip to content

Commit

Permalink
Fix for Bitcoin Core v23 and framework improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapsk committed Oct 25, 2022
1 parent e7619d4 commit 8bdc9db
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions tests/functional/inc.setup.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
# shellcheck shell=bash

bitcoin_args="-regtest"
bitcoind="bitcoind $bitcoin_args -fallbackfee=0.0002"
bitcoin_cli="bitcoin-cli $bitcoin_args"
bitcoin_test_datadir="$(mktemp)"
bitcoin_args=(
"-regtest"
"-datadir=$bitcoin_test_datadir"
)
bitcoind="bitcoind ${bitcoin_args[*]} -fallbackfee=0.0002"
bitcoin_cli="bitcoin-cli ${bitcoin_args[*]}"

# shellcheck disable=SC2034
retval=0

#set -x

rm -rf "$bitcoin_test_datadir"
mkdir "$bitcoin_test_datadir"
echo -e "[regtest]\nrpcuser=bitcoinrpc\nrpcpassword=123456abcdef" \
> "$bitcoin_test_datadir/bitcoin.conf"
$bitcoind -daemon || exit 1
# Wait until bitcoind has started properly
while ! $bitcoin_cli getblockchaininfo &> /dev/null; do sleep 0.1; done
# Create and load wallet
$bitcoin_cli createwallet tests &> /dev/null
while ! $bitcoin_cli getblockchaininfo 2> /dev/null; do sleep 0.1; done
# Create and load wallet (descriptor wallets aren't supported yet)
if ! $bitcoin_cli -named createwallet wallet_name=tests descriptors=false; then
# fallback for old Core versions
$bitcoin_cli createwallet tests
fi
$bitcoin_cli loadwallet tests
# Generate some coins
$bitcoin_cli generatetoaddress 1 "$($bitcoin_cli getnewaddress "" "legacy")"
Expand Down

0 comments on commit 8bdc9db

Please sign in to comment.