Skip to content

Commit

Permalink
generic default on all runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
dharjeezy committed Dec 30, 2024
1 parent ceedebb commit 76cf067
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ fn asset_hub_kusama_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
.cloned()
.map(|k| (k, ASSET_HUB_KUSAMA_ED * 4096 * 4096))
.collect(),
},
transaction_payment: Default::default(),
parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() },
collator_selection: CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
Expand All @@ -57,19 +55,11 @@ fn asset_hub_kusama_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ fn asset_hub_polkadot_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
.cloned()
.map(|k| (k, ASSET_HUB_POLKADOT_ED * 4096 * 4096))
.collect(),
},
transaction_payment: Default::default(),
parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() },
collator_selection: CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
Expand All @@ -73,19 +71,11 @@ fn asset_hub_polkadot_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn bridge_hub_kusama_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -56,20 +55,11 @@ fn bridge_hub_kusama_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn bridge_hub_polkadot_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -56,25 +55,16 @@ fn bridge_hub_polkadot_genesis(
.collect(),
..Default::default()
},
aura: Default::default(),
aura_ext: Default::default(),
polkadot_xcm: PolkadotXcmConfig {
_config: Default::default(),
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn collectives_polkadot_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -56,20 +55,11 @@ fn collectives_polkadot_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fn coretime_kusama_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -58,17 +57,11 @@ fn coretime_kusama_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fn coretime_polkadot_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -58,17 +57,11 @@ fn coretime_polkadot_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
11 changes: 1 addition & 10 deletions system-parachains/encointer/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ fn encointer_kusama_genesis(
id: ParaId,
) -> serde_json::Value {
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(),
},
transaction_payment: Default::default(),
parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() },
collator_selection: CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
Expand All @@ -57,16 +54,10 @@ fn encointer_kusama_genesis(
.collect(),
non_authority_keys: vec![],
},
// 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),
},
collective: Default::default(),
membership: Default::default(),
encointer_scheduler: EncointerSchedulerConfig {
current_phase: CeremonyPhaseType::Registering,
current_ceremony_index: 1,
Expand Down Expand Up @@ -101,7 +92,7 @@ fn encointer_kusama_genesis(
reserve_amount: 10_000_000_000_000u128,
_config: Default::default(),
},
encointer_democracy: Default::default(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ use sp_genesis_builder::PresetId;

fn glutton_kusama_genesis(id: ParaId) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
parachain_system: Default::default(),
parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() },
glutton: Default::default(),
sudo: Default::default(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn people_kusama_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -56,16 +55,11 @@ fn people_kusama_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn people_polkadot_genesis(
id: ParaId,
) -> serde_json::Value {
let config = RuntimeGenesisConfig {
system: Default::default(),
balances: BalancesConfig {
balances: endowed_accounts
.iter()
Expand All @@ -56,16 +55,11 @@ fn people_polkadot_genesis(
.collect(),
..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()`
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(),
..Default::default()
};

serde_json::to_value(config).expect("Could not build genesis config.")
Expand Down

0 comments on commit 76cf067

Please sign in to comment.