Trait polkadot_service::CoreApi
source · pub trait CoreApi<Block>: 'static + Sendwhere
Block: Block,{
// Provided methods
fn version(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
) -> Result<RuntimeVersion, ApiError> { ... }
fn execute_block(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
block: Block,
) -> Result<(), ApiError> { ... }
fn initialize_block_before_version_5(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
header: &<Block as Block>::Header,
) -> Result<(), ApiError> { ... }
fn initialize_block(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
header: &<Block as Block>::Header,
) -> Result<ExtrinsicInclusionMode, ApiError> { ... }
}
Expand description
The Core
runtime api that every Substrate runtime needs to implement.
Provided Methods§
sourcefn version(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
) -> Result<RuntimeVersion, ApiError>
fn version( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>
Returns the version of the runtime.
sourcefn execute_block(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
block: Block,
) -> Result<(), ApiError>
fn execute_block( &self, __runtime_api_at_param__: <Block as Block>::Hash, block: Block, ) -> Result<(), ApiError>
Execute the given block.
sourcefn initialize_block_before_version_5(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
header: &<Block as Block>::Header,
) -> Result<(), ApiError>
👎Deprecated
fn initialize_block_before_version_5( &self, __runtime_api_at_param__: <Block as Block>::Hash, header: &<Block as Block>::Header, ) -> Result<(), ApiError>
Initialize a block with the given header.
sourcefn initialize_block(
&self,
__runtime_api_at_param__: <Block as Block>::Hash,
header: &<Block as Block>::Header,
) -> Result<ExtrinsicInclusionMode, ApiError>
fn initialize_block( &self, __runtime_api_at_param__: <Block as Block>::Hash, header: &<Block as Block>::Header, ) -> Result<ExtrinsicInclusionMode, ApiError>
Initialize a block with the given header and return the runtime executive mode.