Trait sp_api::Core

source ·
pub trait Core<Block: BlockT>: 'static + Send {
    // Provided methods
    fn version(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash
    ) -> Result<RuntimeVersion, ApiError> { ... }
    fn execute_block(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        block: Block
    ) -> Result<(), ApiError> { ... }
    fn initialize_block(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        header: &<Block as BlockT>::Header
    ) -> Result<(), 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 BlockT>::Hash ) -> Result<RuntimeVersion, ApiError>

Returns the version of the runtime.

source

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

Execute the given block.

source

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

Initialize a block with the given header.

Trait Implementations§

source§

impl<Block: BlockT> RuntimeApiInfo for dyn Core<Block>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 4u32

The version of the runtime api.

Implementors§