Skip to content

Commit

Permalink
fix: follow-up partial bitcoin#25063 - actually load binaries with x8…
Browse files Browse the repository at this point in the history
…6_64-apple-darwin platform
  • Loading branch information
knst committed Nov 20, 2023
1 parent 828f32e commit 65ffbe2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_qt5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false"
export GOAL="install"
export TEST_PREVIOUS_RELEASES=true
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.0.0 v0.16.1.1 v0.17.0.3 v18.2.2 v19.3.0"
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.0.0 v0.16.1.1 v0.17.0.3 v18.2.2 v19.3.0 v20.0.1"
export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --disable-fuzz-binary LDFLAGS=-static-libstdc++"
51 changes: 45 additions & 6 deletions test/functional/feature_backwards_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
class BackwardsCompatibilityTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 6
self.num_nodes = 7
# Add new version after each release:
self.extra_args = [
[], # Pre-release: use to mine blocks
["-nowallet"], # Pre-release: use to receive coins, swap wallets, etc
["-nowallet"], # v20.0.1
["-nowallet"], # v19.3.0
["-nowallet"], # v18.2.2
["-nowallet"], # v0.17.0.3
Expand All @@ -51,6 +52,7 @@ def setup_nodes(self):
None,
None,
19030000,
19030000,
18020200,
170003,
160101,
Expand All @@ -68,7 +70,8 @@ def run_test(self):
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
assert_equal(res['blocks'], 101)

node_master = self.nodes[self.num_nodes - 5]
node_master = self.nodes[self.num_nodes - 6]
node_v20 = self.nodes[self.num_nodes - 5]
node_v19 = self.nodes[self.num_nodes - 4]
node_v18 = self.nodes[self.num_nodes - 3]
node_v17 = self.nodes[self.num_nodes - 2]
Expand Down Expand Up @@ -117,6 +120,13 @@ def run_test(self):
assert info['private_keys_enabled'] == False
assert info['keypoolsize'] == 0

# w1_v20: regular wallet, created with v20.0
node_v20.createwallet(wallet_name="w1_v20")
wallet = node_v20.get_wallet_rpc("w1_v20")
info = wallet.getwalletinfo()
assert info['private_keys_enabled']
assert info['keypoolsize'] > 0

# w2_v19: wallet with private keys disabled, created with v0.19
node_v19.createwallet(wallet_name="w2_v19", disable_private_keys=True)
wallet = node_v19.get_wallet_rpc("w2_v19")
Expand Down Expand Up @@ -155,13 +165,14 @@ def run_test(self):

# Copy the wallets to older nodes:
node_master_wallets_dir = os.path.join(node_master.datadir, "regtest/wallets")
node_v20_wallets_dir = os.path.join(node_v20.datadir, "regtest/wallets")
node_v19_wallets_dir = os.path.join(node_v19.datadir, "regtest/wallets")
node_v18_wallets_dir = os.path.join(node_v18.datadir, "regtest/wallets")
node_v17_wallets_dir = os.path.join(node_v17.datadir, "regtest/wallets")
node_v16_wallets_dir = os.path.join(node_v16.datadir, "regtest")
node_master.unloadwallet("w1")
node_master.unloadwallet("w2")
node_v19.unloadwallet("w1_v19")
node_v20.unloadwallet("w1_v20")
node_v19.unloadwallet("w2_v19")
node_v18.unloadwallet("w1_v18")
node_v18.unloadwallet("w2_v18")
Expand Down Expand Up @@ -199,6 +210,34 @@ def run_test(self):
os.path.join(node_v19_wallets_dir, wallet)
)

# Copy wallets to v0.20
for wallet in os.listdir(node_master_wallets_dir):
shutil.copytree(
os.path.join(node_master_wallets_dir, wallet),
os.path.join(node_v20_wallets_dir, wallet)
)

# Open the wallets in v0.20
node_v20.loadwallet("w1")
wallet = node_v20.get_wallet_rpc("w1")
info = wallet.getwalletinfo()
assert info['private_keys_enabled']
assert info['keypoolsize'] > 0
txs = wallet.listtransactions()
assert_equal(len(txs), 1)

