Class Block<T>
Assembly: Libplanet.dll
Syntax
[GeneratedEquality]
public class Block<T> : ISerializable where T : IAction, new()
Type Parameters
Constructors
|
Improve this Doc
View Source
Block(Int64, Int32, Nonce, Nullable<Address>, Nullable<HashDigest<SHA256>>, DateTimeOffset, IEnumerable<Transaction<T>>)
Declaration
public Block(long index, int 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
[EqualityIgnore]
public int Difficulty { get; }
Property Value
|
Improve this Doc
View Source
Hash
Declaration
[EqualityKey(KeyEqualityMode.Auto)]
public HashDigest<SHA256> Hash { get; }
Property Value
|
Improve this Doc
View Source
Index
Declaration
[EqualityIgnore]
public long Index { get; }
Property Value
|
Improve this Doc
View Source
Miner
Declaration
[EqualityIgnore]
public Address? Miner { get; }
Property Value
|
Improve this Doc
View Source
Nonce
Declaration
[EqualityIgnore]
public Nonce Nonce { get; }
Property Value
|
Improve this Doc
View Source
PreviousHash
Declaration
[EqualityIgnore]
public HashDigest<SHA256>? PreviousHash { get; }
Property Value
|
Improve this Doc
View Source
Timestamp
Declaration
[EqualityIgnore]
public DateTimeOffset Timestamp { get; }
Property Value
|
Improve this Doc
View Source
Transactions
Declaration
[EqualityIgnore]
public IEnumerable<Transaction<T>> Transactions { get; }
Property Value
Methods
|
Improve this Doc
View Source
EvaluateActions(AccountStateGetter)
Declaration
[Pure]
public IEnumerable<IAccountStateDelta> EvaluateActions(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, Int32, Address, Nullable<HashDigest<SHA256>>, DateTimeOffset, IEnumerable<Transaction<T>>)
Declaration
public static Block<T> Mine(long index, int 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
|
Improve this Doc
View Source
Validate(DateTimeOffset, AccountStateGetter)
Declaration
public IAccountStateDelta Validate(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
Implements