Skip to content

Commit 6f29409

Browse files
committed
test: Add a test that creates a wallet with invalid parameters
Invalid parameters must not prevent a new wallet with the same name from being created with the correct parameters
1 parent 0359d9b commit 6f29409

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/functional/wallet_createwallet.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def run_test(self):
2626
node = self.nodes[0]
2727
self.generate(node, 1) # Leave IBD for sethdseed
2828

29+
self.log.info("Run createwallet with invalid parameters.")
30+
# Run createwallet with invalid parameters. This must not prevent a new wallet with the same name from being created with the correct parameters.
31+
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.",
32+
self.nodes[0].createwallet, wallet_name='w0', descriptors=True, disable_private_keys=True, passphrase="passphrase")
33+
2934
self.nodes[0].createwallet(wallet_name='w0')
3035
w0 = node.get_wallet_rpc('w0')
3136
address1 = w0.getnewaddress()

0 commit comments

Comments
 (0)