Remove duplicated class
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -24,6 +24,7 @@ using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Helpers;
using WalletWasabi.Hwi;
using WalletWasabi.Hwi.Models;
+using WalletWasabi.Hwi2.Models;
using WalletWasabi.KeyManagement;
using WalletWasabi.Models;
using WalletWasabi.Services;
@@ -412,7 +413,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
var hwis = await HwiProcessManager.EnumerateAsync();
- bool ledgerNotReady = hwis.Any(x => x.Type == HardwareWalletType.Ledger && !x.Ready);
+ bool ledgerNotReady = hwis.Any(x => x.Type == HardwareWalletVendors.Ledger && !x.Ready);
if (ledgerNotReady) // For Ledger you have to log into your "Bitcoin" account.
{
throw new InvalidOperationException("Log into your Bitcoin account on your Ledger. If you're already logged in, log out and log in again.");

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Hwi;
using WalletWasabi.Hwi.Models;
+using WalletWasabi.Hwi2.Models;
using WalletWasabi.Logging;
namespace WalletWasabi.Gui.Tabs.WalletManager
@@ -142,14 +143,14 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
// Stop enumerating after you find one. Hardware wallets are acting up, sometimes fingerprint does not arrive for example.
- bool ledgerNotReady = hwis.Any(x => x.Type == HardwareWalletType.Ledger && !x.Ready);
+ bool ledgerNotReady = hwis.Any(x => x.Type == HardwareWalletVendors.Ledger && !x.Ready);
if (ledgerNotReady) // For Ledger you have to log into your "Bitcoin" account.
{
LoadWalletViewModelHardware.SetWarningMessage("Log into your Bitcoin account on your Ledger. If you're already logged in, log out and log in again.");
continue;
}
- if (hwis.Any(x => x.Type == HardwareWalletType.Ledger && x.Ready))
+ if (hwis.Any(x => x.Type == HardwareWalletVendors.Ledger && x.Ready))
{
LoadWalletViewModelHardware.SetWarningMessage("To have a smooth user experience consider turning off your Ledger screensaver.");
}

MODIFY
WalletWasabi/Hwi/HwiProcessManager.cs
WalletWasabi/Hwi/HwiProcessManager.cs
@@ -12,6 +12,7 @@ using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Helpers;
using WalletWasabi.Hwi.Models;
+using WalletWasabi.Hwi2.Models;
using WalletWasabi.Logging;
namespace WalletWasabi.Hwi
@@ -87,13 +88,13 @@ namespace WalletWasabi.Hwi
return signedPsbt;
}
- catch (IOException ex) when (hardwareWalletInfo.Type == HardwareWalletType.Ledger
+ catch (IOException ex) when (hardwareWalletInfo.Type == HardwareWalletVendors.Ledger
&& (ex.Message.Contains("sign_tx cancelled", StringComparison.OrdinalIgnoreCase)
|| ex.Message.Contains("open failed", StringComparison.OrdinalIgnoreCase)))
{
throw new IOException("Log into your Bitcoin account on your Ledger. If you're already logged in, log out and log in again.");
}
- catch (IOException ex) when (hardwareWalletInfo.Type == HardwareWalletType.Ledger
+ catch (IOException ex) when (hardwareWalletInfo.Type == HardwareWalletVendors.Ledger
&& ex.Message.Contains("Bad argument", StringComparison.OrdinalIgnoreCase))
{
throw new IOException("Ledger refused to sign the transaction.");
@@ -137,7 +138,7 @@ namespace WalletWasabi.Hwi
var path = json.Value<string>("path");
var error = json.Value<string>("error");
- var type = (HardwareWalletType)Enum.Parse(typeof(HardwareWalletType), typeString, ignoreCase: true);
+ var type = (HardwareWalletVendors)Enum.Parse(typeof(HardwareWalletVendors), typeString, ignoreCase: true);
var hwi = new HardwareWalletInfo(fingerprint, serialNumber, type, path, error);
hwis.Add(hwi);

MODIFY
WalletWasabi/Hwi/Models/HardwareWalletInfo.cs
WalletWasabi/Hwi/Models/HardwareWalletInfo.cs
@@ -3,12 +3,13 @@ using System;
using System.Collections.Generic;
using System.Text;
using WalletWasabi.Helpers;
+using WalletWasabi.Hwi2.Models;
namespace WalletWasabi.Hwi.Models
{
public class HardwareWalletInfo
{
- public HardwareWalletInfo(string masterFingerprint, string serialNumber, HardwareWalletType type, string path, string error)
+ public HardwareWalletInfo(string masterFingerprint, string serialNumber, HardwareWalletVendors type, string path, string error)
{
try
{
@@ -36,7 +37,7 @@ namespace WalletWasabi.Hwi.Models
{
Initialized = false;
}
- else if (Type == HardwareWalletType.Ledger &&
+ else if (Type == HardwareWalletVendors.Ledger &&
(Error.Contains("get_pubkey_at_path canceled", StringComparison.OrdinalIgnoreCase)
|| Error.Contains("Invalid status 6f04", StringComparison.OrdinalIgnoreCase) // It comes when device asleep too.
|| Error.Contains("Device is asleep", StringComparison.OrdinalIgnoreCase)))
@@ -55,7 +56,7 @@ namespace WalletWasabi.Hwi.Models
public bool NeedPin { get; }
public bool Ready { get; }
public string SerialNumber { get; }
- public HardwareWalletType Type { get; }
+ public HardwareWalletVendors Type { get; }
public string Path { get; }
public string Error { get; }
}

DELETE
WalletWasabi/Hwi/Models/HardwareWalletType.cs
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace WalletWasabi.Hwi.Models
-{
- public enum HardwareWalletType
- {
- Trezor,
- Ledger,
- KeepKey,
- DigitalBitBox,
- Coldcard
- }
-}

Remove duplicated class