Class Block<T>
Assembly: Libplanet.dll
Syntax
[Equals]
public class Block<T> : ISerializable where T : IAction, new()
Type Parameters
Constructors
|
Improve this Doc
View Source
Block(Int64, Int64, Nonce, Nullable<Address>, Nullable<HashDigest<SHA256>>, DateTimeOffset, IEnumerable<Transaction<T>>)
Declaration
public Block(long index, long difficulty, Nonce nonce, Address? miner, HashDigest<SHA256>? previousHash, DateTimeOffset timestamp, IEnumerable<Transaction<T>> transactions)
Parameters
|
Improve this Doc
View Source
Block(SerializationInfo, StreamingContext)
Declaration
protected Block(SerializationInfo info, StreamingContext context)
Parameters
Properties
|
Improve this Doc
View Source
Difficulty
Declaration
[IgnoreDuringEquals]
public long Difficulty { get; }
Property Value
|
Improve this Doc
View Source
Hash
Declaration
public HashDigest<SHA256> Hash { get; }
Property Value
|
Improve this Doc
View Source
Index
Declaration
[IgnoreDuringEquals]
public long Index { get; }
Property Value
|
Improve this Doc
View Source
Miner
Declaration
[IgnoreDuringEquals]
public Address? Miner { get; }
Property Value
|
Improve this Doc
View Source
Nonce
Declaration
[IgnoreDuringEquals]
public Nonce Nonce { get; }
Property Value
|
Improve this Doc
View Source
PreviousHash
Declaration
[IgnoreDuringEquals]
public HashDigest<SHA256>? PreviousHash { get; }
Property Value
|
Improve this Doc
View Source
Timestamp
Declaration
[IgnoreDuringEquals]
public DateTimeOffset Timestamp { get; }
Property Value
|
Improve this Doc
View Source
Transactions
Declaration
[IgnoreDuringEquals]
public IEnumerable<Transaction<T>> Transactions { get; }
Property Value
Methods
|
Improve this Doc
View Source
Evaluate(DateTimeOffset, AccountStateGetter)
Declaration
public IEnumerable<ActionEvaluation<T>> Evaluate(DateTimeOffset currentTime, AccountStateGetter accountStateGetter)
Parameters
Type |
Name |
Description |
DateTimeOffset |
currentTime |
The current time to validate
time-wise conditions.
|
AccountStateGetter |
accountStateGetter |
The getter of previous states.
This affects the execution of Actions.
|
Returns
Exceptions
|
Improve this Doc
View Source
EvaluateActionsPerTx(AccountStateGetter)
Declaration
[Pure]
public IEnumerable<(Transaction<T>, ActionEvaluation<T>)> EvaluateActionsPerTx(AccountStateGetter accountStateGetter = null)
Parameters
Type |
Name |
Description |
AccountStateGetter |
accountStateGetter |
An AccountStateGetter
delegate to get a previous state.
A null value, which is default, means a constant function
that returns null .
|
Returns
|
Improve this Doc
View Source
FromBencodex(Byte[])
Declaration
public static Block<T> FromBencodex(byte[] encoded)
Parameters
Type |
Name |
Description |
Byte[] |
encoded |
|
Returns
Type |
Description |
Block<T> |
|
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
|
Improve this Doc
View Source
Mine(Int64, Int64, Address, Nullable<HashDigest<SHA256>>, DateTimeOffset, IEnumerable<Transaction<T>>)
Declaration
public static Block<T> Mine(long index, long difficulty, Address miner, HashDigest<SHA256>? previousHash, DateTimeOffset timestamp, IEnumerable<Transaction<T>> transactions)
Parameters
Returns
Type |
Description |
Block<T> |
|
|
Improve this Doc
View Source
ToBencodex(Boolean, Boolean)
Declaration
public byte[] ToBencodex(bool hash, bool transactionData)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Implements