Class ProposalClaimMetadata
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
Implements
Inherited Members
Namespace: Libplanet.Consensus
Assembly: Libplanet.dll
Syntax
public class ProposalClaimMetadata : IEquatable<ProposalClaimMetadata>
Constructors
| Improve this Doc View SourceProposalClaimMetadata(Dictionary)
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
Declaration
public ProposalClaimMetadata(Dictionary encoded)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.Dictionary | encoded |
ProposalClaimMetadata(Int64, Int32, BlockHash, DateTimeOffset, PublicKey)
Instantiates ProposalClaimMetadata with given parameters.
Declaration
public ProposalClaimMetadata(long height, int round, BlockHash blockHash, DateTimeOffset timestamp, PublicKey validatorPublicKey)
Parameters
Type | Name | Description |
---|---|---|
Int64 | height | A height of given claim values. |
Int32 | round | A round of given claim values. |
BlockHash | blockHash | A BlockHash of given proposal to claim. |
DateTimeOffset | timestamp | The time at which the proposal took place. |
PublicKey | validatorPublicKey | a PublicKey of proposing validator. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | This can be thrown in following reasons:
|
Properties
| Improve this Doc View SourceBlockHash
Declaration
public BlockHash BlockHash { get; }
Property Value
Type | Description |
---|---|
BlockHash |
ByteArray
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
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 |
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 |
Methods
| Improve this Doc View SourceEquals(ProposalClaimMetadata)
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
Declaration
public bool Equals(ProposalClaimMetadata other)
Parameters
Type | Name | Description |
---|---|---|
ProposalClaimMetadata | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
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 ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceSign(PrivateKey)
Signs given ProposalMetadata with given signer
.
Declaration
public ProposalClaim Sign(PrivateKey signer)
Parameters
Type | Name | Description |
---|---|---|
PrivateKey | signer | A PrivateKey to sign. |
Returns
Type | Description |
---|---|
ProposalClaim | Returns a signed Proposal. |
ToByteArray()
A class for constructing ProposalClaim. This class contains proposal claim information in consensus of a height, round and BlockHash. Use Sign(PrivateKey) to create a ProposalClaim.
Declaration
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] |