diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2019-04-04 00:39:04 -0700 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2019-04-13 18:52:11 -0700 |
commit | 510c6532bae9abc5beda1c126c945923a64680cb (patch) | |
tree | 08817bc88ad774370833066ca14714a6f8a2d262 /test/functional/wallet_importmulti.py | |
parent | ba54342c9dd3f2e5cdeed9ac57f1924f0d885cc6 (diff) |
Extract ParseDescriptorRange
So as to be consistently informative when the checks fail, and
to protect against unintentional divergence among the checks.
Diffstat (limited to 'test/functional/wallet_importmulti.py')
-rwxr-xr-x | test/functional/wallet_importmulti.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py index 5bfbaa2f0b..939390ecfe 100755 --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -591,6 +591,21 @@ class ImportMultiTest(BitcoinTestFramework): key.p2sh_p2wpkh_addr, solvable=True) + self.test_importmulti({"desc": descsum_create(desc), "timestamp": "now", "range": -1}, + success=False, error_code=-8, error_message='End of range is too high') + + self.test_importmulti({"desc": descsum_create(desc), "timestamp": "now", "range": [-1, 10]}, + success=False, error_code=-8, error_message='Range should be greater or equal than 0') + + self.test_importmulti({"desc": descsum_create(desc), "timestamp": "now", "range": [(2 << 31 + 1) - 1000000, (2 << 31 + 1)]}, + success=False, error_code=-8, error_message='End of range is too high') + + self.test_importmulti({"desc": descsum_create(desc), "timestamp": "now", "range": [2, 1]}, + success=False, error_code=-8, error_message='Range specified as [begin,end] must not have begin after end') + + self.test_importmulti({"desc": descsum_create(desc), "timestamp": "now", "range": [0, 1000001]}, + success=False, error_code=-8, error_message='Range is too large') + # Test importing of a P2PKH address via descriptor key = get_key(self.nodes[0]) self.log.info("Should import a p2pkh address from descriptor") |