[][src]Trait ckb_traits::BlockMedianTimeContext

pub trait BlockMedianTimeContext: HeaderProvider {
    fn median_block_count(&self) -> u64;

    fn timestamp_and_parent(
        &self,
        block_hash: &Byte32
    ) -> (u64, BlockNumber, Byte32) { ... }
fn block_median_time(&self, block_hash: &Byte32) -> u64 { ... } }

The invoker should only rely on block_median_time function the other functions only use to help the default block_median_time, and maybe unimplemented.

Required methods

fn median_block_count(&self) -> u64

Loading content...

Provided methods

fn timestamp_and_parent(
    &self,
    block_hash: &Byte32
) -> (u64, BlockNumber, Byte32)

Return timestamp and block_number of the corresponding block_hash, and hash of parent block

fn block_median_time(&self, block_hash: &Byte32) -> u64

Return past block median time, including the timestamp of the given one

Loading content...

Implementors

Loading content...