Skip to content

Commit cca4f82

Browse files
committed
test: add coverage for rpc error when trying to rescan beyond pruned data
1 parent bbbc26d commit cca4f82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/functional/feature_pruning.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ def test_invalid_command_line_options(self):
143143
extra_args=['-prune=550', '-reindex-chainstate'],
144144
)
145145

146+
def test_rescan_blockchain(self):
147+
self.restart_node(0, ["-prune=550"])
148+
assert_raises_rpc_error(-1, "Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.", self.nodes[0].rescanblockchain)
149+
146150
def test_height_min(self):
147151
assert os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), "blk00000.dat is missing, pruning too early"
148152
self.log.info("Success")
@@ -477,6 +481,9 @@ def run_test(self):
477481
self.log.info("Test wallet re-scan")
478482
self.wallet_test()
479483

484+
self.log.info("Test it's not possible to rescan beyond pruned data")
485+
self.test_rescan_blockchain()
486+
480487
self.log.info("Test invalid pruning command line options")
481488
self.test_invalid_command_line_options()
482489

0 commit comments

Comments
 (0)