aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_createwallet.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/wallet_createwallet.py')
-rwxr-xr-xtest/functional/wallet_createwallet.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/wallet_createwallet.py b/test/functional/wallet_createwallet.py
index 4416a9655f..12480d4d1e 100755
--- a/test/functional/wallet_createwallet.py
+++ b/test/functional/wallet_createwallet.py
@@ -26,6 +26,11 @@ class CreateWalletTest(BitcoinTestFramework):
node = self.nodes[0]
self.generate(node, 1) # Leave IBD for sethdseed
+ self.log.info("Run createwallet with invalid parameters.")
+ # Run createwallet with invalid parameters. This must not prevent a new wallet with the same name from being created with the correct parameters.
+ assert_raises_rpc_error(-4, "Passphrase provided but private keys are disabled. A passphrase is only used to encrypt private keys, so cannot be used for wallets with private keys disabled.",
+ self.nodes[0].createwallet, wallet_name='w0', disable_private_keys=True, passphrase="passphrase")
+
self.nodes[0].createwallet(wallet_name='w0')
w0 = node.get_wallet_rpc('w0')
address1 = w0.getnewaddress()
@@ -164,5 +169,10 @@ class CreateWalletTest(BitcoinTestFramework):
self.log.info('Using a passphrase with private keys disabled returns error')
assert_raises_rpc_error(-4, 'Passphrase provided but private keys are disabled. A passphrase is only used to encrypt private keys, so cannot be used for wallets with private keys disabled.', self.nodes[0].createwallet, wallet_name='w9', disable_private_keys=True, passphrase='thisisapassphrase')
+ if self.is_bdb_compiled():
+ self.log.info("Test legacy wallet deprecation")
+ res = self.nodes[0].createwallet(wallet_name="legacy_w0", descriptors=False, passphrase=None)
+ assert_equal(res["warning"], "Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future.")
+
if __name__ == '__main__':
CreateWalletTest().main()