Class BlockPolicyExtension
This extension class enables some convenient methods (sugar for the most part) to deal with IBlockPolicy<T>.
Inherited Members
Namespace: Libplanet.Blockchain.Policies
Assembly: Libplanet.dll
Syntax
public static class BlockPolicyExtension
Methods
| Improve this Doc View SourceValidateBlocks<T>(IBlockPolicy<T>, IReadOnlyList<Block<T>>, DateTimeOffset)
Checks if blocks
are invalid, and if that
returns the reason.
Note that it returns null
when blocks are
valid.
Declaration
public static InvalidBlockException ValidateBlocks<T>(this IBlockPolicy<T> policy, IReadOnlyList<Block<T>> blocks, DateTimeOffset currentTime)
where T : IAction, new()
Parameters
Type | Name | Description |
---|---|---|
IBlockPolicy<T> | policy | IBlockPolicy<T> to used for
validation |
IReadOnlyList<Block<T>> | blocks | Consecutive Block<T>s to validate. |
DateTimeOffset | currentTime | The current time to be used to validate of Timestamps. Usually UtcNow is used. |
Returns
Type | Description |
---|---|
InvalidBlockException | The reason why the given |
Type Parameters
Name | Description |
---|---|
T | An IAction type. It should match to Block<T>'s type parameter. |
See Also
IBlockPolicy<T>
See Also
IBlockPolicy<T>