Skip to content

Commit d1a0004

Browse files
committed
test: add coverage for invalid parameters for rescanblockchain
1 parent c336f81 commit d1a0004

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)