Show / Hide Table of Contents

Class EvidenceBase

Base class for evidence that explains how the infraction has been occurred.

Inheritance
System.Object
EvidenceBase
DuplicateVoteEvidence
Implements
IComparable<EvidenceBase>
IComparable
IBencodable
Namespace: Libplanet.Types.Evidence
Assembly: Libplanet.Types.dll
Syntax
public abstract class EvidenceBase : IEquatable<EvidenceBase>

Constructors

| Improve this Doc View Source

EvidenceBase(IValue)

Constructor for decoding bencoded evidence.

Declaration
protected EvidenceBase(IValue bencoded)
Parameters
Type Name Description
IValue bencoded

Bencoded data of evidence.

| Improve this Doc View Source

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 Source

TimestampFormat

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 Source

Bencoded

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
| Improve this Doc View Source

Height

Indicates the block height that infraction has been occurred.

Declaration
public long Height { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

Id

Indicates identifier of evidence.

Declaration
public EvidenceId Id { get; }
Property Value
Type Description
EvidenceId
| Improve this Doc View Source

TargetAddress

Indicates the address of the target that caused the infraction.

Declaration
public Address TargetAddress { get; }
Property Value
Type Description
Address
| Improve this Doc View Source

Timestamp

Indicates the timestamp the infraction occurred.

Declaration
public DateTimeOffset Timestamp { get; }
Property Value
Type Description
DateTimeOffset

Methods

| Improve this Doc View Source

Bencode(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 .

| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

Decode(IValue)

Decode that bencoded with Bencode(EvidenceBase) to EvidenceBase.

Declaration
public static EvidenceBase Decode(IValue value)
Parameters
Type Name Description
IValue value

Bencoded to be decoded.

Returns
Type Description
EvidenceBase

Decoded EvidenceBase.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

GetHashCode()

Base class for evidence that explains how the infraction has been occurred.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

Serialize()

Serialize EvidenceBase to byte array.

Declaration
public byte[] Serialize()
Returns
Type Description
System.Byte[]

Serialized byte array of EvidenceBase.

| Improve this Doc View Source

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

Implements

IComparable<>
IComparable
IBencodable

Extension Methods

BlockMarshaler.MarshalEvidence(EvidenceBase)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium