Trait polkadot_cli::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(
        &self,
        __runtime_api_at_param__: <Block as Block>::Hash,
        header: &<Block as Block>::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 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 ) -> Result<(), ApiError>

Execute the given block.

source

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

Initialize a block with the given header.

Trait Implementations§

source§

impl<Block> RuntimeApiInfo for dyn Core<Block> + 'staticwhere Block: Block,

source§

const ID: [u8; 8] = [223u8, 106u8, 203u8, 104u8, 153u8, 7u8, 96u8, 155u8]

The identifier of the runtime api.
source§

const VERSION: u32 = 4u32

The version of the runtime api.

Implementations on Foreign Types§

source§

impl<__SrApiBlock__, RuntimeApiImplCall> Core<__SrApiBlock__> for RuntimeApiImpl<__SrApiBlock__, RuntimeApiImplCall>where __SrApiBlock__: Block + UnwindSafe + RefUnwindSafe, RuntimeApiImplCall: CallApiAt<__SrApiBlock__> + 'static, <RuntimeApiImplCall as CallApiAt<__SrApiBlock__>>::StateBackend: Backend<<<__SrApiBlock__ as Block>::Header as Header>::Hashing>, &'static RuntimeApiImplCall: Send, RuntimeVersion: UnwindSafe + RefUnwindSafe, <__SrApiBlock__ as Block>::Header: UnwindSafe + RefUnwindSafe,

source§

impl<__SrApiBlock__, RuntimeApiImplCall> Core<__SrApiBlock__> for RuntimeApiImpl<__SrApiBlock__, RuntimeApiImplCall>where __SrApiBlock__: Block + UnwindSafe + RefUnwindSafe, RuntimeApiImplCall: CallApiAt<__SrApiBlock__> + 'static, <RuntimeApiImplCall as CallApiAt<__SrApiBlock__>>::StateBackend: Backend<<<__SrApiBlock__ as Block>::Header as Header>::Hashing>, &'static RuntimeApiImplCall: Send, RuntimeVersion: UnwindSafe + RefUnwindSafe, <__SrApiBlock__ as Block>::Header: UnwindSafe + RefUnwindSafe,

Implementors§