Implement recoverlogic
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
@@ -23,7 +23,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
public GenerateWalletViewModel() : base("Generate Wallet")
{
- GenerateCommand = ReactiveCommand.Create(async () =>
+ GenerateCommand = ReactiveCommand.Create(() =>
{
WalletName = Guard.Correct(WalletName);

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -6,6 +6,7 @@ using System;
using System.Collections.ObjectModel;
using System.IO;
using WalletWasabi.Gui.ViewModels;
+using WalletWasabi.Helpers;
using WalletWasabi.KeyManagement;
using WalletWasabi.Logging;
@@ -22,6 +23,39 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
{
RecoverCommand = ReactiveCommand.Create(() =>
{
+ WalletName = Guard.Correct(WalletName);
+ MnemonicWords = Guard.Correct(MnemonicWords);
+
+ string walletFilePath = Path.Combine(Global.WalletsDir, $"{WalletName}.json");
+
+ if (TermsAccepted == false)
+ {
+ // ValidationMessage = "Terms are not accepted.";
+ }
+ else if (string.IsNullOrWhiteSpace(WalletName))
+ {
+ // ValidationMessage = $"The name {WalletName} is not valid.";
+ }
+ else if (File.Exists(walletFilePath))
+ {
+ // ValidationMessage = $"The name {WalletName} is already taken.";
+ }
+ else if (string.IsNullOrWhiteSpace(MnemonicWords))
+ {
+ // ValidationMessage = $"Mnemonic words were not supplied.";
+ }
+ else
+ {
+ try
+ {
+ var mnemonic = new Mnemonic(MnemonicWords);
+ KeyManager.Recover(mnemonic, Password, walletFilePath);
+ }
+ catch (Exception ex)
+ {
+ // ValidationMessage = ex.ToString();
+ }
+ }
},
this.WhenAnyValue(x => x.TermsAccepted));
}

Implement recoverlogic