Skip to main content

CallApiAt

Trait CallApiAt 

Source
pub trait CallApiAt<Block: BlockT> {
    type Error: Debug + From<ApiError>;
    type StateBackend: StateBackend<HashFor<Block>>;

    // Required methods
    fn call_api_at<'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe, C: Core<Block, Error = Self::Error>>(
        &self,
        params: CallApiAtParams<'a, Block, C, NC, Self::StateBackend>,
    ) -> Result<NativeOrEncoded<R>, Self::Error>;
    fn runtime_version_at(
        &self,
        at: &BlockId<Block>,
    ) -> Result<RuntimeVersion, Self::Error>;
}
Expand description

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

Required Associated Types§

Source

type Error: Debug + From<ApiError>

Error type used by the implementation.

Source

type StateBackend: StateBackend<HashFor<Block>>

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

Required Methods§

Source

fn call_api_at<'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe, C: Core<Block, Error = Self::Error>>( &self, params: CallApiAtParams<'a, Block, C, NC, Self::StateBackend>, ) -> Result<NativeOrEncoded<R>, Self::Error>

Calls the given api function with the given encoded arguments at the given block and returns the encoded result.

Source

fn runtime_version_at( &self, at: &BlockId<Block>, ) -> Result<RuntimeVersion, Self::Error>

Returns the runtime version at the given block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§