Skip to content

Commit

Permalink
test: add coverage for rpc error when trying to rescan beyond pruned …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
brunoerg committed Aug 26, 2022
1 parent bbbc26d commit 7852e8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/functional/feature_pruning.py
Expand Up @@ -143,6 +143,10 @@ def test_invalid_command_line_options(self):
extra_args=['-prune=550', '-reindex-chainstate'],
)

def test_rescan_blockchain(self):
self.restart_node(0, ["-prune=550"])
assert_raises_rpc_error(-1, "Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.", self.nodes[0].rescanblockchain)

def test_height_min(self):
assert os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), "blk00000.dat is missing, pruning too early"
self.log.info("Success")
Expand Down Expand Up @@ -480,6 +484,9 @@ def run_test(self):
self.log.info("Test invalid pruning command line options")
self.test_invalid_command_line_options()

self.log.info("Test it's not possible to rescan beyond pruned data")
self.test_rescan_blockchain()

self.log.info("Done")

if __name__ == '__main__':
Expand Down

0 comments on commit 7852e8e

Please sign in to comment.