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,
call_context: CallContext,
) -> 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 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,
call_context: CallContext,
) -> Result<RuntimeVersion, ApiError>
fn runtime_version_at( &self, at_hash: Block::Hash, call_context: CallContext, ) -> 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<Block: BlockT, T: CallApiAt<Block>> CallApiAt<Block> for Arc<T>
Available on crate feature std only.
impl<Block: BlockT, T: CallApiAt<Block>> CallApiAt<Block> for Arc<T>
Available on crate feature
std only.