Trait sp_consensus_pow::TimestampApi
source · pub trait TimestampApi<Block: BlockT, Moment: Decode>: Core<Block> {
fn timestamp(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<Moment, ApiError> { ... }
fn timestamp_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Moment, ApiError> { ... }
}
Expand description
API necessary for timestamp-based difficulty adjustment algorithms.
Provided Methods§
sourcefn timestamp(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<Moment, ApiError>
fn timestamp(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<Moment, ApiError>
Return the timestamp in the current block.
sourcefn timestamp_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Moment, ApiError>
fn timestamp_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Moment, ApiError>
Return the timestamp in the current block.