Skip to main content

GetBlockTimepoint

Function GetBlockTimepoint 

Source
pub fn GetBlockTimepoint() -> Result<TimePoint, SysErr>
Expand description

Returns the timepoint of the block currently executing. The value is fixed by the coordinator before execution begins and is carried in the block’s ProposalHeader, so it is part of the block identity and is identical for every invocation in the block. Like a block height, this is consensus data rather than a trusted clock: it is chosen by the proposer within whatever bounds the network’s validators enforce. Contracts should treat it as coarse-grained wall-clock time – suitable for expiries, vesting schedules and deadlines – and must not rely on it for fine-grained ordering or as a source of randomness.

§Outputs

  • block_timepoint

This is a convenience wrapper around uninit_GetBlockTimepoint that returns the result as SyscallResult<T>.