Show / Hide Table of Contents

Class ProposalMetadata

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

Inheritance
Object
ProposalMetadata
Implements
IEquatable<ProposalMetadata>
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Consensus
Assembly: Libplanet.dll
Syntax
public class ProposalMetadata : IEquatable<ProposalMetadata>

Constructors

| Improve this Doc View Source

ProposalMetadata(Dictionary)

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

Declaration
public ProposalMetadata(Dictionary encoded)
Parameters
Type Name Description
Bencodex.Types.Dictionary encoded
| Improve this Doc View Source

ProposalMetadata(Int64, Int32, DateTimeOffset, PublicKey, Byte[], Int32)

Instantiates ProposalMetadata with given parameters.

Declaration
public ProposalMetadata(long height, int round, DateTimeOffset timestamp, PublicKey validatorPublicKey, byte[] marshaledBlock, int validRound)
Parameters
Type Name Description
Int64 height

a height of given proposal values.

Int32 round

a round of given proposal values.

DateTimeOffset timestamp

The time at which the proposal took place.

PublicKey validatorPublicKey

a PublicKey of proposing validator.

Byte[] marshaledBlock

a marshaled bencodex-encoded Byte array of block.

Int32 validRound

a latest valid round at the moment of given proposal.

Exceptions
Type Condition
ArgumentOutOfRangeException

This can be thrown in following reasons:

  • Given height is less than 0.
  • Given round is less than 0.
  • Given validRound is less than -1.

Properties

| Improve this Doc View Source

BlockHash

The BlockHash of MarshaledBlock. This is automatically derived from MarshaledBlock.

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

ByteArray

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

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

Encoded

A Bencodex-encoded value of ProposalMetadata.

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

Height

A height of given proposal values.

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

MarshaledBlock

A marshaled bencodex-encoded Byte array of block.

Declaration
public byte[] MarshaledBlock { get; }
Property Value
Type Description
Byte[]
| Improve this Doc View Source

Round

A round of given proposal values.

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

Timestamp

The time at which the proposal took place.

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

ValidatorPublicKey

A PublicKey of proposing validator.

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

ValidRound

a latest valid round at the moment of given proposal.

Declaration
public int ValidRound { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

Equals(ProposalMetadata)

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

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

Equals(Object)

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

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

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

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

Sign(PrivateKey)

Signs given ProposalMetadata with given signer.

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

A PrivateKey to sign.

Returns
Type Description
Proposal

Returns a signed Proposal.

| Improve this Doc View Source

ToByteArray()

A class for constructing Proposal. This class contains proposal information in consensus of a height and a round. Use Sign(PrivateKey) to create a Proposal.

Declaration
public byte[] ToByteArray()
Returns
Type Description
Byte[]

Implements

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