referrerpolicy=no-referrer-when-downgrade

people_rococo_emulated_chain/
genesis.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// 	http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16// Substrate
17use sp_core::storage::Storage;
18
19// Cumulus
20use cumulus_primitives_core::ParaId;
21use emulated_integration_tests_common::{
22	accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
23};
24use parachains_common::Balance;
25
26pub const PARA_ID: u32 = 1004;
27pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT;
28
29pub fn genesis() -> Storage {
30	let genesis_config = people_rococo_runtime::RuntimeGenesisConfig {
31		system: people_rococo_runtime::SystemConfig::default(),
32		balances: people_rococo_runtime::BalancesConfig {
33			balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(),
34			..Default::default()
35		},
36		parachain_info: people_rococo_runtime::ParachainInfoConfig {
37			parachain_id: ParaId::from(PARA_ID),
38			..Default::default()
39		},
40		collator_selection: people_rococo_runtime::CollatorSelectionConfig {
41			invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
42			candidacy_bond: ED * 16,
43			..Default::default()
44		},
45		session: people_rococo_runtime::SessionConfig {
46			keys: collators::invulnerables()
47				.into_iter()
48				.map(|(acc, aura)| {
49					(
50						acc.clone(),                                 // account id
51						acc,                                         // validator id
52						people_rococo_runtime::SessionKeys { aura }, // session keys
53					)
54				})
55				.collect(),
56			..Default::default()
57		},
58		polkadot_xcm: people_rococo_runtime::PolkadotXcmConfig {
59			safe_xcm_version: Some(SAFE_XCM_VERSION),
60			..Default::default()
61		},
62		..Default::default()
63	};
64
65	build_genesis_storage(
66		&genesis_config,
67		people_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
68	)
69}