aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-04-27 06:07:16 +0100
committerfanquake <fanquake@gmail.com>2023-04-27 06:20:20 +0100
commitba4076d26f8668633ea03072347a5288e21d55f5 (patch)
treead51a695810a7753186dff51907c01d54e052467
parent91ccb62faab21b2b52b089cc04f3a5c1bf6989cc (diff)
parentcca4f82b828669ae23f6ac64fb83e068b81ae189 (diff)
Merge bitcoin/bitcoin#25937: test: add coverage for rpc error when trying to rescan beyond pruned data
cca4f82b828669ae23f6ac64fb83e068b81ae189 test: add coverage for rpc error when trying to rescan beyond pruned data (brunoerg) Pull request description: This PR adds test coverage for the following rpc error: https://github.com/bitcoin/bitcoin/blob/15692e2641592394bdd4da0a7c2d371de8e576dd/src/wallet/rpc/transactions.cpp#L896-L899 ACKs for top commit: MarcoFalke: lgtm ACK cca4f82b828669ae23f6ac64fb83e068b81ae189 aureleoules: ACK cca4f82b828669ae23f6ac64fb83e068b81ae189 Tree-SHA512: 724a055e9f6cddf1935699e8769015115f24f6485a0bd87e8660072ee44a15c1bddfdda848acc101ea7184b7e65a33b5b0d80b563d2ba3ecdab7a631378d6476
-rwxr-xr-xtest/functional/feature_pruning.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 519877ac5b..b0c6138bcf 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -135,6 +135,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")
@@ -469,6 +473,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()