Conform NotSupportedException messages
MODIFY
WalletWasabi.Tests/P2pTests.cs
WalletWasabi.Tests/P2pTests.cs
@@ -46,7 +46,7 @@ namespace WalletWasabi.Tests
}
else
{
- throw new NotSupportedException(network.ToString());
+ throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
}
var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, "AddressManager");

MODIFY
WalletWasabi/Helpers/Constants.cs
WalletWasabi/Helpers/Constants.cs
@@ -64,15 +64,15 @@ namespace WalletWasabi.Helpers
{
return MainNetCoordinatorAddress;
}
-
- if (network == Network.TestNet)
+ else if (network == Network.TestNet)
{
return TestNetCoordinatorAddress;
}
-
- // else regtest
+ else // else regtest
+ {
return RegTestCoordinatorAddress;
}
+ }
public const string ChangeOfSpecialLabelStart = "change of (";
public const string ChangeOfSpecialLabelEnd = ")";

MODIFY
WalletWasabi/Stores/StartingFilters.cs
WalletWasabi/Stores/StartingFilters.cs
@@ -15,15 +15,18 @@ namespace WalletWasabi.Stores
{
return FilterModel.FromHeightlessLine("0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:02832810ec08a0", GetStartingHeight(network));
}
- if (network == Network.TestNet)
+ else if (network == Network.TestNet)
{
return FilterModel.FromHeightlessLine("00000000000f0d5edcaeba823db17f366be49a80d91d15b77747c2e017b8c20a:017821b8", GetStartingHeight(network));
}
- if (network == Network.RegTest)
+ else if (network == Network.RegTest)
{
return FilterModel.FromHeightlessLine("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", GetStartingHeight(network));
}
- throw new NotSupportedException($"{network} is not supported.");
+ else
+ {
+ throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ }
}
public static Height GetStartingHeight(Network network) // First possible bech32 transaction ever.
@@ -32,15 +35,18 @@ namespace WalletWasabi.Stores
{
return new Height(481824);
}
- if (network == Network.TestNet)
+ else if (network == Network.TestNet)
{
return new Height(828575);
}
- if (network == Network.RegTest)
+ else if (network == Network.RegTest)
{
return new Height(0);
}
- throw new NotSupportedException($"{network} is not supported.");
+ else
+ {
+ throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ }
}
}
}

MODIFY
WalletWasabi/TorSocks5/Models/Fields/ByteArrayFields/AddrField.cs
WalletWasabi/TorSocks5/Models/Fields/ByteArrayFields/AddrField.cs
@@ -26,7 +26,7 @@ namespace WalletWasabi.TorSocks5.Models.TorSocks5.Fields.ByteArrayFields
if (Atyp != AtypField.IPv4)
{
- throw new NotSupportedException($"{nameof(Atyp)} is not supported. Value: {Atyp}.");
+ throw new NotSupportedException($"{nameof(Atyp)} not supported. Value: {Atyp}.");
}
var values = new string[4];
@@ -100,7 +100,7 @@ namespace WalletWasabi.TorSocks5.Models.TorSocks5.Fields.ByteArrayFields
}
else
{
- throw new NotSupportedException($"{nameof(atyp)} is not supported. Value: {atyp}.");
+ throw new NotSupportedException($"{nameof(atyp)} not supported. Value: {atyp}.");
}
Bytes = bytes;

MODIFY
WalletWasabi/TorSocks5/TorSocks5Client.cs
WalletWasabi/TorSocks5/TorSocks5Client.cs
@@ -150,7 +150,7 @@ namespace WalletWasabi.TorSocks5
methodSelection.FromBytes(receiveBuffer);
if (methodSelection.Ver != VerField.Socks5)
{
- throw new NotSupportedException($"SOCKS{methodSelection.Ver.Value} is not supported. Only SOCKS5 is supported.");
+ throw new NotSupportedException($"SOCKS{methodSelection.Ver.Value} not supported. Only SOCKS5 is supported.");
}
if (methodSelection.Method == MethodField.NoAcceptableMethods)
{
@@ -181,7 +181,7 @@ namespace WalletWasabi.TorSocks5
userNamePasswordResponse.FromBytes(receiveBuffer);
if (userNamePasswordResponse.Ver != usernamePasswordRequest.Ver)
{
- throw new NotSupportedException($"Authentication version {userNamePasswordResponse.Ver.Value} is not supported. Only version {usernamePasswordRequest.Ver} is supported.");
+ throw new NotSupportedException($"Authentication version {userNamePasswordResponse.Ver.Value} not supported. Only version {usernamePasswordRequest.Ver} is supported.");
}
if (!userNamePasswordResponse.Status.IsSuccess()) // Tor authentication is different, this will never happen;

MODIFY
WalletWasabi/WebClients/BlockCypher/BlockCypherClient.cs
WalletWasabi/WebClients/BlockCypher/BlockCypherClient.cs
@@ -34,7 +34,7 @@ namespace WalletWasabi.WebClients.BlockCypher
}
else
{
- throw new NotSupportedException($"{network} is not supported");
+ throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
}
}

MODIFY
WalletWasabi/WebClients/SmartBit/SmartBitClient.cs
WalletWasabi/WebClients/SmartBit/SmartBitClient.cs
@@ -37,7 +37,7 @@ namespace WalletWasabi.WebClients.SmartBit
}
else
{
- throw new NotSupportedException($"{network} is not supported");
+ throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
}
}

Conform NotSupportedException messages