Class Maj23
A class used to claim that a peer has collected two thirds majority of Votes.
Implements
Inherited Members
Namespace: Libplanet.Consensus
Assembly: Libplanet.dll
Syntax
public class Maj23 : IEquatable<Maj23>
Constructors
| Improve this Doc View SourceMaj23(Dictionary)
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
public Maj23(Dictionary encoded)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.Dictionary | encoded |
Maj23(Maj23Metadata, ImmutableArray<Byte>)
Instantiates a Maj23 with given maj23Metadata
and its signature
.
Declaration
public Maj23(Maj23Metadata maj23Metadata, ImmutableArray<byte> signature)
Parameters
Type | Name | Description |
---|---|---|
Maj23Metadata | maj23Metadata | A Maj23Metadata to claim. |
ImmutableArray<Byte> | signature | A signature signed with |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if given |
ArgumentException | Thrown if given |
Maj23(Byte[])
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
public Maj23(byte[] marshaled)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | marshaled |
Properties
| Improve this Doc View SourceBlockHash
The BlockHash of vote claim.
Declaration
public BlockHash BlockHash { get; }
Property Value
Type | Description |
---|---|
BlockHash |
ByteArray
Declaration
public ImmutableArray<byte> ByteArray { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Encoded
A Bencodex-encoded value of Maj23.
Declaration
[JsonIgnore]
public Dictionary Encoded { get; }
Property Value
Type | Description |
---|---|
Bencodex.Types.Dictionary |
Flag
The VoteFlag of the Maj23Metadata.
Declaration
public VoteFlag Flag { get; }
Property Value
Type | Description |
---|---|
VoteFlag |
Height
A height of given maj23 values.
Declaration
public long Height { get; }
Property Value
Type | Description |
---|---|
Int64 |
Round
A round of given maj23 values.
Declaration
public int Round { get; }
Property Value
Type | Description |
---|---|
Int32 |
Signature
A signature that signed with Maj23Metadata.
Declaration
public ImmutableArray<byte> Signature { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Timestamp
The time at which the claim took place.
Declaration
public DateTimeOffset Timestamp { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
ValidatorPublicKey
A PublicKey of claimant.
Declaration
public PublicKey ValidatorPublicKey { get; }
Property Value
Type | Description |
---|---|
PublicKey |
Methods
| Improve this Doc View SourceEquals(Maj23)
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
[Pure]
public bool Equals(Maj23 other)
Parameters
Type | Name | Description |
---|---|---|
Maj23 | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
[Pure]
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
[Pure]
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceToByteArray()
A class used to claim that a peer has collected two thirds majority of Votes.
Declaration
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] |
Verify()
Verifies whether the Maj23Metadata 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. |