pub trait CallApiAt<Block: BlockT> {
type StateBackend: StateBackend<HashingFor<Block>> + AsTrieBackend<HashingFor<Block>>;
// Required methods
fn call_api_at(
&self,
params: CallApiAtParams<'_, Block>,
) -> Result<Vec<u8>, ApiError>;
fn runtime_version_at(
&self,
at_hash: Block::Hash,
) -> Result<RuntimeVersion, ApiError>;
fn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>;
fn initialize_extensions(
&self,
at: Block::Hash,
extensions: &mut Extensions,
) -> Result<(), ApiError>;
}
Expand description
Something that can call into the an api at a given block.
Required Associated Types§
sourcetype StateBackend: StateBackend<HashingFor<Block>> + AsTrieBackend<HashingFor<Block>>
type StateBackend: StateBackend<HashingFor<Block>> + AsTrieBackend<HashingFor<Block>>
The state backend that is used to store the block states.
Required Methods§
sourcefn call_api_at(
&self,
params: CallApiAtParams<'_, Block>,
) -> Result<Vec<u8>, ApiError>
fn call_api_at( &self, params: CallApiAtParams<'_, Block>, ) -> 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_hash: Block::Hash,
) -> Result<RuntimeVersion, ApiError>
fn runtime_version_at( &self, at_hash: Block::Hash, ) -> Result<RuntimeVersion, ApiError>
Returns the runtime version at the given block.
sourcefn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>
fn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>
Get the state at
the given block.
sourcefn initialize_extensions(
&self,
at: Block::Hash,
extensions: &mut Extensions,
) -> Result<(), ApiError>
fn initialize_extensions( &self, at: Block::Hash, extensions: &mut Extensions, ) -> Result<(), ApiError>
Initialize the extensions
for the given block at
by using the global extensions factory.