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
    emulated_integration_tests_common::build_genesis_storage,
19
    polkadot_parachain_primitives::primitives::ValidationCode,
20
    runtime_parachains::paras::{ParaGenesisArgs, ParaKind},
21
    sp_core::storage::Storage,
22
    starlight_runtime_constants::currency::UNITS as DANCE,
23
};
24
const INITIAL_BALANCE: u128 = 1_000_000 * DANCE;
25

            
26
24
pub fn genesis() -> Storage {
27
24
    let genesis_config = starlight_runtime::RuntimeGenesisConfig {
28
        balances: starlight_runtime::BalancesConfig {
29
24
            balances: tanssi_emulated_integration_tests_common::accounts::init_balances()
30
24
                .iter()
31
24
                .cloned()
32
288
                .map(|k| (k, INITIAL_BALANCE))
33
24
                .collect(),
34
24
            ..Default::default()
35
        },
36
24
        babe: starlight_runtime::BabeConfig {
37
24
            authorities: Default::default(),
38
24
            epoch_config: starlight_runtime::BABE_GENESIS_EPOCH_CONFIG,
39
24
            ..Default::default()
40
24
        },
41
24
        configuration: starlight_runtime::ConfigurationConfig {
42
24
            config:
43
24
                starlight_runtime::genesis_config_presets::default_parachains_host_configuration(),
44
24
        },
45
24
        paras: starlight_runtime::ParasConfig {
46
24
            _config: Default::default(),
47
24
            paras: vec![
48
24
                (
49
24
                    2001.into(),
50
24
                    ParaGenesisArgs {
51
24
                        genesis_head: Default::default(),
52
24
                        validation_code: ValidationCode(vec![1, 1, 2, 3, 4]),
53
24
                        para_kind: ParaKind::Parachain,
54
24
                    },
55
24
                ),
56
24
                (
57
24
                    2002.into(),
58
24
                    ParaGenesisArgs {
59
24
                        genesis_head: Default::default(),
60
24
                        validation_code: ValidationCode(vec![1, 1, 2, 3, 4]),
61
24
                        para_kind: ParaKind::Parachain,
62
24
                    },
63
24
                ),
64
24
            ],
65
24
        },
66
24
        ..Default::default()
67
    };
68
24
    build_genesis_storage(&genesis_config, starlight_runtime::WASM_BINARY.unwrap())
69
24
}