mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
litecoin fixes
This commit is contained in:
parent
4052d7edd5
commit
a008c1f2dd
2 changed files with 38 additions and 35 deletions
|
@ -106,5 +106,11 @@ Map<DerivationType, List<DerivationInfo>> bitcoin_derivations = {
|
|||
description: "Samourai Ricochet native segwit",
|
||||
scriptType: "p2wpkh",
|
||||
),
|
||||
DerivationInfo(
|
||||
derivationType: DerivationType.bip39,
|
||||
derivationPath: "m/84'/2'/0'",
|
||||
description: "Default Litecoin",
|
||||
scriptType: "p2wpkh",
|
||||
),
|
||||
],
|
||||
};
|
||||
|
|
|
@ -355,12 +355,9 @@ class WalletRestorePage extends BasePage {
|
|||
|
||||
walletRestoreViewModel.state = IsExecutingState();
|
||||
|
||||
List<DerivationType> derivationTypes =
|
||||
await walletRestoreViewModel.getDerivationTypes(_credentials());
|
||||
DerivationInfo? dInfo;
|
||||
|
||||
if (derivationTypes.length > 1) {
|
||||
// push screen to choose the derivation type:
|
||||
// get info about the different derivations:
|
||||
List<DerivationInfo> derivations =
|
||||
await walletRestoreViewModel.getDerivationInfo(_credentials());
|
||||
|
||||
|
@ -373,32 +370,32 @@ class WalletRestorePage extends BasePage {
|
|||
}
|
||||
}
|
||||
|
||||
// dInfo = await Navigator.of(context).pushNamed(Routes.restoreWalletChooseDerivation,
|
||||
// arguments: derivations) as DerivationInfo?;
|
||||
|
||||
if (derivationsWithHistory > 1) {
|
||||
dInfo = await Navigator.of(context).pushNamed(Routes.restoreWalletChooseDerivation,
|
||||
arguments: derivations) as DerivationInfo?;
|
||||
dInfo = await Navigator.of(context).pushNamed(
|
||||
Routes.restoreWalletChooseDerivation,
|
||||
arguments: derivations,
|
||||
) as DerivationInfo?;
|
||||
} else if (derivationsWithHistory == 1) {
|
||||
dInfo = derivations[derivationWithHistoryIndex];
|
||||
} else {
|
||||
dInfo = walletRestoreViewModel.getCommonRestoreDerivation();
|
||||
}
|
||||
|
||||
if (dInfo == null) {
|
||||
walletRestoreViewModel.state = InitialExecutionState();
|
||||
return;
|
||||
}
|
||||
|
||||
this.derivationInfo = dInfo;
|
||||
}
|
||||
|
||||
// get the default derivation for this wallet type:
|
||||
if (this.derivationInfo == null) {
|
||||
this.derivationInfo = walletRestoreViewModel.getDefaultDerivation();
|
||||
if (dInfo == null) {
|
||||
// we only return 1 derivation if we're pretty sure we know which one to use:
|
||||
if (derivations.length == 1) {
|
||||
dInfo = derivations.first;
|
||||
} else {
|
||||
// if we have multiple possible derivations, and none have histories
|
||||
// we just default to the most common one:
|
||||
dInfo = walletRestoreViewModel.getCommonRestoreDerivation();
|
||||
}
|
||||
}
|
||||
|
||||
this.derivationInfo = dInfo;
|
||||
if (this.derivationInfo == null) {
|
||||
walletRestoreViewModel.state = InitialExecutionState();
|
||||
return;
|
||||
}
|
||||
|
||||
walletRestoreViewModel.create(options: _credentials());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue