Trait ckb_traits::HeaderProvider[][src]

pub trait HeaderProvider {
    fn get_header(&self, hash: &Byte32) -> Option<HeaderView>;

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

TODO(doc): @quake

Required methods

fn get_header(&self, hash: &Byte32) -> Option<HeaderView>[src]

TODO(doc): @quake

Provided methods

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

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

fn block_median_time(
    &self,
    block_hash: &Byte32,
    median_block_count: usize
) -> u64
[src]

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

Implementations on Foreign Types

impl HeaderProvider for Box<dyn Fn(Byte32) -> Option<HeaderView>>[src]

fn get_header(&self, hash: &Byte32) -> Option<HeaderView>[src]

Implementors