From e155bd9fe9743c002a9be9d696b0e25f80ea861e Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 4 Aug 2025 08:49:20 +0300 Subject: [PATCH] test: add a case for `upgradetohd` with null characters in mnemonic passphrase --- test/functional/wallet_upgradetohd.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/wallet_upgradetohd.py b/test/functional/wallet_upgradetohd.py index aa770716cff1..e732e888b0d5 100755 --- a/test/functional/wallet_upgradetohd.py +++ b/test/functional/wallet_upgradetohd.py @@ -247,6 +247,14 @@ def run_test(self): assert_equal(12, w12.getbalance()) w12.unloadwallet() + self.log.info("Test upgradetohd with null characters in mnemonic passphrase") + # Null characters aren't allowed in mnemonic passphrases, the first one and everything after it is ignored + node.createwallet("wallet-13", blank=True) + w13 = node.get_wallet_rpc("wallet-13") + w13.upgradetohd(custom_mnemonic, "custom-passphrase\0with\0null\0characters") + assert_equal(12, w13.getbalance()) + w13.unloadwallet() + if __name__ == '__main__': WalletUpgradeToHDTest().main ()