Show / Hide Table of Contents

Class BlockCommit

Inheritance
Object
BlockCommit
Implements
IEquatable<BlockCommit>
Bencodex.IBencodable
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Libplanet.Types.Blocks
Assembly: Libplanet.Types.dll
Syntax
public sealed class BlockCommit : IEquatable<BlockCommit>, IBencodable

Constructors

| Improve this Doc View Source

BlockCommit(IValue)

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

BlockCommit(Int64, Int32, BlockHash, ImmutableArray<Vote>)

Creates an instance of BlockCommit given a set of Votes.

Declaration
public BlockCommit(long height, int round, BlockHash blockHash, ImmutableArray<Vote> votes)
Parameters
Type Name Description
Int64 height

The Index of the last committed Block.

Int32 round

The round in which a consensus was reached.

BlockHash blockHash

The Hash of the last committed Block.

ImmutableArray<Vote> votes

The set of Votes as a proof for the commit of the last Block.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when either height or round is negative.

ArgumentException

Thrown for any of the following reasons:

  • Given votes is empty.
  • Any one of Vote of votes has a different Height from height.
  • Any one of Vote of votes has a different Round from round.
  • Any one of Vote of votes has a different BlockHash from blockHash.
  • Any one of Vote of votes has Flag that is neither Null nor PreCommit.
  • The number of Votes with Flag set as PreCommit does not exceed 2/3 of the total number of Votes in votes

Properties

| Improve this Doc View Source

Bencoded

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

BlockHash

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

Height

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

Round

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

Votes

Declaration
public ImmutableArray<Vote> Votes { get; }
Property Value
Type Description
ImmutableArray<Vote>

Methods

| Improve this Doc View Source

Equals(BlockCommit)

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

Equals(Object)

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

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

ToHash()

Gets a SHA256 digested BlockCommit hash value.

Declaration
public HashDigest<SHA256> ToHash()
Returns
Type Description
HashDigest<SHA256>

Returns a SHA256 digested BlockCommit.

| Improve this Doc View Source

ToString()

Declaration
[Pure]
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Implements

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