Trait sp_api::CallApiAt

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

    fn call_api_at<R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, ApiError> + UnwindSafe>(
        &self,
        params: CallApiAtParams<'_, Block, NC, Self::StateBackend>
    ) -> Result<NativeOrEncoded<R>, ApiError>; fn runtime_version_at(
        &self,
        at: &BlockId<Block>
    ) -> Result<RuntimeVersion, ApiError>; fn state_at(
        &self,
        at: &BlockId<Block>
    ) -> Result<Self::StateBackend, ApiError>; }
Expand description

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

Required Associated Types§

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

Required Methods§

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

Returns the runtime version at the given block.

Get the state at the given block.

Implementors§