Improve order
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletSuccessViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletSuccessViewModel.cs
@@ -16,17 +16,13 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
{
private string _mnemonicWords;
- public GenerateWalletSuccessViewModel(WalletManagerViewModel owner, string password, string walletFilePath, Global global) : base("Wallet Generated Successfully!")
+ public GenerateWalletSuccessViewModel(WalletManagerViewModel owner, KeyManager keyManager, Mnemonic mnemonic) : base("Wallet Generated Successfully!")
{
- // Here we are not letting anything that will be autocorrected later. We need to generate the wallet exactly with the entered password bacause of compatibility.
- PasswordHelper.Guard(password);
-
- var keyManager = KeyManager.CreateNew(out Mnemonic mnemonic, password);
_mnemonicWords = mnemonic.ToString();
ConfirmCommand = ReactiveCommand.Create(() =>
{
- DoConfirmCommand(keyManager, walletFilePath, global);
+ DoConfirmCommand(keyManager);
owner.SelectTestPassword();
});
@@ -35,11 +31,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
.Subscribe(ex => Logger.LogError(ex));
}
- private void DoConfirmCommand(KeyManager keyManager, string walletFilePath, Global global)
+ private void DoConfirmCommand(KeyManager keyManager)
{
- keyManager.SetNetwork(global.Network);
- keyManager.SetBestHeight(new Height(global.BitcoinStore.SmartHeaderChain.TipHeight));
- keyManager.SetFilePath(walletFilePath);
keyManager.ToFile();
NotificationHelpers.Success("Wallet is successfully generated!");

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
@@ -70,7 +70,13 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
{
try
{
- Owner.CurrentView = new GenerateWalletSuccessViewModel(Owner, Password, walletFilePath, Global);
+ PasswordHelper.Guard(Password); // Here we are not letting anything that will be autocorrected later. We need to generate the wallet exactly with the entered password bacause of compatibility. Owner.CurrentView = new GenerateWalletSuccessViewModel(Owner, Password, walletFilePath, Global);
+
+ var km = KeyManager.CreateNew(out Mnemonic mnemonic, Password);
+ km.SetNetwork(Global.Network);
+ km.SetBestHeight(new Height(Global.BitcoinStore.SmartHeaderChain.TipHeight));
+ km.SetFilePath(walletFilePath);
+ Owner.CurrentView = new GenerateWalletSuccessViewModel(Owner, km, mnemonic);
}
catch (Exception ex)
{

Improve order