CoreApi

Trait CoreApi 

Source
pub trait CoreApi<Block>: 'static + Send
where 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 as Block>::LazyBlock, ) -> 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§

Source

fn version( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>

Returns the version of the runtime.

Source

fn execute_block( &self, __runtime_api_at_param__: <Block as Block>::Hash, block: <Block as Block>::LazyBlock, ) -> Result<(), ApiError>

Execute the given block.

Source

fn initialize_block_before_version_5( &self, __runtime_api_at_param__: <Block as Block>::Hash, header: &<Block as Block>::Header, ) -> Result<(), ApiError>

👎Deprecated

Initialize a block with the given header.

Source

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.

Trait Implementations§

Source§

impl<Block> RuntimeApiInfo for dyn Core<Block>
where Block: Block,

Source§

const ID: [u8; 8]

The identifier of the runtime api.
Source§

const VERSION: u32 = 5u32

The version of the runtime api.

Implementors§