Do not use Option to wrap GenesisConfig fields (#8275)

Currently we wrap every `GenesisConfig` field in an `Option`, while
we require `Default` being implemented for all pallet genesisconfigs.
Passing `None` also results in the genesis not being initialized, which
is a bug as seen from the perspective of a pallet developer?

This pr changes the fields of the `GenesisConfig` to non `Option` types.
This commit is contained in:
Bastian Köcher
2021-03-06 14:42:21 +01:00
committed by GitHub
parent 1680422f1f
commit b0ebf6498f
10 changed files with 111 additions and 113 deletions
+4 -4
View File
@@ -814,14 +814,14 @@ mod tests {
pub fn new_test_ext() -> sp_io::TestExternalities {
let t = GenesisConfig {
// We use default for brevity, but you can configure as desired if needed.
frame_system: Some(Default::default()),
pallet_balances: Some(Default::default()),
pallet_example: Some(pallet_example::GenesisConfig {
frame_system: Default::default(),
pallet_balances: Default::default(),
pallet_example: pallet_example::GenesisConfig {
dummy: 42,
// we configure the map with (key, value) pairs.
bar: vec![(1, 2), (2, 3)],
foo: 24,
}),
},
}.build_storage().unwrap();
t.into()
}