sp_session::runtime_api

Trait SessionKeys

source
pub trait SessionKeys<Block: BlockT>: Core<Block> {
    // Provided methods
    fn generate_session_keys(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        seed: Option<Vec<u8>>,
    ) -> Result<Vec<u8>, ApiError> { ... }
    fn decode_session_keys(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        encoded: Vec<u8>,
    ) -> Result<Option<Vec<(Vec<u8>, KeyTypeId)>>, ApiError> { ... }
}
Expand description

Session keys runtime api.

Provided Methods§

source

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

Generate a set of session keys with optionally using the given seed. The keys should be stored within the keystore exposed via runtime externalities.

The seed needs to be a valid utf8 string.

Returns the concatenated SCALE encoded public keys.

source

fn decode_session_keys( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, encoded: Vec<u8>, ) -> Result<Option<Vec<(Vec<u8>, KeyTypeId)>>, ApiError>

Decode the given public session keys.

Returns the list of public raw public keys + key type.

Trait Implementations§

source§

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

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§