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§
Sourcefn get_epoch_ext(&self, block_header: &HeaderView) -> Option<EpochExt>
fn get_epoch_ext(&self, block_header: &HeaderView) -> Option<EpochExt>
Get corresponding EpochExt
by block header
Sourcefn get_block_hash(&self, number: BlockNumber) -> Option<Byte32>
fn get_block_hash(&self, number: BlockNumber) -> Option<Byte32>
Get block header hash by block number
Sourcefn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>
fn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>
Get block ext by block header hash
Sourcefn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>
fn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>
Get header by block header hash
Provided Methods§
Sourcefn get_block_epoch(&self, header: &HeaderView) -> Option<BlockEpoch>
fn get_block_epoch(&self, header: &HeaderView) -> Option<BlockEpoch>
Get corresponding epoch progress information by block header