Trait sp_api::CallApiAt [−][src]
pub trait CallApiAt<Block: BlockT> { type StateBackend: StateBackend<HashFor<Block>>; fn call_api_at<'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, ApiError> + UnwindSafe>(
&self,
params: CallApiAtParams<'a, Block, NC, Self::StateBackend>
) -> Result<NativeOrEncoded<R>, ApiError>; fn runtime_version_at(
&self,
at: &BlockId<Block>
) -> Result<RuntimeVersion, ApiError>; }
Expand description
Something that can call into the an api at a given block.
Associated Types
type StateBackend: StateBackend<HashFor<Block>>
type StateBackend: StateBackend<HashFor<Block>>
The state backend that is used to store the block states.
Required methods
fn call_api_at<'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, ApiError> + UnwindSafe>(
&self,
params: CallApiAtParams<'a, Block, NC, Self::StateBackend>
) -> Result<NativeOrEncoded<R>, ApiError>
fn call_api_at<'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, ApiError> + UnwindSafe>(
&self,
params: CallApiAtParams<'a, Block, NC, Self::StateBackend>
) -> Result<NativeOrEncoded<R>, 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: &BlockId<Block>
) -> Result<RuntimeVersion, ApiError>
fn runtime_version_at(
&self,
at: &BlockId<Block>
) -> Result<RuntimeVersion, ApiError>
Returns the runtime version at the given block.