diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe06d9544..6c66b47930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ 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..25b81251cd 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,51 @@ fn asset_hub_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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 { + transaction_payment: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + assets: Default::default(), + foreign_assets: Default::default(), + parachain_system: Default::default(), + vesting: Default::default(), + pool_assets: 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..ad778b3188 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,51 @@ fn asset_hub_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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 { + transaction_payment: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + assets: Default::default(), + foreign_assets: Default::default(), + parachain_system: Default::default(), + vesting: Default::default(), + pool_assets: 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..dfd3f61bce 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,51 @@ fn bridge_hub_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + bridge_polkadot_grandpa: Default::default(), + bridge_polkadot_parachains: Default::default(), + parachain_system: Default::default(), + transaction_payment: Default::default(), + bridge_polkadot_messages: Default::default(), + xcm_over_bridge_hub_polkadot: 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..3868f9fb1e 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,56 @@ fn bridge_hub_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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), + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), }, - "ethereumSystem": EthereumSystemConfig { + bridge_kusama_grandpa: Default::default(), + bridge_kusama_parachains: Default::default(), + bridge_kusama_messages: Default::default(), + xcm_over_bridge_hub_kusama: Default::default(), + 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()` - }) + parachain_system: Default::default(), + transaction_payment: 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..92429a6c42 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,51 @@ fn collectives_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + alliance: Default::default(), + alliance_motion: Default::default(), + fellowship_treasury: Default::default(), + parachain_system: Default::default(), + transaction_payment: Default::default(), + ambassador_treasury: 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..f73146efe2 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,22 @@ fn coretime_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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 +58,20 @@ fn coretime_kusama_genesis( .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": 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()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + parachain_system: Default::default(), + transaction_payment: Default::default(), + broker: 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..cfb01a0481 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,22 @@ fn coretime_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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 +58,20 @@ fn coretime_polkadot_genesis( .collect(), ..Default::default() }, - "polkadotXcm": { - "safeXcmVersion": 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()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + parachain_system: Default::default(), + transaction_payment: Default::default(), + broker: 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..d6d52095e3 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,84 @@ fn encointer_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + parachain_system: Default::default(), + balances: BalancesConfig { balances: endowed_accounts .iter() .cloned() .map(|k| (k, ENCOINTER_KUSAMA_ED * 4096)) .collect(), }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { + transaction_payment: Default::default(), + 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), + // no need to pass anything to aura, in fact it will panic if we do. Session will take care + // of this. `aura: Default::default()` + aura: Default::default(), + aura_ext: Default::default(), + 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 + collective: Default::default(), + membership: Default::default(), + 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()` - }) + encointer_democracy: 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..a6d5c3eb13 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,15 @@ 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 { + system: Default::default(), + parachain_system: Default::default(), + parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() }, + glutton: Default::default(), + sudo: 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..2c70a35d39 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,47 @@ fn people_kusama_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + parachain_system: Default::default(), + transaction_payment: 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..50a49e7344 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,47 @@ fn people_polkadot_genesis( endowed_accounts: Vec, id: ParaId, ) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { + let config = RuntimeGenesisConfig { + system: Default::default(), + 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), - }, // no need to pass anything to aura, in fact it will panic if we do. Session will take care // of this. `aura: Default::default()` - }) + aura: Default::default(), + aura_ext: Default::default(), + polkadot_xcm: PolkadotXcmConfig { + _config: Default::default(), + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + parachain_system: Default::default(), + transaction_payment: 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 {