diff options
Diffstat (limited to 'test/functional/wallet_importdescriptors.py')
-rwxr-xr-x | test/functional/wallet_importdescriptors.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/test/functional/wallet_importdescriptors.py b/test/functional/wallet_importdescriptors.py index 03e26465f1..bd50b8cdc0 100755 --- a/test/functional/wallet_importdescriptors.py +++ b/test/functional/wallet_importdescriptors.py @@ -24,7 +24,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.descriptors import descsum_create from test_framework.util import ( assert_equal, - assert_greater_than, assert_raises_rpc_error, ) from test_framework.wallet_util import ( @@ -48,7 +47,6 @@ class ImportDescriptorsTest(BitcoinTestFramework): def skip_test_if_missing_module(self): self.skip_if_no_wallet() - self.skip_if_no_sqlite() def test_importdesc(self, req, success, error_code=None, error_message=None, warnings=None, wallet=None): """Run importdescriptors and assert success""" @@ -130,6 +128,20 @@ class ImportDescriptorsTest(BitcoinTestFramework): assert_equal(info["ismine"], True) assert_equal(info["ischange"], True) + self.log.info("Should not import a descriptor with an invalid public key due to whitespace") + self.test_importdesc({"desc": descsum_create("pkh( " + key.pubkey + ")"), + "timestamp": "now", + "internal": True}, + error_code=-5, + error_message=f"pkh(): Key ' {key.pubkey}' is invalid due to whitespace", + success=False) + self.test_importdesc({"desc": descsum_create("pkh(" + key.pubkey + " )"), + "timestamp": "now", + "internal": True}, + error_code=-5, + error_message=f"pkh(): Key '{key.pubkey} ' is invalid due to whitespace", + success=False) + # # Test importing of a P2SH-P2WPKH descriptor key = get_generate_key() self.log.info("Should not import a p2sh-p2wpkh descriptor without checksum") @@ -706,13 +718,6 @@ class ImportDescriptorsTest(BitcoinTestFramework): except JSONRPCException as e: assert e.error["code"] == -4 and "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before changing the passphrase." in e.error["message"] - wallet_info = self.nodes[0].cli("-rpcwallet=encrypted_wallet").getwalletinfo() - try: - duration = wallet_info["scanning"]["duration"] - assert_greater_than(duration, 0) - except Exception: - assert "scanning" not in wallet_info - assert_equal(importing.result(), [{"success": True}]) assert_equal(temp_wallet.getbalance(), encrypted_wallet.getbalance()) |