Show / Hide Table of Contents

Class Vote

Represents a Vote from a validator for consensus.

Inheritance
Object
Vote
Implements
IVoteMetadata
IEquatable<Vote>
Bencodex.IBencodable
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Libplanet.Types.Consensus
Assembly: Libplanet.Types.dll
Syntax
public class Vote : IVoteMetadata, IEquatable<Vote>, IBencodable

Constructors

| Improve this Doc View Source

Vote(IValue)

Represents a Vote from a validator for consensus.

Declaration
public Vote(IValue bencoded)
Parameters
Type Name Description
Bencodex.Types.IValue bencoded
| Improve this Doc View Source

Vote(VoteMetadata, ImmutableArray<Byte>)

Represents a Vote from a validator for consensus.

Declaration
public Vote(VoteMetadata metadata, ImmutableArray<byte> signature)
Parameters
Type Name Description
VoteMetadata metadata
ImmutableArray<Byte> signature

Properties

| Improve this Doc View Source

Bencoded

Represents a Vote from a validator for consensus.

Declaration
[JsonIgnore]
public IValue Bencoded { get; }
Property Value
Type Description
Bencodex.Types.IValue
| Improve this Doc View Source

BlockHash

BlockHash of the block in vote. If default, vote nil.

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

Flag

The VoteFlag indicating the type of a Vote.

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

Height

Height of the vote target block.

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

Round

Round of the vote in given height.

Declaration
public int Round { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Signature

The signature for the Vote. Lack of signature for a Vote is represented by an empty array not langword_csharp_default.

Declaration
public ImmutableArray<byte> Signature { get; }
Property Value
Type Description
ImmutableArray<Byte>
| Improve this Doc View Source

Timestamp

The time at which the voting took place.

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

ValidatorPublicKey

The PublicKey of the validator that voted.

Declaration
public PublicKey ValidatorPublicKey { get; }
Property Value
Type Description
PublicKey

Methods

| Improve this Doc View Source

Equals(Vote)

Represents a Vote from a validator for consensus.

Declaration
[Pure]
public bool Equals(Vote other)
Parameters
Type Name Description
Vote other
Returns
Type Description
Boolean
| Improve this Doc View Source

Equals(Object)

Represents a Vote from a validator for consensus.

Declaration
[Pure]
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean
Overrides
Object.Equals(Object)
| Improve this Doc View Source

GetHashCode()

Represents a Vote from a validator for consensus.

Declaration
[Pure]
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
Object.GetHashCode()
| Improve this Doc View Source

ToString()

Represents a Vote from a validator for consensus.

Declaration
[Pure]
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()
| Improve this Doc View Source

Verify()

Verifies whether the Vote's payload is properly signed by Validator.

Declaration
[Pure]
public bool Verify()
Returns
Type Description
Boolean

true if the Signature is not empty and is a valid signature signed by Validator, false otherwise.

Implements

IVoteMetadata
System.IEquatable<T>
Bencodex.IBencodable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium