mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
write migration for existing bitcoin and nano wallets
This commit is contained in:
parent
8fa9db24df
commit
5e9743cdb9
2 changed files with 16 additions and 2 deletions
|
@ -175,7 +175,7 @@ Future<void> defaultSettingsMigration(
|
|||
sharedPreferences: sharedPreferences, nodes: nodes);
|
||||
break;
|
||||
case 24:
|
||||
// TODO: await updateBtcAndNanoWalletInfos()
|
||||
await updateBtcNanoWalletInfos(walletInfoSource);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -526,6 +526,20 @@ Future<void> changeDefaultMoneroNode(
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> updateBtcNanoWalletInfos(Box<WalletInfo> walletsInfoSource) async {
|
||||
for (WalletInfo walletInfo in walletsInfoSource.values) {
|
||||
if (walletInfo.type == WalletType.nano || walletInfo.type == WalletType.bitcoin) {
|
||||
walletInfo.derivationInfo = DerivationInfo(
|
||||
derivationPath: walletInfo.derivationPath,
|
||||
derivationType: walletInfo.derivationType,
|
||||
address: walletInfo.address,
|
||||
height: walletInfo.restoreHeight,
|
||||
);
|
||||
await walletInfo.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> checkCurrentNodes(
|
||||
Box<Node> nodeSource, Box<Node> powNodeSource, SharedPreferences sharedPreferences) async {
|
||||
final currentMoneroNodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
|
||||
|
|
|
@ -166,7 +166,7 @@ Future<void> initializeAppConfigs() async {
|
|||
transactionDescriptions: transactionDescriptions,
|
||||
secureStorage: secureStorage,
|
||||
anonpayInvoiceInfo: anonpayInvoiceInfo,
|
||||
initialMigrationVersion: 23);
|
||||
initialMigrationVersion: 24);
|
||||
}
|
||||
|
||||
Future<void> initialSetup(
|
||||
|
|
Loading…
Reference in a new issue