Class EvidenceBase
Base class for evidence that explains how the infraction has been occurred.
Namespace: Libplanet.Types.Evidence
Assembly: Libplanet.Types.dll
Syntax
public abstract class EvidenceBase : IEquatable<EvidenceBase>
Constructors
| Improve this Doc View SourceEvidenceBase(IValue)
Constructor for decoding bencoded evidence.
Declaration
protected EvidenceBase(IValue bencoded)
Parameters
Type | Name | Description |
---|---|---|
IValue | bencoded | Bencoded data of evidence. |
EvidenceBase(Int64, Address, DateTimeOffset)
Constructor for creating new evidence.
Declaration
protected EvidenceBase(long height, Address targetAddress, DateTimeOffset timestamp)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | height | Indicates the block height that infraction has been occurred. |
Address | targetAddress | Indicates the address of the target that caused the infraction. |
DateTimeOffset | timestamp | Indicates the timestamp the infraction occurred. |
Fields
| Improve this Doc View SourceTimestampFormat
Base class for evidence that explains how the infraction has been occurred.
Declaration
public const string TimestampFormat = null
Field Value
Type | Description |
---|---|
System.String |
Properties
| Improve this Doc View SourceBencoded
Inner bencoded form of evidence. This method won't bencode evidence type, so we can't decode evidence without knowing the evidence type. For fully bencoded form, use Bencode(EvidenceBase).
Declaration
public IValue Bencoded { get; }
Property Value
Type | Description |
---|---|
IValue |
Height
Indicates the block height that infraction has been occurred.
Declaration
public long Height { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Id
Indicates identifier of evidence.
Declaration
public EvidenceId Id { get; }
Property Value
Type | Description |
---|---|
EvidenceId |
TargetAddress
Indicates the address of the target that caused the infraction.
Declaration
public Address TargetAddress { get; }
Property Value
Type | Description |
---|---|
Address |
Timestamp
Indicates the timestamp the infraction occurred.
Declaration
public DateTimeOffset Timestamp { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Methods
| Improve this Doc View SourceBencode(EvidenceBase)
Bencode EvidenceBase.
This bencodes evidence
with its evidence type,
so its return can be decoded by Decode(IValue)
without concrete evidence type.
Declaration
public static IValue Bencode(EvidenceBase evidence)
Parameters
Type | Name | Description |
---|---|---|
EvidenceBase | evidence | EvidenceBase to be bencoded. |
Returns
Type | Description |
---|---|
IValue | Bencoded |
CompareTo(EvidenceBase)
Base class for evidence that explains how the infraction has been occurred.
Declaration
public int CompareTo(EvidenceBase other)
Parameters
Type | Name | Description |
---|---|---|
EvidenceBase | other |
Returns
Type | Description |
---|---|
System.Int32 |
CompareTo(Nullable<Object>)
Base class for evidence that explains how the infraction has been occurred.
Declaration
public int CompareTo(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Int32 |
Decode(IValue)
Decode
Declaration
public static EvidenceBase Decode(IValue value)
Parameters
Type | Name | Description |
---|---|---|
IValue | value | Bencoded |
Returns
Type | Description |
---|---|
EvidenceBase | Decoded EvidenceBase. |
Deserialize(Byte[])
Deserialize EvidenceBase from byte array.
Declaration
public static EvidenceBase Deserialize(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | Byte array to be deserialized. |
Returns
Type | Description |
---|---|
EvidenceBase | Deserialized EvidenceBase. |
Equals(EvidenceBase)
Base class for evidence that explains how the infraction has been occurred.
Declaration
public bool Equals(EvidenceBase other)
Parameters
Type | Name | Description |
---|---|---|
EvidenceBase | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Nullable<Object>)
Base class for evidence that explains how the infraction has been occurred.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Base class for evidence that explains how the infraction has been occurred.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
OnBencoded(Dictionary)
Base class for evidence that explains how the infraction has been occurred.
Declaration
protected abstract Dictionary OnBencoded(Dictionary dictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary | dictionary |
Returns
Type | Description |
---|---|
Dictionary |
OnVerify(IEvidenceContext)
Base class for evidence that explains how the infraction has been occurred.
Declaration
protected abstract void OnVerify(IEvidenceContext evidenceContext)
Parameters
Type | Name | Description |
---|---|---|
IEvidenceContext | evidenceContext |
Serialize()
Serialize EvidenceBase to byte array.
Declaration
public byte[] Serialize()
Returns
Type | Description |
---|---|
System.Byte[] | Serialized byte array of EvidenceBase. |
Verify(IEvidenceContext)
Base class for evidence that explains how the infraction has been occurred.
Declaration
public void Verify(IEvidenceContext evidenceContext)
Parameters
Type | Name | Description |
---|---|---|
IEvidenceContext | evidenceContext |