Show / Hide Table of Contents

Class Branch

A class representing a consecutive list of Blocks.

Inheritance
Object
Branch
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public class Branch

Constructors

| Improve this Doc View Source

Branch(IEnumerable<(Block, BlockCommit)>)

Initializes a new instance of Branch from blocks.

Declaration
public Branch(IEnumerable<(Block, BlockCommit)> blocks)
Parameters
Type Name Description
IEnumerable<(T1 Item1, T2 Item2)<Block, BlockCommit>> blocks

An enumerable of Block and BlockCommit pairs to convert from.

Exceptions
Type Condition
ArgumentException

Thrown for failing to satisfy any of the following:

  • Given blocks is non-empty.
  • Given blocks are consecutive in the sense that indices are unique, consecutive, and every PreviousHash match the Hash of the previous Block.

Properties

| Improve this Doc View Source

Blocks

An ImmutableArray<T> of Block and BlockCommit pairs guaranteed to satisfy the following properties:

  • The collection is non-empty.
  • The collection is sorted by index.
  • The elements are consecutive in the sense that indices are unique, consecutive, and every PreviousHash match the Hash of the previous Block.
Declaration
public ImmutableArray<(Block, BlockCommit)> Blocks { get; }
Property Value
Type Description
ImmutableArray<(T1 Item1, T2 Item2)<Block, BlockCommit>>
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium