mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 20:19:25 +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);
|
sharedPreferences: sharedPreferences, nodes: nodes);
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
// TODO: await updateBtcAndNanoWalletInfos()
|
await updateBtcNanoWalletInfos(walletInfoSource);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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(
|
Future<void> checkCurrentNodes(
|
||||||
Box<Node> nodeSource, Box<Node> powNodeSource, SharedPreferences sharedPreferences) async {
|
Box<Node> nodeSource, Box<Node> powNodeSource, SharedPreferences sharedPreferences) async {
|
||||||
final currentMoneroNodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
|
final currentMoneroNodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
|
||||||
|
|
|
@ -166,7 +166,7 @@ Future<void> initializeAppConfigs() async {
|
||||||
transactionDescriptions: transactionDescriptions,
|
transactionDescriptions: transactionDescriptions,
|
||||||
secureStorage: secureStorage,
|
secureStorage: secureStorage,
|
||||||
anonpayInvoiceInfo: anonpayInvoiceInfo,
|
anonpayInvoiceInfo: anonpayInvoiceInfo,
|
||||||
initialMigrationVersion: 23);
|
initialMigrationVersion: 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initialSetup(
|
Future<void> initialSetup(
|
||||||
|
|
Loading…
Reference in a new issue