Pass parameter via constructor to AuthStatusField
MODIFY
WalletWasabi/Tor/Socks5/Models/Fields/OctetFields/AuthStatusField.cs
WalletWasabi/Tor/Socks5/Models/Fields/OctetFields/AuthStatusField.cs
@@ -5,10 +5,9 @@ namespace WalletWasabi.Tor.Socks5.Models.Fields.OctetFields
{
public class AuthStatusField : OctetSerializableBase
{
- #region Constructors
-
- public AuthStatusField()
+ public AuthStatusField(byte value)
{
+ ByteValue = value;
}
public AuthStatusField(int value)
@@ -16,24 +15,10 @@ namespace WalletWasabi.Tor.Socks5.Models.Fields.OctetFields
ByteValue = (byte)Guard.InRangeAndNotNull(nameof(value), value, 0, 255);
}
- #endregion Constructors
-
- #region Statics
-
public static AuthStatusField Success => new AuthStatusField(0);
- #endregion Statics
-
- #region PropertiesAndMembers
-
public int Value => ByteValue;
- #endregion PropertiesAndMembers
-
- #region
-
public bool IsSuccess() => Value == 0;
-
- #endregion
}
}

MODIFY
WalletWasabi/Tor/Socks5/Models/Messages/UsernamePasswordResponse.cs
WalletWasabi/Tor/Socks5/Models/Messages/UsernamePasswordResponse.cs
@@ -22,8 +22,7 @@ namespace WalletWasabi.Tor.Socks5.Models.Messages
Ver = new AuthVerField();
Ver.FromByte(bytes[0]);
- Status = new AuthStatusField();
- Status.FromByte(bytes[1]);
+ Status = new AuthStatusField(bytes[1]);
}
public override byte[] ToBytes() => new byte[]

Pass parameter via constructor to AuthStatusField