pub trait BlockStore: Send + Sync {
// Required methods
fn put_block(&mut self, block: Block);
fn get_block(&self, hash: &BlockHash) -> Option<Block>;
fn get_block_by_height(&self, h: Height) -> Option<Block>;
// Provided methods
fn get_blocks_in_range(&self, from: Height, to: Height) -> Vec<Block> { ... }
fn tip_height(&self) -> Height { ... }
}Required Methods§
fn put_block(&mut self, block: Block)
fn get_block(&self, hash: &BlockHash) -> Option<Block>
fn get_block_by_height(&self, h: Height) -> Option<Block>
Provided Methods§
Sourcefn get_blocks_in_range(&self, from: Height, to: Height) -> Vec<Block>
fn get_blocks_in_range(&self, from: Height, to: Height) -> Vec<Block>
Get blocks in [from, to] inclusive. Default iterates one-by-one.
Sourcefn tip_height(&self) -> Height
fn tip_height(&self) -> Height
Return the highest stored block height.