Remove AccountKeyPath from AdvancedRecoveryOptions
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -103,16 +103,15 @@ public partial class RecoverWalletViewModel : RoutableViewModel
private async Task OnAdvancedRecoveryOptionsDialogAsync()
{
- var result = await NavigateDialogAsync(new AdvancedRecoveryOptionsViewModel((AccountKeyPath, MinGapLimit)),
+ var result = await NavigateDialogAsync(new AdvancedRecoveryOptionsViewModel(MinGapLimit),
NavigationTarget.CompactDialogScreen);
if (result.Kind == DialogResultKind.Normal)
{
- var (accountKeyPathIn, minGapLimitIn) = result.Result;
+ var minGapLimitIn = result.Result;
- if (accountKeyPathIn is { } && minGapLimitIn is { })
+ if (minGapLimitIn is { })
{
- AccountKeyPath = accountKeyPathIn;
MinGapLimit = (int)minGapLimitIn;
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/AdvancedRecoveryOptionsViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/AdvancedRecoveryOptionsViewModel.cs
@@ -9,14 +9,12 @@ using WalletWasabi.Models;
namespace WalletWasabi.Fluent.ViewModels.Dialogs;
[NavigationMetaData(Title = "Advanced Recovery Options")]
-public partial class AdvancedRecoveryOptionsViewModel : DialogViewModelBase<(KeyPath? accountKeyPath, int? minGapLimit)>
+public partial class AdvancedRecoveryOptionsViewModel : DialogViewModelBase<int?>
{
- [AutoNotify] private string _accountKeyPath;
[AutoNotify] private string _minGapLimit;
- public AdvancedRecoveryOptionsViewModel((KeyPath keyPath, int minGapLimit) interactionInput)
+ public AdvancedRecoveryOptionsViewModel(int minGapLimit)
{
- this.ValidateProperty(x => x.AccountKeyPath, ValidateAccountKeyPath);
this.ValidateProperty(x => x.MinGapLimit, ValidateMinGapLimit);
SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
@@ -27,12 +25,10 @@ public partial class AdvancedRecoveryOptionsViewModel : DialogViewModelBase<(Key
var nextCommandCanExecute = this.WhenAnyValue(
x => x.IsDialogOpen,
- x => x.AccountKeyPath,
x => x.MinGapLimit,
delegate
{
// This will fire validations before return canExecute value.
- this.RaisePropertyChanged(nameof(AccountKeyPath));
this.RaisePropertyChanged(nameof(MinGapLimit));
return IsDialogOpen && !Validations.Any;
@@ -41,13 +37,12 @@ public partial class AdvancedRecoveryOptionsViewModel : DialogViewModelBase<(Key
var cancelCommandCanExecute = this.WhenAnyValue(x => x.IsDialogOpen).ObserveOn(RxApp.MainThreadScheduler);
- _accountKeyPath = interactionInput.keyPath.ToString();
- _minGapLimit = interactionInput.minGapLimit.ToString();
+ _minGapLimit = minGapLimit.ToString();
BackCommand = ReactiveCommand.Create(() => Navigate().Back(), backCommandCanExecute);
NextCommand = ReactiveCommand.Create(
- () => Close(result: (KeyPath.Parse(AccountKeyPath), int.Parse(MinGapLimit))),
+ () => Close(result: int.Parse(MinGapLimit)),
nextCommandCanExecute);
CancelCommand = ReactiveCommand.Create(() => Close(), cancelCommandCanExecute);
@@ -64,23 +59,6 @@ public partial class AdvancedRecoveryOptionsViewModel : DialogViewModelBase<(Key
}
}
- private void ValidateAccountKeyPath(IValidationErrors errors)
- {
- if (KeyPath.TryParse(AccountKeyPath, out var keyPath) && keyPath is { })
- {
- var accountKeyPath = keyPath.GetAccountKeyPath();
- if (keyPath.Length != accountKeyPath.Length ||
- accountKeyPath.Length != KeyManager.GetAccountKeyPath(Network.Main, ScriptPubKeyType.Segwit).Length)
- {
- errors.Add(ErrorSeverity.Error, "Path is not a compatible account derivation path.");
- }
- }
- else
- {
- errors.Add(ErrorSeverity.Error, "Path is not a valid derivation path.");
- }
- }
-
protected override void OnDialogClosed()
{
}

MODIFY
WalletWasabi.Fluent/Views/Dialogs/AdvancedRecoveryOptionsView.axaml
WalletWasabi.Fluent/Views/Dialogs/AdvancedRecoveryOptionsView.axaml
EnableBack="{Binding EnableBack}"
EnableNext="True" NextContent="OK">
<StackPanel HorizontalAlignment="Center" Spacing="20" MinWidth="380">
- <StackPanel>
- <Label Content="Account Key _Derivation Path:" Target="TbKeyPath" />
- <TextBox Name="TbKeyPath"
- Watermark="e.g., m/84'/0'/0'"
- Text="{Binding AccountKeyPath}"
+ <Label Content="Minimum _Gap Limit:" Target="TbGapLimit" />
+ <TextBox Name="TbGapLimit" Watermark="e.g., 63"
+ Text="{Binding MinGapLimit}"
+ DockPanel.Dock="Top"
Width="350"
Classes="hasCheckMark">
<i:Interaction.Behaviors>
</i:Interaction.Behaviors>
</TextBox>
</StackPanel>
- <StackPanel>
- <Label Content="Minimum _Gap Limit:" Target="TbGapLimit" />
- <TextBox Name="TbGapLimit" Watermark="e.g., 63"
- Text="{Binding MinGapLimit}"
- DockPanel.Dock="Top"
- Width="350"
- Classes="hasCheckMark" />
- </StackPanel>
- </StackPanel>
</c:ContentArea>
</UserControl>

Remove AccountKeyPath from AdvancedRecoveryOptions (#9743)