You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
use runtime_primitives::{MakeStorage,BuildStorage,StorageMap};
23
24
use polkadot_runtime::{GenesisConfig,ConsensusConfig,CouncilConfig,DemocracyConfig,
24
25
SessionConfig,StakingConfig};
26
+
use chain_spec::ChainSpec;
27
+
28
+
enumConfig{
29
+
Local(GenesisConfig),
30
+
Raw(&'static[u8]),
31
+
}
25
32
26
33
/// A configuration of a chain. Can be used to build a genesis block.
27
34
pubstructPresetConfig{
28
-
pub(crate)genesis_config:GenesisConfig,
35
+
genesis_config:Config,
29
36
pub(crate)boot_nodes:Vec<String>,
30
37
}
31
38
39
+
implBuildStorageforConfig{
40
+
fnbuild_storage(self) -> StorageMap{
41
+
matchself{
42
+
Config::Local(gc) => gc.build_storage(),
43
+
Config::Raw(json) => {
44
+
let h:HashMap<StorageKey,StorageData> = serde_json::from_slice(json).expect("Data is from an internal source and is guaranteed to be of the correct format");
45
+
h.into_iter().map(|(k, v)| (k.0, v.0)).collect()
46
+
}
47
+
}
48
+
}
49
+
}
50
+
32
51
implPresetConfig{
33
52
/// Get a chain config from a spec, if it's predefined.
0 commit comments