Skip to content

Commit 3306f96

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#25937: test: add coverage for rpc error when trying to rescan beyond pruned data
cca4f82 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 cca4f82 aureleoules: ACK cca4f82 Tree-SHA512: 724a055e9f6cddf1935699e8769015115f24f6485a0bd87e8660072ee44a15c1bddfdda848acc101ea7184b7e65a33b5b0d80b563d2ba3ecdab7a631378d6476
1 parent 712dcaf commit 3306f96

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
@@ -158,6 +158,10 @@ def test_invalid_command_line_options(self):
158158
extra_args=['-prune=550', '-disablegovernance=false'],
159159
)
160160

161+
def test_rescan_blockchain(self):
162+
self.restart_node(0, ["-prune=550"])
163+
assert_raises_rpc_error(-1, "Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.", self.nodes[0].rescanblockchain)
164+
161165
def test_height_min(self):
162166
assert os.path.isfile(os.path.join(self.prunedir, "blk00000.dat")), "blk00000.dat is missing, pruning too early"
163167
self.log.info("Success")
@@ -494,6 +498,9 @@ def run_test(self):
494498
self.log.info("Test wallet re-scan")
495499
self.wallet_test()
496500

501+
self.log.info("Test it's not possible to rescan beyond pruned data")
502+
self.test_rescan_blockchain()
503+
497504
self.log.info("Test invalid pruning command line options")
498505
self.test_invalid_command_line_options()
499506

0 commit comments

Comments
 (0)