frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Models/Chain/FrostFsChain.cs
Pavel Gross c9a75ea025
All checks were successful
DCO / DCO (pull_request) Successful in 46s
[#24] Client: Implement pool part1
first iteration - base classes and methods

Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-10-21 10:48:00 +03:00

41 lines
877 B
C#

using Google.Protobuf;
namespace FrostFS.SDK.ClientV2;
public struct FrostFsChain(byte[] raw) : System.IEquatable<FrostFsChain>
{
private ByteString? grpcRaw;
public byte[] Raw { get; } = raw;
internal ByteString GetRaw()
{
return grpcRaw ??= ByteString.CopyFrom(Raw);
}
public override readonly bool Equals(object obj)
{
var chain = (FrostFsChain)obj;
return Equals(chain);
}
public override readonly int GetHashCode()
{
return Raw.GetHashCode();
}
public static bool operator ==(FrostFsChain left, FrostFsChain right)
{
return left.Equals(right);
}
public static bool operator !=(FrostFsChain left, FrostFsChain right)
{
return !(left == right);
}
public readonly bool Equals(FrostFsChain other)
{
return Raw == other.Raw;
}
}