mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-06 16:36:57 +02:00
test: add coverage for invalid parameters for rescanblockchain
This commit is contained in:
@ -11,6 +11,7 @@ from test_framework.blocktools import COINBASE_MATURITY
|
|||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
assert_equal,
|
assert_equal,
|
||||||
|
assert_raises_rpc_error,
|
||||||
set_node_times,
|
set_node_times,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -158,5 +159,11 @@ class TransactionTimeRescanTest(BitcoinTestFramework):
|
|||||||
assert_equal(tx['time'], cur_time + ten_days + ten_days + ten_days)
|
assert_equal(tx['time'], cur_time + ten_days + ten_days + ten_days)
|
||||||
|
|
||||||
|
|
||||||
|
self.log.info('Test handling of invalid parameters for rescanblockchain')
|
||||||
|
assert_raises_rpc_error(-8, "Invalid start_height", restorewo_wallet.rescanblockchain, -1, 10)
|
||||||
|
assert_raises_rpc_error(-8, "Invalid stop_height", restorewo_wallet.rescanblockchain, 1, -1)
|
||||||
|
assert_raises_rpc_error(-8, "stop_height must be greater than start_height", restorewo_wallet.rescanblockchain, 20, 10)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
TransactionTimeRescanTest().main()
|
TransactionTimeRescanTest().main()
|
||||||
|
Reference in New Issue
Block a user