IsmpRuntimeApi

Trait IsmpRuntimeApi 

Source
pub trait IsmpRuntimeApi<Block: BlockT, Hash: Codec>: Core<Block> {
    // Provided methods
    fn host_state_machine(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<StateMachine, ApiError> { ... }
    fn block_events(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<Vec<Event>, ApiError> { ... }
    fn block_events_with_metadata(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
    ) -> Result<Vec<(Event, Option<u32>)>, ApiError> { ... }
    fn consensus_state(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        id: ConsensusClientId,
    ) -> Result<Option<Vec<u8>>, ApiError> { ... }
    fn state_machine_update_time(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        id: StateMachineHeight,
    ) -> Result<Option<u64>, ApiError> { ... }
    fn challenge_period(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        id: StateMachineId,
    ) -> Result<Option<u64>, ApiError> { ... }
    fn latest_state_machine_height(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        id: StateMachineId,
    ) -> Result<Option<u64>, ApiError> { ... }
    fn requests(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        request_commitments: Vec<H256>,
    ) -> Result<Vec<Request>, ApiError> { ... }
    fn responses(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        response_commitments: Vec<H256>,
    ) -> Result<Vec<Response>, ApiError> { ... }
}
Expand description

Required runtime APIs needed for client subsystems like the RPC

Provided Methods§

Source

fn host_state_machine( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<StateMachine, ApiError>

Should return the host’s state machine identifier

Source

fn block_events( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<Event>, ApiError>

Fetch all ISMP events

Source

fn block_events_with_metadata( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<(Event, Option<u32>)>, ApiError>

Fetch all ISMP events and their extrinsic metadata

Source

fn consensus_state( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: ConsensusClientId, ) -> Result<Option<Vec<u8>>, ApiError>

Return the scale encoded consensus state

Source

fn state_machine_update_time( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: StateMachineHeight, ) -> Result<Option<u64>, ApiError>

Return the timestamp this client was last updated in seconds

Source

fn challenge_period( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: StateMachineId, ) -> Result<Option<u64>, ApiError>

Return the challenge period timestamp

Source

fn latest_state_machine_height( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: StateMachineId, ) -> Result<Option<u64>, ApiError>

Return the latest height of the state machine

Source

fn requests( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, request_commitments: Vec<H256>, ) -> Result<Vec<Request>, ApiError>

Fetch the requests for the given commitments.

Source

fn responses( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, response_commitments: Vec<H256>, ) -> Result<Vec<Response>, ApiError>

Fetch the responses for the given commitments.

Trait Implementations§

Source§

impl<Block: BlockT, Hash: Codec> RuntimeApiInfo for dyn IsmpRuntimeApi<Block, Hash>

Source§

const ID: [u8; 8]

The identifier of the runtime api.
Source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§