mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
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:
@@ -291,26 +291,26 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature,
|
||||
|
||||
fn new_test_ext() -> sp_io::TestExternalities {
|
||||
GenesisConfig{
|
||||
module1_Instance1: Some(module1::GenesisConfig {
|
||||
module1_Instance1: module1::GenesisConfig {
|
||||
value: 3,
|
||||
test: 2,
|
||||
}),
|
||||
module1_Instance2: Some(module1::GenesisConfig {
|
||||
},
|
||||
module1_Instance2: module1::GenesisConfig {
|
||||
value: 4,
|
||||
test: 5,
|
||||
}),
|
||||
module2: Some(module2::GenesisConfig {
|
||||
},
|
||||
module2: module2::GenesisConfig {
|
||||
value: 4,
|
||||
map: vec![(0, 0)],
|
||||
double_map: vec![(0, 0, 0)],
|
||||
}),
|
||||
module2_Instance1: Some(module2::GenesisConfig {
|
||||
},
|
||||
module2_Instance1: module2::GenesisConfig {
|
||||
value: 4,
|
||||
map: vec![(0, 0)],
|
||||
double_map: vec![(0, 0, 0)],
|
||||
}),
|
||||
module2_Instance2: None,
|
||||
module2_Instance3: None,
|
||||
},
|
||||
module2_Instance2: Default::default(),
|
||||
module2_Instance3: Default::default(),
|
||||
}.build_storage().unwrap().into()
|
||||
}
|
||||
|
||||
|
||||
@@ -185,9 +185,9 @@ frame_support::construct_runtime!(
|
||||
#[test]
|
||||
fn create_genesis_config() {
|
||||
GenesisConfig {
|
||||
module: Some(module::GenesisConfig {
|
||||
module: module::GenesisConfig {
|
||||
request_life_time: 0,
|
||||
enable_storage_role: true,
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user