mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-10 17:11:03 +00:00
document that session key generation stores keys (#3366)
* document that session key generation stores keys * final typo fix
This commit is contained in:
committed by
Bastian Köcher
parent
4f051a5784
commit
aa86d5ce7a
@@ -145,10 +145,11 @@ pub type PoolApi<C> = <C as Components>::TransactionPoolApi;
|
||||
pub trait RuntimeGenesis: Serialize + DeserializeOwned + BuildStorage {}
|
||||
impl<T: Serialize + DeserializeOwned + BuildStorage> RuntimeGenesis for T {}
|
||||
|
||||
/// Something that can create initial session keys from given seeds.
|
||||
/// Something that can create and store initial session keys from given seeds.
|
||||
pub trait InitialSessionKeys<C: Components> {
|
||||
/// Generate the initial session keys for the given seeds.
|
||||
fn generate_intial_session_keys(
|
||||
/// Generate the initial session keys for the given seeds and store them in
|
||||
/// an internal keystore.
|
||||
fn generate_initial_session_keys(
|
||||
client: Arc<ComponentClient<C>>,
|
||||
seeds: Vec<String>,
|
||||
) -> error::Result<()>;
|
||||
@@ -158,7 +159,7 @@ impl<C: Components> InitialSessionKeys<Self> for C where
|
||||
ComponentClient<C>: ProvideRuntimeApi,
|
||||
<ComponentClient<C> as ProvideRuntimeApi>::Api: session::SessionKeys<ComponentBlock<C>>,
|
||||
{
|
||||
fn generate_intial_session_keys(
|
||||
fn generate_initial_session_keys(
|
||||
client: Arc<ComponentClient<C>>,
|
||||
seeds: Vec<String>,
|
||||
) -> error::Result<()> {
|
||||
|
||||
@@ -175,7 +175,7 @@ impl<Components: components::Components> Service<Components> {
|
||||
let finality_proof_provider = Components::build_finality_proof_provider(client.clone())?;
|
||||
let chain_info = client.info().chain;
|
||||
|
||||
Components::RuntimeServices::generate_intial_session_keys(
|
||||
Components::RuntimeServices::generate_initial_session_keys(
|
||||
client.clone(),
|
||||
config.dev_key_seed.clone().map(|s| vec![s]).unwrap_or_default(),
|
||||
)?;
|
||||
|
||||
@@ -29,6 +29,8 @@ client::decl_runtime_apis! {
|
||||
/// Session keys runtime api.
|
||||
pub trait SessionKeys {
|
||||
/// 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.
|
||||
///
|
||||
@@ -37,7 +39,8 @@ client::decl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate the initial session keys with the given seeds.
|
||||
/// Generate the initial session keys with the given seeds and store them in
|
||||
/// the client's keystore.
|
||||
#[cfg(feature = "std")]
|
||||
pub fn generate_initial_session_keys<B, E, Block, RA>(
|
||||
client: std::sync::Arc<client::Client<B, E, Block, RA>>,
|
||||
@@ -61,4 +64,4 @@ where
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user