pub trait Runtime {
    type Config: Config;

    // Required methods
    fn default_actor() -> AccountIdFor<Self::Config>;
    fn get_metadata() -> RuntimeMetadataPrefixed;
    fn convert_account_to_origin(
        account: AccountIdFor<Self::Config>
    ) -> <<Self::Config as Config>::RuntimeCall as Dispatchable>::RuntimeOrigin;

    // Provided methods
    fn initialize_storage(_storage: &mut Storage) -> Result<(), String> { ... }
    fn initialize_block(
        _height: BlockNumberFor<Self::Config>,
        _parent_hash: <Self::Config as Config>::Hash
    ) -> Result<(), String> { ... }
    fn finalize_block(
        _height: BlockNumberFor<Self::Config>
    ) -> Result<<Self::Config as Config>::Hash, String> { ... }
}
Expand description

A runtime to use.

Required Associated Types§

source

type Config: Config

The runtime configuration.

Required Methods§

source

fn default_actor() -> AccountIdFor<Self::Config>

Default actor for the runtime.

source

fn get_metadata() -> RuntimeMetadataPrefixed

Metadata of the runtime.

source

fn convert_account_to_origin( account: AccountIdFor<Self::Config> ) -> <<Self::Config as Config>::RuntimeCall as Dispatchable>::RuntimeOrigin

Convert an account to an call origin.

Provided Methods§

source

fn initialize_storage(_storage: &mut Storage) -> Result<(), String>

Initialize the storage at the genesis block.

source

fn initialize_block( _height: BlockNumberFor<Self::Config>, _parent_hash: <Self::Config as Config>::Hash ) -> Result<(), String>

Initialize a new block at particular height.

source

fn finalize_block( _height: BlockNumberFor<Self::Config> ) -> Result<<Self::Config as Config>::Hash, String>

Finalize a block at particular height.

Object Safety§

This trait is not object safe.

Implementors§