pass WalletManager instead of Global
MODIFY
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsViewModel.cs
@@ -11,6 +11,7 @@ using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Gui;
using WalletWasabi.Gui.ViewModels;
+using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.AddWallet.CreateWallet
{
@@ -19,7 +20,7 @@ namespace WalletWasabi.Fluent.AddWallet.CreateWallet
private ReadOnlyObservableCollection<RecoveryWord> _confirmationWords;
private SourceList<RecoveryWord> _confirmationWordsSourceList;
- public ConfirmRecoveryWordsViewModel(IScreen screen, List<RecoveryWord> mnemonicWords, KeyManager keyManager, Global global)
+ public ConfirmRecoveryWordsViewModel(IScreen screen, List<RecoveryWord> mnemonicWords, KeyManager keyManager, WalletManager walletManager)
{
HostScreen = screen;
@@ -35,7 +36,7 @@ namespace WalletWasabi.Fluent.AddWallet.CreateWallet
FinishCommand = ReactiveCommand.Create(
() =>
{
- global.WalletManager.AddWallet(keyManager);
+ walletManager.AddWallet(keyManager);
screen.Router.NavigationStack.Clear();
},
finishCommandCanExecute);

MODIFY
WalletWasabi.Fluent/AddWallet/CreateWallet/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/AddWallet/CreateWallet/RecoveryWordsViewModel.cs
@@ -6,12 +6,13 @@ using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Gui;
using WalletWasabi.Gui.ViewModels;
+using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.AddWallet.CreateWallet
{
public class RecoveryWordsViewModel : ViewModelBase, IRoutableViewModel
{
- public RecoveryWordsViewModel(IScreen screen, KeyManager keyManager, Mnemonic mnemonic, Global global)
+ public RecoveryWordsViewModel(IScreen screen, KeyManager keyManager, Mnemonic mnemonic, WalletManager walletManager)
{
HostScreen = screen;
MnemonicWords = new List<RecoveryWord>();
@@ -21,7 +22,7 @@ namespace WalletWasabi.Fluent.AddWallet.CreateWallet
MnemonicWords.Add(new RecoveryWord(i + 1, mnemonic.Words[i]));
}
- ContinueCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new ConfirmRecoveryWordsViewModel(HostScreen, MnemonicWords, keyManager, global)));
+ ContinueCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new ConfirmRecoveryWordsViewModel(HostScreen, MnemonicWords, keyManager, walletManager)));
}
public ICommand ContinueCommand { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -34,10 +34,12 @@ namespace WalletWasabi.Fluent.ViewModels
{
var global = Locator.Current.GetService<Global>();
- var walletGenerator = new WalletGenerator(global.WalletManager.WalletDirectories.WalletsDir, global.Network);
- walletGenerator.TipHeight = global.BitcoinStore.SmartHeaderChain.TipHeight;
+ var walletGenerator = new WalletGenerator(global.WalletManager.WalletDirectories.WalletsDir, global.Network)
+ {
+ TipHeight = global.BitcoinStore.SmartHeaderChain.TipHeight
+ };
var (km, mnemonic) = walletGenerator.GenerateWallet(WalletName, password);
- await screen.Router.Navigate.Execute(new RecoveryWordsViewModel(screen, km, mnemonic, global));
+ await screen.Router.Navigate.Execute(new RecoveryWordsViewModel(screen, km, mnemonic, global.WalletManager));
}
});

pass WalletManager instead of Global