rename interface IErrorList to IValidationErrors.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -468,6 +468,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
base.OnDeselected();
}
- public void ValidatePassword(IErrorList errors) => PasswordHelper.ValidatePassword(errors, Password);
+ public void ValidatePassword(IValidationErrors errors) => PasswordHelper.ValidatePassword(errors, Password);
}
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -867,7 +867,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
&& userFee > 0;
}
- private void ValidateUserFeeText(IErrorList errors)
+ private void ValidateUserFeeText(IValidationErrors errors)
{
if (!TryParseUserFee(out _))
{
@@ -875,9 +875,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
}
- private void ValidatePassword(IErrorList errors) => PasswordHelper.ValidatePassword(errors, Password);
+ private void ValidatePassword(IValidationErrors errors) => PasswordHelper.ValidatePassword(errors, Password);
- private void ValidateAddress(IErrorList errors)
+ private void ValidateAddress(IValidationErrors errors)
{
if (string.IsNullOrWhiteSpace(Address))
{
@@ -905,7 +905,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
errors.Add(ErrorSeverity.Error, "Invalid address.");
}
- private void ValidateCustomChangeAddress(IErrorList errors)
+ private void ValidateCustomChangeAddress(IValidationErrors errors)
{
if (string.IsNullOrWhiteSpace(CustomChangeAddress))
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
@@ -118,7 +118,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _extendedAccountZprv, value);
}
- public void ValidatePassword(IErrorList errors) => PasswordHelper.ValidatePassword(errors, Password);
+ public void ValidatePassword(IValidationErrors errors) => PasswordHelper.ValidatePassword(errors, Password);
private void ClearSensitiveData(bool passwordToo)
{

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -375,25 +375,25 @@ namespace WalletWasabi.Gui.Tabs
#region Validation
- private void ValidateSomePrivacyLevel(IErrorList errors)
+ private void ValidateSomePrivacyLevel(IValidationErrors errors)
=> ValidatePrivacyLevel(errors, SomePrivacyLevel, whiteSpaceOk: true);
- private void ValidateFinePrivacyLevel(IErrorList errors)
+ private void ValidateFinePrivacyLevel(IValidationErrors errors)
=> ValidatePrivacyLevel(errors, FinePrivacyLevel, whiteSpaceOk: true);
- private void ValidateStrongPrivacyLevel(IErrorList errors)
+ private void ValidateStrongPrivacyLevel(IValidationErrors errors)
=> ValidatePrivacyLevel(errors, StrongPrivacyLevel, whiteSpaceOk: true);
- private void ValidateDustThreshold(IErrorList errors)
+ private void ValidateDustThreshold(IValidationErrors errors)
=> ValidateDustThreshold(errors, DustThreshold, whiteSpaceOk: true);
- private void ValidateTorSocks5EndPoint(IErrorList errors)
+ private void ValidateTorSocks5EndPoint(IValidationErrors errors)
=> ValidateEndPoint(errors, TorSocks5EndPoint, Constants.DefaultTorSocksPort, whiteSpaceOk: true);
- private void ValidateBitcoinP2pEndPoint(IErrorList errors)
+ private void ValidateBitcoinP2pEndPoint(IValidationErrors errors)
=> ValidateEndPoint(errors, BitcoinP2pEndPoint, Network.DefaultPort, whiteSpaceOk: true);
- private void ValidatePrivacyLevel(IErrorList errors, string value, bool whiteSpaceOk)
+ private void ValidatePrivacyLevel(IValidationErrors errors, string value, bool whiteSpaceOk)
{
if (!whiteSpaceOk || !string.IsNullOrWhiteSpace(value))
{
@@ -404,7 +404,7 @@ namespace WalletWasabi.Gui.Tabs
}
}
- private void ValidateDustThreshold(IErrorList errors, string dustThreshold, bool whiteSpaceOk)
+ private void ValidateDustThreshold(IValidationErrors errors, string dustThreshold, bool whiteSpaceOk)
{
if (!whiteSpaceOk || !string.IsNullOrWhiteSpace(dustThreshold))
{
@@ -420,7 +420,7 @@ namespace WalletWasabi.Gui.Tabs
}
}
- private void ValidateEndPoint(IErrorList errors, string endPoint, int defaultPort, bool whiteSpaceOk)
+ private void ValidateEndPoint(IValidationErrors errors, string endPoint, int defaultPort, bool whiteSpaceOk)
{
if (!whiteSpaceOk || !string.IsNullOrWhiteSpace(endPoint))
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletViewModel.cs
@@ -64,7 +64,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
}
}
- public void ValidatePassword(IErrorList errors)
+ public void ValidatePassword(IValidationErrors errors)
{
string password = Password;

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletViewModel.cs
@@ -131,7 +131,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
private ReplaySubject<Unit> ResortTrigger { get; } = new ReplaySubject<Unit>();
private CompositeDisposable Disposables { get; } = new CompositeDisposable();
- public void ValidatePassword(IErrorList errors) => PasswordHelper.ValidatePassword(errors, Password);
+ public void ValidatePassword(IValidationErrors errors) => PasswordHelper.ValidatePassword(errors, Password);
public override void OnCategorySelected()
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWallets/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWallets/RecoverWalletViewModel.cs
@@ -109,7 +109,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager.RecoverWallets
private Global Global { get; }
private Wallets.WalletManager WalletManager { get; }
- public void ValidatePassword(IErrorList errors) => PasswordHelper.ValidatePassword(errors, Password);
+ public void ValidatePassword(IValidationErrors errors) => PasswordHelper.ValidatePassword(errors, Password);
public string Password
{

MODIFY
WalletWasabi.Gui/ViewModels/Validation/Validator.cs
WalletWasabi.Gui/ViewModels/Validation/Validator.cs
@@ -6,5 +6,5 @@ using WalletWasabi.Models;
namespace WalletWasabi.Gui.ViewModels.Validation
{
- public delegate void ValidateMethod(IErrorList errors);
+ public delegate void ValidateMethod(IValidationErrors errors);
}

MODIFY
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
@@ -35,7 +35,7 @@ namespace WalletWasabi.Gui.ViewModels
if(parameters.Length == 1)
{
- if(parameters.First().ParameterType == typeof(IErrorList))
+ if(parameters.First().ParameterType == typeof(IValidationErrors))
{
return true;
}

MODIFY
WalletWasabi/Helpers/PasswordHelper.cs
WalletWasabi/Helpers/PasswordHelper.cs
@@ -152,7 +152,7 @@ namespace WalletWasabi.Helpers
throw resultException; // Throw the last exception - Invalid password.
}
- public static void ValidatePassword(IErrorList errors, string password)
+ public static void ValidatePassword(IValidationErrors errors, string password)
{
if (IsTrimable(password, out _))
{

MODIFY
WalletWasabi/Models/ErrorDescriptors.cs
WalletWasabi/Models/ErrorDescriptors.cs
@@ -2,7 +2,7 @@ using System.Collections.Generic;
namespace WalletWasabi.Models
{
- public class ErrorDescriptors : List<ErrorDescriptor>, IErrorList
+ public class ErrorDescriptors : List<ErrorDescriptor>, IValidationErrors
{
public static ErrorDescriptors Empty = Create();
@@ -17,7 +17,7 @@ namespace WalletWasabi.Models
return new ErrorDescriptors();
}
- void IErrorList.Add(ErrorSeverity severity, string error)
+ void IValidationErrors.Add(ErrorSeverity severity, string error)
{
Add(new ErrorDescriptor(severity, error));
}

ADD
WalletWasabi/Models/IValidationErrors.cs
+namespace WalletWasabi.Models
+{
+ public interface IValidationErrors
+ {
+ void Add(ErrorSeverity severity, string error);
+ }
+}

rename interface IErrorList to IValidationErrors.