referrerpolicy=no-referrer-when-downgrade

coretime_westend_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 emulated_integration_tests_common::{
21	accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
22};
23use parachains_common::Balance;
24
25pub const PARA_ID: u32 = 1005;
26pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTENTIAL_DEPOSIT;
27
28pub fn genesis() -> Storage {
29	let genesis_config = coretime_westend_runtime::RuntimeGenesisConfig {
30		system: coretime_westend_runtime::SystemConfig::default(),
31		balances: coretime_westend_runtime::BalancesConfig {
32			balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(),
33			..Default::default()
34		},
35		parachain_info: coretime_westend_runtime::ParachainInfoConfig {
36			parachain_id: PARA_ID.into(),
37			..Default::default()
38		},
39		collator_selection: coretime_westend_runtime::CollatorSelectionConfig {
40			invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
41			candidacy_bond: ED * 16,
42			..Default::default()
43		},
44		session: coretime_westend_runtime::SessionConfig {
45			keys: collators::invulnerables()
46				.into_iter()
47				.map(|(acc, aura)| {
48					(
49						acc.clone(),                                    // account id
50						acc,                                            // validator id
51						coretime_westend_runtime::SessionKeys { aura }, // session keys
52					)
53				})
54				.collect(),
55			..Default::default()
56		},
57		polkadot_xcm: coretime_westend_runtime::PolkadotXcmConfig {
58			safe_xcm_version: Some(SAFE_XCM_VERSION),
59			..Default::default()
60		},
61		..Default::default()
62	};
63
64	build_genesis_storage(
65		&genesis_config,
66		coretime_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
67	)
68}