aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_importdescriptors.py
diff options
context:
space:
mode:
authorS3RK <1466284+S3RK@users.noreply.github.com>2021-06-28 21:37:53 +0200
committerS3RK <1466284+S3RK@users.noreply.github.com>2021-06-28 21:44:50 +0200
commit3efaf83c75cd8dc2fa084537b8ed6715fb58c04d (patch)
tree5cfbf5602d4d1379935bee09713a555bc4970b4a /test/functional/wallet_importdescriptors.py
parent6737d9655bcf527afbd85d610d805a2d0fd28c4f (diff)
wallet: deactivate descriptor
Diffstat (limited to 'test/functional/wallet_importdescriptors.py')
-rwxr-xr-xtest/functional/wallet_importdescriptors.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/wallet_importdescriptors.py b/test/functional/wallet_importdescriptors.py
index adde375e54..262175c789 100755
--- a/test/functional/wallet_importdescriptors.py
+++ b/test/functional/wallet_importdescriptors.py
@@ -372,6 +372,21 @@ class ImportDescriptorsTest(BitcoinTestFramework):
address = w1.getrawchangeaddress('legacy')
assert_equal(address, "mpA2Wh9dvZT7yfELq1UnrUmAoc5qCkMetg")
+ self.log.info('Check can deactivate active descriptor')
+ self.test_importdesc({'desc': descsum_create('pkh([12345678]' + xpub + '/*)'),
+ 'range': [0, 5],
+ 'active': False,
+ 'timestamp': 'now',
+ 'internal': True
+ },
+ success=True)
+ assert_raises_rpc_error(-4, 'This wallet has no available keys', w1.getrawchangeaddress, 'legacy')
+
+ self.log.info('Verify activation state is persistent')
+ w1.unloadwallet()
+ self.nodes[1].loadwallet('w1')
+ assert_raises_rpc_error(-4, 'This wallet has no available keys', w1.getrawchangeaddress, 'legacy')
+
# # Test importing a descriptor containing a WIF private key
wif_priv = "cTe1f5rdT8A8DFgVWTjyPwACsDPJM9ff4QngFxUixCSvvbg1x6sh"
address = "2MuhcG52uHPknxDgmGPsV18jSHFBnnRgjPg"