Show / Hide Table of Contents

Class VoteMetadata

Represents a vote metadata from a validator for consensus.

Inheritance
System.Object
VoteMetadata
Implements
IVoteMetadata
IEquatable<VoteMetadata>
IBencodable
Namespace: Libplanet.Types.Consensus
Assembly: Libplanet.Types.dll
Syntax
public class VoteMetadata : object, IVoteMetadata

Constructors

| Improve this Doc View Source

VoteMetadata(Bencodex.Types.IValue)

Represents a vote metadata from a validator for consensus.

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

VoteMetadata(Int64, Int32, BlockHash, DateTimeOffset, PublicKey, Nullable<BigInteger>, VoteFlag)

Creates a VoteMetadata instance.

Declaration
public VoteMetadata(long height, int round, BlockHash blockHash, DateTimeOffset timestamp, PublicKey validatorPublicKey, BigInteger? validatorPower, VoteFlag flag)
Parameters
Type Name Description
System.Int64 height

Height of the vote target block.

System.Int32 round

Round of the vote in given height.

BlockHash blockHash

BlockHash of the block in vote.

DateTimeOffset timestamp

The time at which the voting took place.

PublicKey validatorPublicKey

PublicKey of the validator made the vote.

System.Nullable<BigInteger> validatorPower

The voting power of the validator.

VoteFlag flag

VoteFlag for the vote's status.

Properties

| Improve this Doc View Source

Bencoded

Represents a vote metadata from a validator for consensus.

Declaration
public Bencodex.Types.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
System.Int64
| Improve this Doc View Source

Round

Round of the vote in given height.

Declaration
public int Round { get; }
Property Value
Type Description
System.Int32
| 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

ValidatorPower

The voting power of the validator that voted.

Declaration
public BigInteger? ValidatorPower { get; }
Property Value
Type Description
System.Nullable<BigInteger>
| 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(VoteMetadata)

Represents a vote metadata from a validator for consensus.

Declaration
public bool Equals(VoteMetadata other)
Parameters
Type Name Description
VoteMetadata other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Nullable<Object>)

Represents a vote metadata from a validator for consensus.

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()

Represents a vote metadata from a validator for consensus.

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

Sign(PrivateKey)

Signs a VoteMetadata to create a Vote using given signer.

Declaration
public Vote Sign(PrivateKey signer)
Parameters
Type Name Description
PrivateKey signer

The PrivateKey to sign the data with. This can be null to create an unsigned Vote instance.

Returns
Type Description
Vote

A Vote with a (possibly null) signature.

Implements

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