[][src]Trait sc_client_api::backend::StorageProvider

pub trait StorageProvider<Block: BlockT, B: Backend<Block>> {
    pub fn storage(
        &self,
        id: &BlockId<Block>,
        key: &StorageKey
    ) -> Result<Option<StorageData>>;
pub fn storage_keys(
        &self,
        id: &BlockId<Block>,
        key_prefix: &StorageKey
    ) -> Result<Vec<StorageKey>>;
pub fn storage_hash(
        &self,
        id: &BlockId<Block>,
        key: &StorageKey
    ) -> Result<Option<Block::Hash>>;
pub fn storage_pairs(
        &self,
        id: &BlockId<Block>,
        key_prefix: &StorageKey
    ) -> Result<Vec<(StorageKey, StorageData)>>;
pub fn storage_keys_iter<'a>(
        &self,
        id: &BlockId<Block>,
        prefix: Option<&'a StorageKey>,
        start_key: Option<&StorageKey>
    ) -> Result<KeyIterator<'a, B::State, Block>>;
pub fn child_storage(
        &self,
        id: &BlockId<Block>,
        child_info: &ChildInfo,
        key: &StorageKey
    ) -> Result<Option<StorageData>>;
pub fn child_storage_keys(
        &self,
        id: &BlockId<Block>,
        child_info: &ChildInfo,
        key_prefix: &StorageKey
    ) -> Result<Vec<StorageKey>>;
pub fn child_storage_hash(
        &self,
        id: &BlockId<Block>,
        child_info: &ChildInfo,
        key: &StorageKey
    ) -> Result<Option<Block::Hash>>;
pub fn max_key_changes_range(
        &self,
        first: NumberFor<Block>,
        last: BlockId<Block>
    ) -> Result<Option<(NumberFor<Block>, BlockId<Block>)>>;
pub fn key_changes(
        &self,
        first: NumberFor<Block>,
        last: BlockId<Block>,
        storage_key: Option<&PrefixedStorageKey>,
        key: &StorageKey
    ) -> Result<Vec<(NumberFor<Block>, u32)>>; }

Provides acess to storage primitives

Required methods

pub fn storage(
    &self,
    id: &BlockId<Block>,
    key: &StorageKey
) -> Result<Option<StorageData>>
[src]

Given a BlockId and a key, return the value under the key in that block.

pub fn storage_keys(
    &self,
    id: &BlockId<Block>,
    key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>
[src]

Given a BlockId and a key prefix, return the matching storage keys in that block.

pub fn storage_hash(
    &self,
    id: &BlockId<Block>,
    key: &StorageKey
) -> Result<Option<Block::Hash>>
[src]

Given a BlockId and a key, return the value under the hash in that block.

pub fn storage_pairs(
    &self,
    id: &BlockId<Block>,
    key_prefix: &StorageKey
) -> Result<Vec<(StorageKey, StorageData)>>
[src]

Given a BlockId and a key prefix, return the matching child storage keys and values in that block.

pub fn storage_keys_iter<'a>(
    &self,
    id: &BlockId<Block>,
    prefix: Option<&'a StorageKey>,
    start_key: Option<&StorageKey>
) -> Result<KeyIterator<'a, B::State, Block>>
[src]

Given a BlockId and a key prefix, return a KeyIterator iterates matching storage keys in that block.

pub fn child_storage(
    &self,
    id: &BlockId<Block>,
    child_info: &ChildInfo,
    key: &StorageKey
) -> Result<Option<StorageData>>
[src]

Given a BlockId, a key and a child storage key, return the value under the key in that block.

pub fn child_storage_keys(
    &self,
    id: &BlockId<Block>,
    child_info: &ChildInfo,
    key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>
[src]

Given a BlockId, a key prefix, and a child storage key, return the matching child storage keys.

pub fn child_storage_hash(
    &self,
    id: &BlockId<Block>,
    child_info: &ChildInfo,
    key: &StorageKey
) -> Result<Option<Block::Hash>>
[src]

Given a BlockId, a key and a child storage key, return the hash under the key in that block.

pub fn max_key_changes_range(
    &self,
    first: NumberFor<Block>,
    last: BlockId<Block>
) -> Result<Option<(NumberFor<Block>, BlockId<Block>)>>
[src]

Get longest range within [first; last] that is possible to use in key_changes and key_changes_proof calls. Range could be shortened from the beginning if some changes tries have been pruned. Returns Ok(None) if changes tries are not supported.

pub fn key_changes(
    &self,
    first: NumberFor<Block>,
    last: BlockId<Block>,
    storage_key: Option<&PrefixedStorageKey>,
    key: &StorageKey
) -> Result<Vec<(NumberFor<Block>, u32)>>
[src]

Get pairs of (block, extrinsic) where key has been changed at given blocks range. Works only for runtimes that are supporting changes tries.

Changes are returned in descending order (i.e. last block comes first).

Loading content...

Implementors

Loading content...