From 4cd5c5154acd9ac1931e60f39058e6a1b90a7a58 Mon Sep 17 00:00:00 2001 From: random-zebra Date: Sun, 15 Mar 2020 01:23:28 +0100 Subject: [PATCH] [Tests] Fix wallet_upgrade generating a block calls TopUp which now returns true on non-HD wallets too. the pre_split keypool has 1 key more. --- test/functional/wallet_upgrade.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/wallet_upgrade.py b/test/functional/wallet_upgrade.py index 56da7680f5d24..ea995034b1057 100755 --- a/test/functional/wallet_upgrade.py +++ b/test/functional/wallet_upgrade.py @@ -76,7 +76,7 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 - def check_keys(self, addrs): + def check_keys(self, addrs, mined_blocks = 0): self.log.info("Checking old keys existence in the upgraded wallet..") # Now check that all of the pre upgrade addresses are still in the wallet for addr in addrs: @@ -87,7 +87,7 @@ def check_keys(self, addrs): self.log.info("All pre-upgrade keys found in the wallet :)") # Use all of the keys in the pre-HD keypool - for _ in range(0, 60): + for _ in range(0, 60 + mined_blocks): self.nodes[0].getnewaddress() self.log.info("All pre-upgrade keys should have been marked as used by now, creating new HD keys") @@ -143,7 +143,7 @@ def run_test(self): self.log.info("upgrade completed, checking keys now..") # Now check if the upgrade went fine - self.check_keys(addrs) + self.check_keys(addrs, 1) self.log.info("Upgrade via RPC completed, all good :)")