Skip to content

Commit 28012eb

Browse files
committed
test: test \0 for walletpassphrase too for rpc upgradetohd
1 parent bfacf09 commit 28012eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/wallet_upgradetohd.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,14 @@ def run_test(self):
199199
self.recover_non_hd()
200200

201201
self.log.info("Same mnemonic, same mnemonic passphrase, encrypt wallet first, should recover all coins on upgrade after rescan")
202-
walletpass = "111pass222"
202+
# Null characters are allowed in wallet passphrases since v23
203+
walletpass = "111\0pass222"
203204
node.encryptwallet(walletpass)
204205
node.stop()
205206
node.wait_until_stopped()
206207
self.start_node(0, extra_args=['-rescan'])
207208
assert_raises_rpc_error(-13, "Error: Wallet encrypted but passphrase not supplied to RPC.", node.upgradetohd, mnemonic[0])
208-
assert_raises_rpc_error(-14, "Error: The wallet passphrase entered was incorrect", node.upgradetohd, mnemonic[0], "", "wrongpass")
209+
assert_raises_rpc_error(-14, "Error: The wallet passphrase entered was incorrect", node.upgradetohd, mnemonic[0], "", "111")
209210
assert node.upgradetohd(mnemonic[0], "", walletpass)
210211
if not self.options.descriptors:
211212
assert_raises_rpc_error(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.", node.dumphdinfo)

0 commit comments

Comments
 (0)