node_v20.loadwallet("w2")
wallet = node_v20.get_wallet_rpc("w2")
info = wallet.getwalletinfo()
assert info['private_keys_enabled'] == False
assert info['keypoolsize'] == 0

node_v20.loadwallet("w3")
wallet = node_v20.get_wallet_rpc("w3")
info = wallet.getwalletinfo()
assert info['private_keys_enabled']
assert info['keypoolsize'] == 0

# Open the wallets in v0.19
node_v19.loadwallet("w1")
wallet = node_v19.get_wallet_rpc("w1")
Expand Down Expand Up @@ -277,15 +316,15 @@ def run_test(self):
# assert_raises_rpc_error(-4, "Wallet loading failed.", node_v17.loadwallet, 'w3_v18')

# Instead, we stop node and try to launch it with the wallet:
self.stop_node(4)
self.stop_node(5)
# it expected to fail with error 'DBErrors::TOO_NEW' but Dash Core can open v18 by version 17
# can be implemented in future if there's any incompatible versions
#node_v17.assert_start_raises_init_error(["-wallet=w3_v18"], "Error: Error loading w3_v18: Wallet requires newer version of Dash Core")
#node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: Error loading w3: Wallet requires newer version of Dash Core")
self.start_node(4)
self.start_node(5)

# Open most recent wallet in v0.16 (no loadwallet RPC)
self.restart_node(5, extra_args=["-wallet=w2"])
self.restart_node(6, extra_args=["-wallet=w2"])
wallet = node_v16.get_wallet_rpc("w2")
info = wallet.getwalletinfo()
assert info['keypoolsize'] == 1
Expand Down
12 changes: 12 additions & 0 deletions test/get_previous_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@


SHA256_SUMS = {
"d1f7121a7d7bdd4077709284076860389d6a0f4481a934ad9acb85cae3d7b83e": "dashcore-20.0.1-aarch64-linux-gnu.tar.gz",
"37375229e5ab18d7050b729fb016df24acdd72d60bc3fa074270d89030a27827": "dashcore-20.0.1-arm-linux-gnueabihf.tar.gz",
"ab530f72d2bfbfcd7fca0644e3ea5c5b279e2204fe50ff7bd9cc452a0d413c65": "dashcore-20.0.1-arm64-apple-darwin.dmg",
"8f4b55e4a3d6bb38a0c1f51ece14f387fd4dcffa000aeecfbbd1f751da8b4446": "dashcore-20.0.1-arm64-apple-darwin.tar.gz",
"1d9cdb00d93e8babe9f54d0ecb04c55f2cd6fd6cfaa85466aa7f95a6976d040d": "dashcore-20.0.1-riscv64-linux-gnu.tar.gz",
"f722954c38d5b18f8290e41ca9dd833929258dcf68c9396cbbc81d241285947b": "dashcore-20.0.1-win64-setup.exe",
"bb6d59a3eadac316e86e073a9f7ca4d28f3a2e8a59b7109d509a7368675a6f5f": "dashcore-20.0.1-win64.zip",
"5373a84f49e4f76bd04987806f5fcde0b537fa1408e1f98370680f3f5134970f": "dashcore-20.0.1-x86_64-apple-darwin.dmg",
"0c9344961ae5800f54ffc90af63826cdbf61acc5c442f3fab6527d528f2d9323": "dashcore-20.0.1-x86_64-apple-darwin.tar.gz",
"7c82bdbd1c2de515d6c7245886d8c0b0044a4a9b6f74166b8d58c82cd4ae3270": "dashcore-20.0.1-x86_64-linux-gnu.tar.gz",
"bb898a8e4c54fd5989f114673e1fee5116bf6ffa257c63397993035c390de806": "dashcore-20.0.1.tar.gz",
#
"a4b555b47f5f9a5a01fc5d3b543731088bd10a65dd7fa81fb552818146e424b5": "dashcore-19.3.0-aarch64-linux-gnu.tar.gz",
"531bb188c1aea808ef6f3533d71182a51958136f6e43d9fcadaef1a5fcdd0468": "dashcore-19.3.0-osx.dmg",
"1b4673a2bd71f9f2b593c2d71386e60f4744b59b57142707f0045ed49c92024b": "dashcore-19.3.0-osx64.tar.gz",
Expand Down

0 comments on commit 65ffbe2

Please sign in to comment.