Skip to content

Commit

Permalink
test: wallet_hd.py enable RPC based rescan test case
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Mar 10, 2021
1 parent d3cdc63 commit 25440c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/functional/wallet_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,22 @@ def run_test(self):
self.start_node(1, extra_args=self.extra_args[1] + ['-rescan'])
assert_equal(self.nodes[1].getbalance(), NUM_HD_ADDS + NUM_SHIELD_ADDS + 1)

# Delete chain and resync (without recreating shield addresses)
# Try a RPC based rescan
self.stop_node(1)
shutil.rmtree(os.path.join(self.nodes[1].datadir, "regtest", "blocks"))
shutil.rmtree(os.path.join(self.nodes[1].datadir, "regtest", "chainstate"))
shutil.copyfile(os.path.join(self.nodes[1].datadir, "hd.bak"), os.path.join(self.nodes[1].datadir, "regtest", "wallet.dat"))
self.start_and_connect_node1()
# Wallet automatically scans blocks older than key on startup (but shielded addresses need to be regenerated)
assert_equal(self.nodes[1].getbalance(), NUM_HD_ADDS + 1)

""" todo: Implement rescanblockchain
# Wallet automatically scans blocks older than key on startup
out = self.nodes[1].rescanblockchain(0, 1)
assert_equal(out['start_height'], 0)
assert_equal(out['stop_height'], 1)
out = self.nodes[1].rescanblockchain()
assert_equal(out['start_height'], 0)
assert_equal(out['stop_height'], self.nodes[1].getblockcount())
assert_equal(self.nodes[1].getbalance(), NUM_HD_ADDS + 1)
"""

# send a tx and make sure its using the internal chain for the changeoutput
txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
Expand Down

0 comments on commit 25440c4

Please sign in to comment.