set lelantusCoinIsarRescanRequired to false for new/restored from seed wallets

This commit is contained in:
julian 2024-01-19 15:35:46 -06:00
parent 795fde2cc1
commit 2c62bbe9af
2 changed files with 53 additions and 8 deletions

View file

@ -457,18 +457,57 @@ class _NewWalletRecoveryPhraseWarningViewState
);
},
));
String? otherDataJsonString;
if (widget.coin == Coin.tezos) {
otherDataJsonString = jsonEncode({
WalletInfoKeys.tezosDerivationPath:
Tezos.standardDerivationPath.value,
});
// }//todo: probably not needed (broken anyways)
// else if (widget.coin == Coin.epicCash) {
// final int secondsSinceEpoch =
// DateTime.now().millisecondsSinceEpoch ~/ 1000;
// const int epicCashFirstBlock = 1565370278;
// const double overestimateSecondsPerBlock = 61;
// int chosenSeconds = secondsSinceEpoch - epicCashFirstBlock;
// int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock;
// /
// // debugPrint(
// // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds");
// height = approximateHeight;
// if (height < 0) {
// height = 0;
// }
//
// otherDataJsonString = jsonEncode(
// {
// WalletInfoKeys.epiccashData: jsonEncode(
// ExtraEpiccashWalletInfo(
// receivingIndex: 0,
// changeIndex: 0,
// slatesToAddresses: {},
// slatesToCommits: {},
// lastScannedBlock: epicCashFirstBlock,
// restoreHeight: height,
// creationHeight: height,
// ).toMap(),
// ),
// },
// );
} else if (widget.coin == Coin.firo) {
otherDataJsonString = jsonEncode(
{
WalletInfoKeys
.lelantusCoinIsarRescanRequired:
false,
},
);
}
final info = WalletInfo.createNew(
coin: widget.coin,
name: widget.walletName,
otherDataJsonString: coin == Coin.tezos
? jsonEncode({
WalletInfoKeys
.tezosDerivationPath:
Tezos.standardDerivationPath
.value,
})
: null,
otherDataJsonString: otherDataJsonString,
);
var node = ref

View file

@ -250,6 +250,12 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
),
},
);
} else if (widget.coin == Coin.firo) {
otherDataJsonString = jsonEncode(
{
WalletInfoKeys.lelantusCoinIsarRescanRequired: false,
},
);
}
// TODO: do actual check to make sure it is a valid mnemonic for monero