pub trait GenesisBuilder<Block: BlockT>: Core<Block> {
    // Provided methods
    fn create_default_config(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash
    ) -> Result<Vec<u8>, ApiError> { ... }
    fn build_config(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        json: Vec<u8>
    ) -> Result<Result, ApiError> { ... }
}
Expand description

API to interact with GenesisConfig for the runtime

Provided Methods§

source

fn create_default_config( &self, __runtime_api_at_param__: <Block as BlockT>::Hash ) -> Result<Vec<u8>, ApiError>

Creates the default GenesisConfig and returns it as a JSON blob.

This function instantiates the default GenesisConfig struct for the runtime and serializes it into a JSON blob. It returns a Vec<u8> containing the JSON representation of the default GenesisConfig.

source

fn build_config( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, json: Vec<u8> ) -> Result<Result, ApiError>

Build GenesisConfig from a JSON blob not using any defaults and store it in the storage.

This function deserializes the full GenesisConfig from the given JSON blob and puts it into the storage. If the provided JSON blob is incorrect or incomplete or the deserialization fails, an error is returned. It is recommended to log any errors encountered during the process.

Please note that provided json blob must contain all GenesisConfig fields, no defaults will be used.

Trait Implementations§

source§

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

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§