astar_collator/local/chain_spec.rs
1// This file is part of Astar.
2
3// Copyright (C) Stake Technologies Pte.Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later
5
6// Astar is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// Astar is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with Astar. If not, see <http://www.gnu.org/licenses/>.
18
19use local_runtime::wasm_binary_unwrap;
20use sc_service::ChainType;
21
22/// Specialized `ChainSpec` for local network.
23pub type ChainSpec = sc_service::GenericChainSpec;
24
25/// Development config.
26pub fn development_config() -> ChainSpec {
27 let mut properties = serde_json::map::Map::new();
28 properties.insert("tokenSymbol".into(), "LOC".into());
29 properties.insert("tokenDecimals".into(), 18.into());
30
31 ChainSpec::builder(wasm_binary_unwrap(), None)
32 .with_name("Development")
33 .with_id("dev")
34 .with_chain_type(ChainType::Development)
35 .with_properties(properties)
36 .with_genesis_config(local_runtime::genesis_config::default_config())
37 .build()
38}
39
40#[cfg(test)]
41pub(crate) mod tests {
42 use super::*;
43 use sp_runtime::BuildStorage;
44
45 #[test]
46 fn test_create_development_chain_spec() {
47 development_config().build_storage().unwrap();
48 }
49}