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: &BlockId<Block>
) -> Result<Self::StateBackend, ApiError>;
}
Expand description
Something that can call into the an api at a given block.
Required Associated Types§
sourcetype StateBackend: StateBackend<HashFor<Block>> + AsTrieBackend<HashFor<Block>>
type StateBackend: StateBackend<HashFor<Block>> + AsTrieBackend<HashFor<Block>>
The state backend that is used to store the block states.
Required Methods§
sourcefn call_api_at(
&self,
params: CallApiAtParams<'_, Block, Self::StateBackend>
) -> Result<Vec<u8>, ApiError>
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.
sourcefn runtime_version_at(
&self,
at: &BlockId<Block>
) -> Result<RuntimeVersion, ApiError>
fn runtime_version_at( &self, at: &BlockId<Block> ) -> Result<RuntimeVersion, ApiError>
Returns the runtime version at the given block.