[][src]Trait sc_client_api::backend::BlockImportOperation

pub trait BlockImportOperation<Block: BlockT> {
    type State: StateBackend<HashFor<Block>>;
    pub fn state(&self) -> Result<Option<&Self::State>>;
pub fn set_block_data(
        &mut self,
        header: Block::Header,
        body: Option<Vec<Block::Extrinsic>>,
        justification: Option<Justification>,
        state: NewBlockState
    ) -> Result<()>;
pub fn update_cache(&mut self, cache: HashMap<Id, Vec<u8>>);
pub fn update_db_storage(
        &mut self,
        update: TransactionForSB<Self::State, Block>
    ) -> Result<()>;
pub fn reset_storage(&mut self, storage: Storage) -> Result<Block::Hash>;
pub fn update_storage(
        &mut self,
        update: StorageCollection,
        child_update: ChildStorageCollection
    ) -> Result<()>;
pub fn update_changes_trie(
        &mut self,
        update: ChangesTrieTransaction<HashFor<Block>, NumberFor<Block>>
    ) -> Result<()>;
pub fn insert_aux<I>(&mut self, ops: I) -> Result<()>
    where
        I: IntoIterator<Item = (Vec<u8>, Option<Vec<u8>>)>
;
pub fn mark_finalized(
        &mut self,
        id: BlockId<Block>,
        justification: Option<Justification>
    ) -> Result<()>;
pub fn mark_head(&mut self, id: BlockId<Block>) -> Result<()>; pub fn update_offchain_storage(
        &mut self,
        _offchain_update: OffchainOverlayedChanges
    ) -> Result<()> { ... } }

Block insertion operation.

Keeps hold if the inserted block state and data.

Associated Types

type State: StateBackend<HashFor<Block>>[src]

Associated state backend type.

Loading content...

Required methods

pub fn state(&self) -> Result<Option<&Self::State>>[src]

Returns pending state.

Returns None for backends with locally-unavailable state data.

pub fn set_block_data(
    &mut self,
    header: Block::Header,
    body: Option<Vec<Block::Extrinsic>>,
    justification: Option<Justification>,
    state: NewBlockState
) -> Result<()>
[src]

Append block data to the transaction.

pub fn update_cache(&mut self, cache: HashMap<Id, Vec<u8>>)[src]

Update cached data.

pub fn update_db_storage(
    &mut self,
    update: TransactionForSB<Self::State, Block>
) -> Result<()>
[src]

Inject storage data into the database.

pub fn reset_storage(&mut self, storage: Storage) -> Result<Block::Hash>[src]

Inject storage data into the database replacing any existing data.

pub fn update_storage(
    &mut self,
    update: StorageCollection,
    child_update: ChildStorageCollection
) -> Result<()>
[src]

Set storage changes.

pub fn update_changes_trie(
    &mut self,
    update: ChangesTrieTransaction<HashFor<Block>, NumberFor<Block>>
) -> Result<()>
[src]

Inject changes trie data into the database.

pub fn insert_aux<I>(&mut self, ops: I) -> Result<()> where
    I: IntoIterator<Item = (Vec<u8>, Option<Vec<u8>>)>, 
[src]

Insert auxiliary keys.

Values are None if should be deleted.

pub fn mark_finalized(
    &mut self,
    id: BlockId<Block>,
    justification: Option<Justification>
) -> Result<()>
[src]

Mark a block as finalized.

pub fn mark_head(&mut self, id: BlockId<Block>) -> Result<()>[src]

Mark a block as new head. If both block import and set head are specified, set head overrides block import's best block rule.

Loading content...

Provided methods

pub fn update_offchain_storage(
    &mut self,
    _offchain_update: OffchainOverlayedChanges
) -> Result<()>
[src]

Write offchain storage changes to the database.

Loading content...

Implementors

impl<Block: BlockT> BlockImportOperation<Block> for BlockImportOperation<Block> where
    Block::Hash: Ord
[src]

type State = InMemoryBackend<HashFor<Block>>

Loading content...