From 9431dd7b886a32c2a680eb1405c890eb95b6d3c2 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Tue, 19 Dec 2023 12:51:48 +0200 Subject: [PATCH] CI: Bump bitcoind to 26.0 --- .github/workflows/tests.yml | 2 +- ricochet-send.sh | 6 ++++-- tests/functional/inc.setup.sh | 5 ++++- tests/functional/test_ricochet-send-from.sh | 2 +- tests/functional/test_ricochet-send.sh | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 00ed681..1ea804e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - bitcoind-version: ["0.17.2", "24.0"] + bitcoind-version: ["0.17.2", "26.0"] os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v3 diff --git a/ricochet-send.sh b/ricochet-send.sh index 74f7bb9..3748723 100755 --- a/ricochet-send.sh +++ b/ricochet-send.sh @@ -111,7 +111,7 @@ rawtx="$(show_tx_by_id "$txid")" #echo "$rawtx" vout_idx="" idx=0 -while read -r vout_address; do +while read -u 3 -r vout_address; do if [ "$vout_address" == "${ricochet_addresses[0]}" ]; then vout_idx=$idx value="$(echo "$rawtx" | jq -r ".vout[$vout_idx].value")" @@ -121,7 +121,7 @@ while read -r vout_address; do fi fi ((idx++)) -done <<< "$(get_decoded_tx_addresses "$rawtx")" +done 3< <(get_decoded_tx_addresses "$rawtx") if [ "$prev_pubkey" == "" ]; then echoerr "$rawtx" echoerr "FATAL: Can't find the right vout in the first transaction, please fill a bug report!" @@ -133,6 +133,7 @@ use_txid="$txid" # Prepare and sign rest of transactions echo "Preparing rest of transactions..." +set -x signedtxes=() for i in $(seq 1 $(( hops - 1 ))); do send_amount="$(bc_float_calc "$send_amount - ${ricochet_fees[$i]}")" @@ -147,6 +148,7 @@ for i in $(seq 1 $(( hops - 1 ))); do prev_pubkey="$(echo "$decodedtx" | jq -r ".vout[].scriptPubKey.hex")" echo "$use_txid" done +set +x #printf '%s\n' "${signedtxes[@]}" diff --git a/tests/functional/inc.setup.sh b/tests/functional/inc.setup.sh index 88b8b07..d2b951b 100644 --- a/tests/functional/inc.setup.sh +++ b/tests/functional/inc.setup.sh @@ -16,12 +16,15 @@ fi # shellcheck disable=SC2034 retval=0 -#set -x +set -x rm -rf "$bitcoin_test_datadir" mkdir "$bitcoin_test_datadir" echo -e "[regtest]\nrpcuser=bitcoinrpc\nrpcpassword=123456abcdef" \ > "$bitcoin_test_datadir/bitcoin.conf" +if [[ "$($bitcoind -version | grep -Eo 'v[0-9]+')" == "v26" ]]; then + echo "deprecatedrpc=create_bdb" >> "$bitcoin_test_datadir}/bitcoin.conf" +fi $bitcoind -daemon || exit 1 # Wait until bitcoind has started properly while ! $bitcoin_cli getblockchaininfo 2> /dev/null; do sleep 0.1; done diff --git a/tests/functional/test_ricochet-send-from.sh b/tests/functional/test_ricochet-send-from.sh index f007b92..7da153b 100755 --- a/tests/functional/test_ricochet-send-from.sh +++ b/tests/functional/test_ricochet-send-from.sh @@ -9,7 +9,7 @@ $bitcoin_cli sendtoaddress "$source_address" 2 destination_address="$($bitcoin_cli getnewaddress)" echo y | "$(dirname "$0")/../../ricochet-send-from.sh" \ - "${bitcoin_args[@]:?}" "$source_address" "$destination_address" \ + "${bitcoin_args[@]:?}" -rpcwallet=tests "$source_address" "$destination_address" \ "4" "0.00000999" source_unspent_count="$($bitcoin_cli listunspent 0 999999 "[\"$source_address\"]" | jq ". | length")" diff --git a/tests/functional/test_ricochet-send.sh b/tests/functional/test_ricochet-send.sh index 1232edb..82126ec 100755 --- a/tests/functional/test_ricochet-send.sh +++ b/tests/functional/test_ricochet-send.sh @@ -5,7 +5,7 @@ . "$(dirname "$0")/inc.setup.sh" destination_address="$(${bitcoin_cli:?} getnewaddress)" -echo y | "$(dirname "$0")/../../ricochet-send.sh" "${bitcoin_args[@]:?}" 1 \ +echo y | "$(dirname "$0")/../../ricochet-send.sh" "${bitcoin_args[@]:?}" -rpcwallet=tests 1 \ "$destination_address" "4" "0.00000999" destination_amount="$($bitcoin_cli getreceivedbyaddress "$destination_address" 0)"