diff options
author | MacroFake <falke.marco@gmail.com> | 2022-08-24 08:51:36 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-08-24 08:51:40 +0200 |
commit | 713ea7a4181f411949a3e9bb9a358533388b1159 (patch) | |
tree | 5e524f690f91c054c6d8d594fd4a49b24a905996 /test/functional | |
parent | 2bd9aa5a44b88c866c4d98f8a7bf7154049cba31 (diff) | |
parent | d1a00046214c02684438adcfcd23eea39b86bc7f (diff) | |
download | bitcoin-713ea7a4181f411949a3e9bb9a358533388b1159.tar.xz |
Merge bitcoin/bitcoin#25906: test: add coverage for invalid parameters for `rescanblockchain`
d1a00046214c02684438adcfcd23eea39b86bc7f 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 https://github.com/bitcoin/bitcoin/pull/25906/commits/d1a00046214c02684438adcfcd23eea39b86bc7f
Tree-SHA512: c357fbda3d261e4d06a29d2a5350482db5f97a815adf59abdac1971eb19b69cfd4d54e4d21836851e2e3b116aa2a820ea1437c7aededf86b06df435cca16ac90
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_transactiontime_rescan.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/wallet_transactiontime_rescan.py b/test/functional/wallet_transactiontime_rescan.py index 21941084a3..9caa1fa3d0 100755 --- a/test/functional/wallet_transactiontime_rescan.py +++ b/test/functional/wallet_transactiontime_rescan.py @@ -11,6 +11,7 @@ from test_framework.blocktools import COINBASE_MATURITY from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, + assert_raises_rpc_error, set_node_times, ) @@ -158,5 +159,11 @@ class TransactionTimeRescanTest(BitcoinTestFramework): 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__': TransactionTimeRescanTest().main() |