Fixing things except tests
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
@@ -453,9 +453,9 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
KeyManager keyManager;
try
{
- keyManager = Global.LoadKeyManager(walletName);
+ keyManager = Global.WalletManager.GetWalletByName(walletName).KeyManager;
}
- catch (FileNotFoundException)
+ catch (InvalidOperationException)
{
// The selected wallet is not available any more (someone deleted it?).
OnCategorySelected();
@@ -536,7 +536,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
return;
}
- var wallet = await Task.Run(async () => await Global.WalletManager.CreateAndStartWalletAsync(keyManager));
+ var wallet = await Task.Run(async () => await Global.WalletManager.StartWalletAsync(keyManager));
// Successfully initialized.
Owner.OnClose();
// Open Wallet Explorer tabs

MODIFY
WalletWasabi/Wallets/WalletManager.cs
WalletWasabi/Wallets/WalletManager.cs
@@ -354,10 +354,16 @@ namespace WalletWasabi.Wallets
public Wallet GetWalletByName(string walletName)
{
+ Wallet wallet = null;
lock (Lock)
{
- return Wallets.Keys.FirstOrDefault(x => x.KeyManager.WalletName == walletName);
+ wallet = Wallets.Keys.FirstOrDefault(x => x.KeyManager.WalletName == walletName);
}
+ if (wallet is null)
+ {
+ throw new InvalidOperationException($"Wallet name:{wallet} not found.");
+ }
+ return wallet;
}
}
}

Fixing things except tests