mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
wallet: default wallet migration, modify inconvenient backup filename
On default legacy wallets, the backup filename starts with an "-" due to the wallet name being empty. This is inconvenient for systems who treat what follows the initial "-" character as flags.
This commit is contained in:
@@ -529,11 +529,20 @@ class WalletMigrationTest(BitcoinTestFramework):
|
||||
self.log.info("Test migration of the wallet named as the empty string")
|
||||
wallet = self.create_legacy_wallet("")
|
||||
|
||||
self.migrate_wallet(wallet)
|
||||
# Set time to verify backup existence later
|
||||
curr_time = int(time.time())
|
||||
wallet.setmocktime(curr_time)
|
||||
|
||||
res = self.migrate_wallet(wallet)
|
||||
info = wallet.getwalletinfo()
|
||||
assert_equal(info["descriptors"], True)
|
||||
assert_equal(info["format"], "sqlite")
|
||||
|
||||
# Check backup existence and its non-empty wallet filename
|
||||
backup_path = self.nodes[0].wallets_path / f'default_wallet_{curr_time}.legacy.bak'
|
||||
assert backup_path.exists()
|
||||
assert_equal(str(backup_path), res['backup_path'])
|
||||
|
||||
def test_direct_file(self):
|
||||
self.log.info("Test migration of a wallet that is not in a wallet directory")
|
||||
wallet = self.create_legacy_wallet("plainfile")
|
||||
|
Reference in New Issue
Block a user