diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-07-15 12:41:27 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-07-16 15:34:56 -0400 |
commit | 5012a7912ee9fa35bc417cb073eebffd85f36c6c (patch) | |
tree | 30c74239158260b1fb0e6d067aa5a9f51a9fa9bc /test/functional | |
parent | 48bd7d3b7737656052d2c745ed40c7f6670842cf (diff) |
Test that descriptor wallet upgrade does nothing
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_upgradewallet.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/functional/wallet_upgradewallet.py b/test/functional/wallet_upgradewallet.py index ad11f4b244..4d34670ea9 100755 --- a/test/functional/wallet_upgradewallet.py +++ b/test/functional/wallet_upgradewallet.py @@ -94,10 +94,11 @@ class UpgradeWalletTest(BitcoinTestFramework): def test_upgradewallet(self, wallet, previous_version, requested_version=None, expected_version=None): unchanged = expected_version == previous_version new_version = previous_version if unchanged else expected_version if expected_version else requested_version - assert_equal(wallet.getwalletinfo()["walletversion"], previous_version) + old_wallet_info = wallet.getwalletinfo() + assert_equal(old_wallet_info["walletversion"], previous_version) assert_equal(wallet.upgradewallet(requested_version), { - "wallet_name": "", + "wallet_name": old_wallet_info["walletname"], "previous_version": previous_version, "current_version": new_version, "result": "Already at latest version. Wallet version unchanged." if unchanged else "Wallet upgraded successfully from version {} to version {}.".format(previous_version, new_version), @@ -352,6 +353,11 @@ class UpgradeWalletTest(BitcoinTestFramework): v16_3_kvs = dump_bdb_kv(v16_3_wallet) assert b'\x0adefaultkey' not in v16_3_kvs + if self.is_sqlite_compiled(): + self.log.info("Checking that descriptor wallets do nothing, successfully") + self.nodes[0].createwallet(wallet_name="desc_upgrade", descriptors=True) + desc_wallet = self.nodes[0].get_wallet_rpc("desc_upgrade") + self.test_upgradewallet(desc_wallet, previous_version=169900, expected_version=169900) if __name__ == '__main__': UpgradeWalletTest().main() |