Skip to content

Commit

Permalink
[Tests] Fix wallet_upgrade
Browse files Browse the repository at this point in the history
generating a block calls TopUp which now returns true on non-HD wallets
too. the pre_split keypool has 1 key more.
  • Loading branch information
random-zebra committed Mar 15, 2020
1 parent 58ff9ec commit 4cd5c51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/functional/wallet_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
Expand Down Expand Up @@ -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 :)")

Expand Down

0 comments on commit 4cd5c51

Please sign in to comment.