aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_migration.py
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2023-08-11 09:41:41 -0300
committerbrunoerg <brunoely.gc@gmail.com>2023-08-11 16:40:23 -0300
commit769f5b15f207ce6d1067672ea5e195541c97de6b (patch)
treebb17a5c99066c8729b50d184ecb4d31a3d5694a8 /test/functional/wallet_migration.py
parentb2ec0326fd76e64a6d0d7e4745506b29f60d0be5 (diff)
test: check backup from `migratewallet` can be successfully restored
Diffstat (limited to 'test/functional/wallet_migration.py')
-rwxr-xr-xtest/functional/wallet_migration.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/wallet_migration.py b/test/functional/wallet_migration.py
index 925376e8cd..c565c879fb 100755
--- a/test/functional/wallet_migration.py
+++ b/test/functional/wallet_migration.py
@@ -134,13 +134,22 @@ class WalletMigrationTest(BitcoinTestFramework):
self.generate(self.nodes[0], 1)
bal = basic1.getbalance()
txs = basic1.listtransactions()
+ addr_gps = basic1.listaddressgroupings()
- basic1.migratewallet()
+ basic1_migrate = basic1.migratewallet()
assert_equal(basic1.getwalletinfo()["descriptors"], True)
self.assert_is_sqlite("basic1")
assert_equal(basic1.getbalance(), bal)
self.assert_list_txs_equal(basic1.listtransactions(), txs)
+ self.log.info("Test backup file can be successfully restored")
+ self.nodes[0].restorewallet("basic1_restored", basic1_migrate['backup_path'])
+ basic1_restored = self.nodes[0].get_wallet_rpc("basic1_restored")
+ basic1_restored_wi = basic1_restored.getwalletinfo()
+ assert_equal(basic1_restored_wi['balance'], bal)
+ assert_equal(basic1_restored.listaddressgroupings(), addr_gps)
+ self.assert_list_txs_equal(basic1_restored.listtransactions(), txs)
+
# restart node and verify that everything is still there
self.restart_node(0)
default = self.nodes[0].get_wallet_rpc(self.default_wallet_name)