referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::runtime::apis::CallApiAt

pub trait CallApiAt<Block>
where Block: Block,
{ type StateBackend: Backend<<<Block as Block>::Header as Header>::Hashing> + AsTrieBackend<<<Block as Block>::Header as Header>::Hashing>; // Required methods fn call_api_at( &self, params: CallApiAtParams<'_, Block>, ) -> Result<Vec<u8>, ApiError>; fn runtime_version_at( &self, at_hash: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>; fn state_at( &self, at: <Block as Block>::Hash, ) -> Result<Self::StateBackend, ApiError>; fn initialize_extensions( &self, at: <Block as Block>::Hash, extensions: &mut Extensions, ) -> Result<(), ApiError>; }
Expand description

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

Required Associated Types§

type StateBackend: Backend<<<Block as Block>::Header as Header>::Hashing> + AsTrieBackend<<<Block as Block>::Header as Header>::Hashing>

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

Required Methods§

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.

fn runtime_version_at( &self, at_hash: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>

Returns the runtime version at the given block.

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

Get the state at the given block.

fn initialize_extensions( &self, at: <Block as Block>::Hash, extensions: &mut Extensions, ) -> Result<(), ApiError>

Initialize the extensions for the given block at by using the global extensions factory.

Implementations on Foreign Types§

§

impl<Block, T> CallApiAt<Block> for Arc<T>
where Block: Block, T: CallApiAt<Block>,

§

type StateBackend = <T as CallApiAt<Block>>::StateBackend

§

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

§

fn runtime_version_at( &self, at_hash: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>

§

fn state_at( &self, at: <Block as Block>::Hash, ) -> Result<<Arc<T> as CallApiAt<Block>>::StateBackend, ApiError>

§

fn initialize_extensions( &self, at: <Block as Block>::Hash, extensions: &mut Extensions, ) -> Result<(), ApiError>

Implementors§