Fix chain-spec and make sure it does not breaks again (#4906)

* Fix chain-spec and make sure it does not breaks again

* REview feedback
This commit is contained in:
Bastian Köcher
2020-02-13 10:06:10 +01:00
committed by GitHub
parent a84c05da22
commit 96862f835b
+28 -5
View File
@@ -261,13 +261,17 @@ pub fn testnet_genesis(
}),
pallet_democracy: Some(DemocracyConfig::default()),
pallet_collective_Instance1: Some(CouncilConfig {
members: endowed_accounts.iter().cloned()
.collect::<Vec<_>>()[..(num_endowed_accounts + 1) / 2].to_vec(),
members: endowed_accounts.iter()
.take((num_endowed_accounts + 1) / 2)
.cloned()
.collect(),
phantom: Default::default(),
}),
pallet_collective_Instance2: Some(TechnicalCommitteeConfig {
members: endowed_accounts.iter().cloned()
.collect::<Vec<_>>()[..(num_endowed_accounts + 1) / 2].to_vec(),
members: endowed_accounts.iter()
.take((num_endowed_accounts + 1) / 2)
.cloned()
.collect(),
phantom: Default::default(),
}),
pallet_contracts: Some(ContractsConfig {
@@ -295,7 +299,10 @@ pub fn testnet_genesis(
pallet_membership_Instance1: Some(Default::default()),
pallet_treasury: Some(Default::default()),
pallet_society: Some(SocietyConfig {
members: endowed_accounts[0..3].to_vec(),
members: endowed_accounts.iter()
.take((num_endowed_accounts + 1) / 2)
.cloned()
.collect(),
pot: 0,
max_members: 999,
}),
@@ -359,6 +366,7 @@ pub(crate) mod tests {
use super::*;
use crate::service::{new_full, new_light};
use sc_service_test;
use sp_runtime::BuildStorage;
fn local_testnet_genesis_instant_single() -> GenesisConfig {
testnet_genesis(
@@ -408,4 +416,19 @@ pub(crate) mod tests {
|config| new_light(config),
);
}
#[test]
fn test_create_development_chain_spec() {
development_config().build_storage().unwrap();
}
#[test]
fn test_create_local_testnet_chain_spec() {
local_testnet_config().build_storage().unwrap();
}
#[test]
fn test_staging_test_net_chain_spec() {
staging_testnet_config().build_storage().unwrap();
}
}