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.
Implements
Inherited Members
Namespace: Libplanet.Consensus
Assembly: Libplanet.dll
Syntax
public class ProposalMetadata : IEquatable<ProposalMetadata>
Constructors
| Improve this Doc View SourceProposalMetadata(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 |
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:
|
Properties
| Improve this Doc View SourceBlockHash
The BlockHash of MarshaledBlock. This is automatically derived from MarshaledBlock.
Declaration
public BlockHash BlockHash { get; }
Property Value
Type | Description |
---|---|
BlockHash |
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> |
Encoded
A Bencodex-encoded value of ProposalMetadata.
Declaration
[JsonIgnore]
public Dictionary Encoded { get; }
Property Value
Type | Description |
---|---|
Bencodex.Types.Dictionary |
Height
A height of given proposal values.
Declaration
public long Height { get; }
Property Value
Type | Description |
---|---|
Int64 |
MarshaledBlock
A marshaled bencodex-encoded Byte array of block.
Declaration
public byte[] MarshaledBlock { get; }
Property Value
Type | Description |
---|---|
Byte[] |
Round
A round of given proposal values.
Declaration
public int Round { get; }
Property Value
Type | Description |
---|---|
Int32 |
Timestamp
The time at which the proposal took place.
Declaration
public DateTimeOffset Timestamp { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
ValidatorPublicKey
A PublicKey of proposing validator.
Declaration
public PublicKey ValidatorPublicKey { get; }
Property Value
Type | Description |
---|---|
PublicKey |
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 SourceEquals(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 |
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
| Improve this Doc View SourceGetHashCode()
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
| Improve this Doc View SourceSign(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. |
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[] |