Skip to content

Commit 713ea7a

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25906: test: add coverage for invalid parameters for rescanblockchain
d1a0004 test: add coverage for invalid parameters for `rescanblockchain` (brunoerg) Pull request description: This PR adds test coverage for the following errors: https://github.com/bitcoin/bitcoin/blob/2bd9aa5a44b88c866c4d98f8a7bf7154049cba31/src/wallet/rpc/transactions.cpp#L880-L894 ACKs for top commit: w0xlt: reACK bitcoin/bitcoin@d1a0004 Tree-SHA512: c357fbda3d261e4d06a29d2a5350482db5f97a815adf59abdac1971eb19b69cfd4d54e4d21836851e2e3b116aa2a820ea1437c7aededf86b06df435cca16ac90
2 parents 2bd9aa5 + d1a0004 commit 713ea7a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/functional/wallet_transactiontime_rescan.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from test_framework.test_framework import BitcoinTestFramework
1212
from test_framework.util import (
1313
assert_equal,
14+
assert_raises_rpc_error,
1415
set_node_times,
1516
)
1617

@@ -158,5 +159,11 @@ def run_test(self):
158159
assert_equal(tx['time'], cur_time + ten_days + ten_days + ten_days)
159160

160161

162+
self.log.info('Test handling of invalid parameters for rescanblockchain')
163+
assert_raises_rpc_error(-8, "Invalid start_height", restorewo_wallet.rescanblockchain, -1, 10)
164+
assert_raises_rpc_error(-8, "Invalid stop_height", restorewo_wallet.rescanblockchain, 1, -1)
165+
assert_raises_rpc_error(-8, "stop_height must be greater than start_height", restorewo_wallet.rescanblockchain, 20, 10)
166+
167+
161168
if __name__ == '__main__':
162169
TransactionTimeRescanTest().main()

0 commit comments

Comments
 (0)