1
// Copyright 2019-2025 PureStake Inc.
2
// This file is part of Moonbeam.
3

            
4
// Moonbeam 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
// Moonbeam 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 Moonbeam.  If not, see <http://www.gnu.org/licenses/>.
16

            
17
//! Embedded specs for testing purposes, must be compiled with --features=test-spec
18
use crate::chain_spec::moonbase::ChainSpec;
19
use crate::chain_spec::Extensions;
20
use cumulus_primitives_core::ParaId;
21
use sc_service::ChainType;
22

            
23
/// Generate testing chain_spec for staking integration tests with accounts initialized for
24
/// collating and nominating.
25
pub fn staking_spec(para_id: ParaId) -> ChainSpec {
26
	ChainSpec::builder(
27
		moonbase_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!"),
28
		Extensions {
29
			relay_chain: "westend_local".into(),
30
			para_id: para_id.into(),
31
		},
32
	)
33
	.with_name("Moonbase Development Testnet")
34
	.with_id("staking")
35
	.with_chain_type(ChainType::Local)
36
	.with_properties(
37
		serde_json::from_str("{\"tokenDecimals\": 18}").expect("Provided valid json map"),
38
	)
39
	.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
40
	.build()
41
}
42

            
43
#[cfg(feature = "lazy-loading")]
44
pub fn lazy_loading_spec_builder() -> sc_chain_spec::ChainSpecBuilder<Extensions> {
45
	crate::chain_spec::moonbeam::ChainSpec::builder(
46
		moonbeam_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!"),
47
		Default::default(),
48
	)
49
	.with_name("Lazy Loading")
50
	.with_id("lazy_loading")
51
	.with_chain_type(ChainType::Development)
52
	.with_properties(
53
		serde_json::from_str(
54
			"{\"tokenDecimals\": 18, \"tokenSymbol\": \"GLMR\", \"SS58Prefix\": 1284}",
55
		)
56
		.expect("Provided valid json map"),
57
	)
58
	.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
59
}