1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>.
16

            
17
use {
18
    container_chain_template_simple_runtime::{
19
        AuthoritiesNotingConfig, BalancesConfig, ParachainInfoConfig, RuntimeGenesisConfig,
20
        SudoConfig, UNIT as DEV, WASM_BINARY,
21
    },
22
    emulated_integration_tests_common::build_genesis_storage,
23
    tanssi_emulated_integration_tests_common::accounts,
24
};
25

            
26
pub const PARA_ID: u32 = 2002;
27
pub const ORCHESTRATOR: u32 = 2000;
28
const ENDOWMENT: u128 = 1_000_000 * DEV;
29

            
30
728
pub fn genesis() -> sp_core::storage::Storage {
31
728
    let genesis_config = RuntimeGenesisConfig {
32
728
        balances: BalancesConfig {
33
728
            balances: accounts::init_balances()
34
728
                .iter()
35
728
                .cloned()
36
8736
                .map(|k| (k, ENDOWMENT))
37
728
                .collect(),
38
728
            ..Default::default()
39
728
        },
40
728
        parachain_info: ParachainInfoConfig {
41
728
            parachain_id: PARA_ID.into(),
42
728
            ..Default::default()
43
728
        },
44
728
        sudo: SudoConfig {
45
728
            key: Some(accounts::init_balances()[0].clone()),
46
728
        },
47
728
        authorities_noting: AuthoritiesNotingConfig {
48
728
            orchestrator_para_id: ORCHESTRATOR.into(),
49
728
            ..Default::default()
50
728
        },
51
728
        ..Default::default()
52
728
    };
53
728
    build_genesis_storage(&genesis_config, WASM_BINARY.unwrap())
54
728
}