diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe06d9544..21f8a4a7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Kusama Treasury: remove funding to the Kappa Sigma Mu Society and disable burn ([polkadot-fellows/runtimes#507](https://github.com/polkadot-fellows/runtimes/pull/507)) - Remove Snowbridge create agent and channel extrinsics. ([polkadot-fellows/runtimes#506](https://github.com/polkadot-fellows/runtimes/pull/506)) +- Genesis config presets: Make use of RuntimeGenesisConfig to construct genesis config values for all runtimes ([polkadot-fellows/runtimes#451](https://github.com/polkadot-fellows/runtimes/pull/451)). #### From [#490](https://github.com/polkadot-fellows/runtimes/pull/490) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs index 7a32b04b16..9bcffb5099 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs @@ -28,42 +28,41 @@ fn asset_hub_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, ASSET_HUB_KUSAMA_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ASSET_HUB_KUSAMA_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn asset_hub_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs index bfac3eb01a..649d732f5d 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs @@ -44,42 +44,41 @@ fn asset_hub_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, ASSET_HUB_POLKADOT_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ASSET_HUB_POLKADOT_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn asset_hub_polkadot_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs index d40ff9e449..8c35e0c383 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs @@ -28,42 +28,41 @@ fn bridge_hub_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, BRIDGE_HUB_KUSAMA_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: BRIDGE_HUB_KUSAMA_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn bridge_hub_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs index 20b5409148..1e304a34f3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs @@ -28,47 +28,46 @@ fn bridge_hub_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, BRIDGE_HUB_POLKADOT_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: BRIDGE_HUB_POLKADOT_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id + acc.clone(), // account id + acc, // validator id SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - "ethereumSystem": EthereumSystemConfig { + ethereum_system: EthereumSystemConfig { para_id: id, asset_hub_para_id: polkadot_runtime_constants::system_parachain::ASSET_HUB_ID.into(), ..Default::default() }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn bridge_hub_polkadot_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs b/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs index 7d1b59ebd0..7b187c5fcb 100644 --- a/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs @@ -28,42 +28,41 @@ fn collectives_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, COLLECTIVES_POLKADOT_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: COLLECTIVES_POLKADOT_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn collectives_polkadot_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs b/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs index 2f70d24a07..7c8a32d77e 100644 --- a/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs +++ b/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs @@ -30,24 +30,21 @@ fn coretime_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, CORETIME_KUSAMA_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: CORETIME_KUSAMA_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { @@ -60,12 +57,14 @@ fn coretime_kusama_genesis( .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn coretime_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs b/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs index d63c826e61..8f17bdcd2d 100644 --- a/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs @@ -30,24 +30,21 @@ fn coretime_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, CORETIME_POLKADOT_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: CORETIME_POLKADOT_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { @@ -60,12 +57,14 @@ fn coretime_polkadot_genesis( .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } fn coretime_polkadot_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/encointer/src/genesis_config_presets.rs b/system-parachains/encointer/src/genesis_config_presets.rs index cda23b6565..1657901d94 100644 --- a/system-parachains/encointer/src/genesis_config_presets.rs +++ b/system-parachains/encointer/src/genesis_config_presets.rs @@ -15,7 +15,6 @@ // along with Polkadot. If not, see . //! Genesis configs presets for the EncointerKusama runtime - use crate::*; use sp_genesis_builder::PresetId; use sp_std::vec::Vec; @@ -28,72 +27,75 @@ fn encointer_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, ENCOINTER_KUSAMA_ED * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ENCOINTER_KUSAMA_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), non_authority_keys: vec![], }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - "encointerScheduler": { - "currentPhase": CeremonyPhaseType::Registering, - "currentCeremonyIndex": 1, - "phaseDurations": vec![ - (CeremonyPhaseType::Registering, 604800000u64), // 7d + encointer_scheduler: EncointerSchedulerConfig { + current_phase: CeremonyPhaseType::Registering, + current_ceremony_index: 1, + phase_durations: vec![ + (CeremonyPhaseType::Registering, 604800000u64), //7d (CeremonyPhaseType::Assigning, 86400000u64), // 1d (CeremonyPhaseType::Attesting, 172800000u64), // 2d ], + _config: Default::default(), }, - "encointerCeremonies": { - "ceremonyReward": BalanceType::from_num(1), - "timeTolerance": 600_000u64, // +-10min - "locationTolerance": 1_000, // [m] - "endorsementTicketsPerBootstrapper": 10, - "endorsementTicketsPerReputable": 5, - "reputationLifetime": 5, - "inactivityTimeout": 5, // idle ceremonies before purging community - "meetupTimeOffset": 0, + encointer_ceremonies: EncointerCeremoniesConfig { + ceremony_reward: BalanceType::from_num(1), + time_tolerance: 600_000u64, // +-10min + location_tolerance: 1_000, // [m] + endorsement_tickets_per_bootstrapper: 10, + endorsement_tickets_per_reputable: 5, + reputation_lifetime: 5, + inactivity_timeout: 5, // idle ceremonies before purging community + meetup_time_offset: 0, + _config: Default::default(), }, - "encointerCommunities": { - "minSolarTripTimeS": 1, // [s] - "maxSpeedMps": 1, // [m/s] suggested would be 83m/s for security, + encointer_communities: EncointerCommunitiesConfig { + min_solar_trip_time_s: 1, // [s] + max_speed_mps: 1, // [m/s] suggested would be 83m/s for security, + _config: Default::default(), }, - "encointerBalances": { - // for relative adjustment. - "feeConversionFactor": 7_143u32, + encointer_balances: EncointerBalancesConfig { + fee_conversion_factor: 7_143u128, + _config: Default::default(), }, - "encointerFaucet": { - "reserveAmount": 10_000_000_000_000u128, + encointer_faucet: EncointerFaucetConfig { + reserve_amount: 10_000_000_000_000u128, + _config: Default::default(), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn encointer_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs b/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs index c951b4e538..07ca105f87 100644 --- a/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs +++ b/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs @@ -21,12 +21,12 @@ use cumulus_primitives_core::ParaId; use sp_genesis_builder::PresetId; fn glutton_kusama_genesis(id: ParaId) -> serde_json::Value { - serde_json::json!({ - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - }) + let config = RuntimeGenesisConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn glutton_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/people/people-kusama/src/genesis_config_presets.rs b/system-parachains/people/people-kusama/src/genesis_config_presets.rs index 04249d196a..412ef0f7a1 100644 --- a/system-parachains/people/people-kusama/src/genesis_config_presets.rs +++ b/system-parachains/people/people-kusama/src/genesis_config_presets.rs @@ -28,42 +28,41 @@ fn people_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, PEOPLE_KUSAMA_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: PEOPLE_KUSAMA_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn people_kusama_local_testnet_genesis(para_id: ParaId) -> serde_json::Value { diff --git a/system-parachains/people/people-polkadot/src/genesis_config_presets.rs b/system-parachains/people/people-polkadot/src/genesis_config_presets.rs index 61dfb6edd1..a9667b4328 100644 --- a/system-parachains/people/people-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/people/people-polkadot/src/genesis_config_presets.rs @@ -28,42 +28,41 @@ fn people_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, PEOPLE_POLKADOT_ED * 4096 * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + collator_selection: CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: PEOPLE_POLKADOT_ED * 16, ..Default::default() }, - "session": SessionConfig { + session: SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys ) }) .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - // no need to pass anything to aura, in fact it will panic if we do. Session will take care - // of this. `aura: Default::default()` - }) + ..Default::default() + }; + + serde_json::to_value(config).expect("Could not build genesis config.") } pub fn people_polkadot_local_testnet_genesis(para_id: ParaId) -> serde_json::Value {