Trait sp_api::CallApiAt

source ·
pub trait CallApiAt<Block: BlockT> {
    type StateBackend: StateBackend<HashFor<Block>> + AsTrieBackend<HashFor<Block>>;

    // Required methods
    fn call_api_at(
        &self,
        params: CallApiAtParams<'_, Block, Self::StateBackend>
    ) -> Result<Vec<u8>, ApiError>;
    fn runtime_version_at(
        &self,
        at: &BlockId<Block>
    ) -> Result<RuntimeVersion, ApiError>;
    fn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>;
}
Expand description

Something that can call into the an api at a given block.

Required Associated Types§

source

type StateBackend: StateBackend<HashFor<Block>> + AsTrieBackend<HashFor<Block>>

The state backend that is used to store the block states.

Required Methods§

source

fn call_api_at( &self, params: CallApiAtParams<'_, Block, Self::StateBackend> ) -> Result<Vec<u8>, ApiError>

Calls the given api function with the given encoded arguments at the given block and returns the encoded result.

source

fn runtime_version_at( &self, at: &BlockId<Block> ) -> Result<RuntimeVersion, ApiError>

Returns the runtime version at the given block.

source

fn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>

Get the state at the given block.

Implementors§