Trait TestCache

Source
pub trait TestCache {
    type BsError: Debug;
    type BlockSource: BlockSource<Error = Self::BsError>;
    type InsertResult;

    // Required methods
    fn block_source(&self) -> &Self::BlockSource;
    fn insert(&mut self, cb: &CompactBlock) -> Self::InsertResult;
    fn truncate_to_height(&mut self, height: BlockHeight);
}
Available on crate feature test-dependencies only.
Expand description

Trait used by tests that require a block cache.

Required Associated Types§

Required Methods§

Source

fn block_source(&self) -> &Self::BlockSource

Exposes the block cache as a BlockSource.

Source

fn insert(&mut self, cb: &CompactBlock) -> Self::InsertResult

Inserts a CompactBlock into the cache DB.

Source

fn truncate_to_height(&mut self, height: BlockHeight)

Deletes block data from the cache, retaining blocks at heights less than or equal to the specified height.

Implementors§