Class IBlockMetadataExtensions
Convenient extension methods for IBlockMetadata.
Inheritance
System.Object
IBlockMetadataExtensions
Namespace: Libplanet.Types.Blocks
Assembly: Libplanet.Types.dll
Syntax
public static class IBlockMetadataExtensions : object
Methods
| Improve this Doc View SourceValidateTimestamp(IBlockMetadata, DateTimeOffset)
Checks if the given metadata
's
Timestamp is valid. No-op if valid.
Declaration
public static void ValidateTimestamp(this IBlockMetadata metadata, DateTimeOffset currentTime)
Parameters
Type | Name | Description |
---|---|---|
IBlockMetadata | metadata | The block metadata to validate. |
DateTimeOffset | currentTime | Explicitly specify the current time. |
Exceptions
Type | Condition |
---|---|
InvalidBlockTimestampException | Thrown when
Timestamp is invalid. For example,
if Timestamp is too far in the future
compared to |
ValidateTimestamp(IBlockMetadata)
Checks if the given metadata
's
Timestamp is valid. No-op if valid.
Declaration
public static void ValidateTimestamp(this IBlockMetadata metadata)
Parameters
Type | Name | Description |
---|---|---|
IBlockMetadata | metadata | The block metadata to validate. |
Exceptions
Type | Condition |
---|---|
InvalidBlockTimestampException | Thrown when Timestamp is invalid. For example, if Timestamp is too far in the future compared to the current time. |