Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 3c131b6

Browse files
RuntimeGenesisBuild added
1 parent 5fc8e30 commit 3c131b6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

frame/support/procedural/src/construct_runtime/expand/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn expand_outer_config(
100100
}
101101
}
102102

103-
impl<T> #scrate::traits::GenesisBuild<T> for RuntimeGenesisConfig {
103+
impl #scrate::traits::RuntimeGenesisBuild for RuntimeGenesisConfig {
104104
fn build(&self) {
105105
#genesis_build_calls
106106
}

frame/support/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub use metadata::{
8282
mod hooks;
8383
pub use hooks::{
8484
GenesisBuild, Hooks, IntegrityTest, OnFinalize, OnGenesis, OnIdle, OnInitialize,
85-
OnRuntimeUpgrade, OnTimestampSet,
85+
OnRuntimeUpgrade, OnTimestampSet, RuntimeGenesisBuild,
8686
};
8787

8888
pub mod schedule;

frame/support/src/traits/hooks.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,13 @@ pub trait Hooks<BlockNumber> {
359359
fn integrity_test() {}
360360
}
361361

362+
/// A trait to define the build function of a runtime genesis config.
363+
pub trait RuntimeGenesisBuild: Default + sp_runtime::traits::MaybeSerializeDeserialize {
364+
/// Build function allows to put all genesis config keys for each runtime pallet into the
365+
/// storage.
366+
fn build(&self);
367+
}
368+
362369
/// A trait to define the build function of a genesis config, T and I are placeholder for pallet
363370
/// trait and pallet instance.
364371
pub trait GenesisBuild<T, I = ()>: Default + sp_runtime::traits::MaybeSerializeDeserialize {

0 commit comments

Comments
 (0)