ckb_traits

Trait EpochProvider

Source
pub trait EpochProvider {
    // Required methods
    fn get_epoch_ext(&self, block_header: &HeaderView) -> Option<EpochExt>;
    fn get_block_hash(&self, number: BlockNumber) -> Option<Byte32>;
    fn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>;
    fn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>;

    // Provided method
    fn get_block_epoch(&self, header: &HeaderView) -> Option<BlockEpoch> { ... }
}
Expand description

Trait for epoch storage.

Required Methods§

Source

fn get_epoch_ext(&self, block_header: &HeaderView) -> Option<EpochExt>

Get corresponding EpochExt by block header

Source

fn get_block_hash(&self, number: BlockNumber) -> Option<Byte32>

Get block header hash by block number

Source

fn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>

Get block ext by block header hash

Source

fn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>

Get header by block header hash

Provided Methods§

Source

fn get_block_epoch(&self, header: &HeaderView) -> Option<BlockEpoch>

Get corresponding epoch progress information by block header

Implementors§