Convert obvious `class` to `record`
MODIFY
WalletWasabi/Crypto/CredentialIssuerParameters.cs
WalletWasabi/Crypto/CredentialIssuerParameters.cs
@@ -3,7 +3,7 @@ using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto
{
- public class CredentialIssuerParameters
+ public record CredentialIssuerParameters
{
public CredentialIssuerParameters(GroupElement cw, GroupElement i)
{

MODIFY
WalletWasabi/Crypto/CredentialIssuerSecretKey.cs
WalletWasabi/Crypto/CredentialIssuerSecretKey.cs
@@ -4,7 +4,7 @@ using WalletWasabi.Crypto.Randomness;
namespace WalletWasabi.Crypto
{
- public class CredentialIssuerSecretKey
+ public record CredentialIssuerSecretKey
{
public CredentialIssuerSecretKey(WasabiRandom rng)
: this(rng.GetScalar(), rng.GetScalar(), rng.GetScalar(), rng.GetScalar(), rng.GetScalar())

MODIFY
WalletWasabi/Crypto/Mac.cs
WalletWasabi/Crypto/Mac.cs
@@ -6,7 +6,7 @@ using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto
{
- public class MAC : IEquatable<MAC>
+ public record MAC
{
[JsonConstructor]
private MAC(Scalar t, GroupElement v)
@@ -19,17 +19,6 @@ namespace WalletWasabi.Crypto
public GroupElement V { get; }
internal GroupElement U => GenerateU(T);
- public static bool operator ==(MAC? a, MAC? b) => (a?.T, a?.V) == (b?.T, b?.V);
-
- public static bool operator !=(MAC? a, MAC? b) => !(a == b);
-
- public override bool Equals(object? obj) => Equals(obj as MAC);
-
- public bool Equals(MAC? other) => this == other;
-
- public override int GetHashCode() =>
- HashCode.Combine(T, V).GetHashCode();
-
public static MAC ComputeMAC(CredentialIssuerSecretKey sk, GroupElement ma, Scalar t)
{
Guard.NotNull(nameof(sk), sk);

MODIFY
WalletWasabi/Crypto/OwnershipProof.cs
WalletWasabi/Crypto/OwnershipProof.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Crypto
}
}
- public class CoinJoinInputCommitmentData
+ public record CoinJoinInputCommitmentData
{
private byte[] _coordinatorIdentifier;
private byte[] _roundIdentifier;

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/Credential.cs
WalletWasabi/Crypto/ZeroKnowledge/Credential.cs
@@ -6,7 +6,7 @@ namespace WalletWasabi.Crypto.ZeroKnowledge
/// <summary>
/// Represents an anonymous credential and its represented data.
/// </summary>
- public class Credential
+ public record Credential
{
/// <summary>
/// Initializes a new Credential instance.

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/CredentialPresentation.cs
WalletWasabi/Crypto/ZeroKnowledge/CredentialPresentation.cs
@@ -7,7 +7,7 @@ namespace WalletWasabi.Crypto.ZeroKnowledge
/// Represents a randomized credential that can be presented to the coordinator.
/// A randomized credential is a tuple that consists of four group elements (Ca, Cx0, Cx1, CV).
/// </summary>
- public class CredentialPresentation
+ public record CredentialPresentation
{
[JsonConstructor]
internal CredentialPresentation(GroupElement ca, GroupElement cx0, GroupElement cx1, GroupElement cV, GroupElement s)

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Knowledge.cs
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Knowledge.cs
@@ -4,7 +4,7 @@ using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto.ZeroKnowledge.LinearRelation
{
- internal class Knowledge
+ internal record Knowledge
{
internal Knowledge(Statement statement, ScalarVector witness)
{

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/Proof.cs
WalletWasabi/Crypto/ZeroKnowledge/Proof.cs
@@ -3,7 +3,7 @@ using WalletWasabi.Helpers;
namespace WalletWasabi.Crypto.ZeroKnowledge
{
- public class Proof
+ public record Proof
{
[JsonConstructor]
internal Proof(GroupElementVector publicNonces, ScalarVector responses)

MODIFY
WalletWasabi/WabiSabi/Crypto/IssuanceRequest.cs
WalletWasabi/WabiSabi/Crypto/IssuanceRequest.cs
@@ -7,7 +7,7 @@ namespace WalletWasabi.WabiSabi.Crypto
/// <summary>
/// Represents a request for issuing a new credential.
/// </summary>
- public class IssuanceRequest
+ public record IssuanceRequest
{
[JsonConstructor]
internal IssuanceRequest(GroupElement ma, IEnumerable<GroupElement> bitCommitments)

MODIFY
WalletWasabi/WabiSabi/Crypto/IssuanceValidationData.cs
WalletWasabi/WabiSabi/Crypto/IssuanceValidationData.cs
@@ -4,7 +4,7 @@ using WalletWasabi.Crypto.Groups;
namespace WalletWasabi.WabiSabi.Crypto
{
- public class IssuanceValidationData
+ public record IssuanceValidationData
{
internal IssuanceValidationData(long amount, Scalar r, GroupElement ma)
{

Convert obvious `class` to `record`