Class Branch
A class representing a consecutive list of Blocks.
Inherited Members
Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public class Branch
Constructors
| Improve this Doc View SourceBranch(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:
|
Properties
| Improve this Doc View SourceBlocks
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>> |