From 730e14a317ae45fe871c8d6f44a51936756bbbea Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 28 Dec 2022 13:41:49 +0100 Subject: [PATCH] test: wallet: check that labels are migrated to watchonly wallet --- test/functional/wallet_migration.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/functional/wallet_migration.py b/test/functional/wallet_migration.py index 93bd5b481a6..688ac986171 100755 --- a/test/functional/wallet_migration.py +++ b/test/functional/wallet_migration.py @@ -258,7 +258,7 @@ class WalletMigrationTest(BitcoinTestFramework): self.log.info("Test migration of a wallet with watchonly imports") imports0 = self.create_legacy_wallet("imports0") - # Exteranl address label + # External address label imports0.setlabel(default.getnewaddress(), "external") # Normal non-watchonly tx @@ -311,6 +311,13 @@ class WalletMigrationTest(BitcoinTestFramework): assert_raises_rpc_error(-5, "Invalid or non-wallet transaction id", watchonly.gettransaction, received_txid) assert_equal(len(watchonly.listtransactions(include_watchonly=True)), 3) + # Check that labels were migrated and persisted to watchonly wallet + self.nodes[0].unloadwallet("imports0_watchonly") + self.nodes[0].loadwallet("imports0_watchonly") + labels = watchonly.listlabels() + assert "external" in labels + assert "imported" in labels + def test_no_privkeys(self): default = self.nodes[0].get_wallet_rpc(self.default_wallet_name)