Trait sc_light::fetcher::BlockchainStorage[][src]

pub trait BlockchainStorage<Block>: AuxStore + ProvideChtRoots<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> where
    Block: Block
{ pub fn import_header(
        &self,
        header: <Block as Block>::Header,
        cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>,
        state: NewBlockState,
        aux_ops: Vec<(Vec<u8, Global>, Option<Vec<u8, Global>>), Global>
    ) -> Result<(), Error>;
pub fn set_head(&self, block: BlockId<Block>) -> Result<(), Error>;
pub fn finalize_header(&self, block: BlockId<Block>) -> Result<(), Error>;
pub fn last_finalized(&self) -> Result<<Block as Block>::Hash, Error>;
pub fn cache(&self) -> Option<Arc<dyn Cache<Block> + 'static>>;
pub fn usage_info(&self) -> Option<UsageInfo>; }

Light client blockchain storage.

Required methods

pub fn import_header(
    &self,
    header: <Block as Block>::Header,
    cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>,
    state: NewBlockState,
    aux_ops: Vec<(Vec<u8, Global>, Option<Vec<u8, Global>>), Global>
) -> Result<(), Error>
[src]

Store new header. Should refuse to revert any finalized blocks.

Takes new authorities, the leaf state of the new block, and any auxiliary storage updates to place in the same operation.

pub fn set_head(&self, block: BlockId<Block>) -> Result<(), Error>[src]

Set an existing block as new best block.

pub fn finalize_header(&self, block: BlockId<Block>) -> Result<(), Error>[src]

Mark historic header as finalized.

pub fn last_finalized(&self) -> Result<<Block as Block>::Hash, Error>[src]

Get last finalized header.

pub fn cache(&self) -> Option<Arc<dyn Cache<Block> + 'static>>[src]

Get storage cache.

pub fn usage_info(&self) -> Option<UsageInfo>[src]

Get storage usage statistics.

Loading content...

Implementations on Foreign Types

impl<Block> Storage<Block> for Blockchain<Block> where
    Block: Block,
    <Block as Block>::Hash: From<[u8; 32]>, 
[src]

Loading content...

Implementors

Loading content...