Relax genesis config to not require Default impl (#1221)

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Nazar Mokrynskyi
2023-08-29 20:36:45 +03:00
committed by GitHub
parent 62f0a729cf
commit 430edd7535
2 changed files with 6 additions and 3 deletions
@@ -25,7 +25,10 @@ use sp_runtime::format_runtime_string;
/// Get the default `GenesisConfig` as a JSON blob. For more info refer to
/// [`sp_genesis_builder::GenesisBuilder::create_default_config`]
pub fn create_default_config<GC: BuildGenesisConfig>() -> sp_std::vec::Vec<u8> {
pub fn create_default_config<GC>() -> sp_std::vec::Vec<u8>
where
GC: BuildGenesisConfig + Default,
{
serde_json::to_string(&GC::default())
.expect("serialization to json is expected to work. qed.")
.into_bytes()