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§
Sourcefn host_state_machine(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<StateMachine, ApiError>
fn host_state_machine( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<StateMachine, ApiError>
Should return the host’s state machine identifier
Sourcefn block_events(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<Event>, ApiError>
fn block_events( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<Event>, ApiError>
Fetch all ISMP events
Sourcefn block_events_with_metadata(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<(Event, Option<u32>)>, ApiError>
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
Sourcefn consensus_state(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
id: ConsensusClientId,
) -> Result<Option<Vec<u8>>, ApiError>
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
Sourcefn state_machine_update_time(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
id: StateMachineHeight,
) -> Result<Option<u64>, ApiError>
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
Sourcefn challenge_period(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
id: StateMachineId,
) -> Result<Option<u64>, ApiError>
fn challenge_period( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, id: StateMachineId, ) -> Result<Option<u64>, ApiError>
Return the challenge period timestamp
Sourcefn latest_state_machine_height(
&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>
Return the latest height of the state machine