move helper to library
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/ConnectHardwareWalletViewModel.cs
@@ -11,6 +11,7 @@ using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets;
+using WalletWasabi.Helpers;
using WalletWasabi.Hwi.Models;
using WalletWasabi.Logging;
using WalletWasabi.Nito.AsyncEx;
@@ -99,7 +100,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
{
CancellationTokenSource cts = new();
AbandonedTasks.AddAndClearCompleted(CheckForPassphraseAsync(cts.Token));
- var result = await HardwareWalletOperations.DetectAsync(WalletManager.Network, cancel);
+ var result = await HardwareWalletOperationHelper.DetectAsync(WalletManager.Network, cancel);
cts.Cancel();
EvaluateDetectionResult(result, cancel);
}
@@ -159,7 +160,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
else
{
Message = "Check your device and finish the initialization.";
- AbandonedTasks.AddAndClearCompleted(HardwareWalletOperations.InitHardwareWalletAsync(device, WalletManager.Network, cancel));
+ AbandonedTasks.AddAndClearCompleted(HardwareWalletOperationHelper.InitHardwareWalletAsync(device, WalletManager.Network, cancel));
}
return;

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/DetectedHardwareWalletViewModel.cs
@@ -5,6 +5,7 @@ using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Extensions;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Helpers;
using WalletWasabi.Hwi.Models;
using WalletWasabi.Logging;
using WalletWasabi.Wallets;
@@ -35,7 +36,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
try
{
var walletFilePath = WalletManager.WalletDirectories.GetWalletFilePaths(WalletName).walletFilePath;
- var km = await HardwareWalletOperations.GenerateWalletAsync(device, walletFilePath, WalletManager.Network, CancelCts.Token);
+ var km = await HardwareWalletOperationHelper.GenerateWalletAsync(device, walletFilePath, WalletManager.Network, CancelCts.Token);
km.SetIcon(Type);
Navigate().To(new AddedWalletPageViewModel(walletManager, km));

RENAME
WalletWasabi.Fluent/ViewModels/AddWallet/HardwareWallet/HardwareWalletOperations.cs
WalletWasabi/Helpers/HardwareWalletOperationHelper.cs
@@ -8,9 +8,9 @@ using WalletWasabi.Hwi;
using WalletWasabi.Hwi.Models;
using WalletWasabi.Logging;
-namespace WalletWasabi.Fluent.ViewModels.AddWallet.HardwareWallet
+namespace WalletWasabi.Helpers
{
- public static class HardwareWalletOperations
+ public static class HardwareWalletOperationHelper
{
public static async Task<KeyManager> GenerateWalletAsync(HwiEnumerateEntry device, string walletFilePath, Network network, CancellationToken cancelToken)
{

move helper to library