Merge bitcoin/bitcoin#26910: wallet: migrate wallet, exit early if no legacy data exist

6d31900e52 wallet: migrate wallet, exit early if no legacy data exist (furszy)

Pull request description:

  The process first creates a backup file then return an error,
  without removing the recently created file, when notices that
  the db is already running sqlite.

ACKs for top commit:
  john-moffett:
    ACK 6d31900e52
  achow101:
    ACK 6d31900e52
  ishaanam:
    crACK 6d31900e52

Tree-SHA512: 9fb52e80de96e129487ab91bef13647bc4570a782003b1e37940e2a00ca26283fd24ad39bdb63a984ae0a56140b518fd0d74aa2fc59ab04405b2c179b7d3c54a
This commit is contained in:
Andrew Chow
2023-02-01 17:05:25 -05:00
2 changed files with 10 additions and 4 deletions

View File

@@ -163,6 +163,10 @@ class WalletMigrationTest(BitcoinTestFramework):
assert_equal(basic2.getbalance(), basic2_balance)
self.assert_list_txs_equal(basic2.listtransactions(), basic2_txs)
# Now test migration on a descriptor wallet
self.log.info("Test \"nothing to migrate\" when the user tries to migrate a wallet with no legacy data")
assert_raises_rpc_error(-4, "Error: This wallet is already a descriptor wallet", basic2.migratewallet)
def test_multisig(self):
default = self.nodes[0].get_wallet_rpc(self.default_wallet_name)