mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +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:
@@ -194,7 +194,7 @@ impl ExtBuilder {
|
||||
PRESENT_SLASH_PER_VOTER.with(|v| *v.borrow_mut() = self.bad_presentation_punishment);
|
||||
DECAY_RATIO.with(|v| *v.borrow_mut() = self.decay_ratio);
|
||||
let mut ext: sp_io::TestExternalities = GenesisConfig {
|
||||
pallet_balances: Some(pallet_balances::GenesisConfig::<Test>{
|
||||
pallet_balances: pallet_balances::GenesisConfig::<Test>{
|
||||
balances: vec![
|
||||
(1, 10 * self.balance_factor),
|
||||
(2, 20 * self.balance_factor),
|
||||
@@ -203,13 +203,13 @@ impl ExtBuilder {
|
||||
(5, 50 * self.balance_factor),
|
||||
(6, 60 * self.balance_factor)
|
||||
],
|
||||
}),
|
||||
elections: Some(elections::GenesisConfig::<Test>{
|
||||
},
|
||||
elections: elections::GenesisConfig::<Test>{
|
||||
members: vec![],
|
||||
desired_seats: self.desired_seats,
|
||||
presentation_duration: 2,
|
||||
term_duration: 5,
|
||||
}),
|
||||
},
|
||||
}.build_storage().unwrap().into();
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext
|
||||
|
||||
Reference in New Issue
Block a user