mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
test: add coverage for rpc error when trying to rescan beyond pruned data
This commit is contained in:
parent
bbbc26dcfc
commit
cca4f82b82
1 changed files with 7 additions and 0 deletions
|
@ -143,6 +143,10 @@ class PruneTest(BitcoinTestFramework):
|
|||
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")
|
||||
|
@ -477,6 +481,9 @@ class PruneTest(BitcoinTestFramework):
|
|||
self.log.info("Test wallet re-scan")
|
||||
self.wallet_test()
|
||||
|
||||
self.log.info("Test it's not possible to rescan beyond pruned data")
|
||||
self.test_rescan_blockchain()
|
||||
|
||||
self.log.info("Test invalid pruning command line options")
|
||||
self.test_invalid_command_line_options()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue