From 7be72031920bb6d24078c96ce73cd80c1b82c76f Mon Sep 17 00:00:00 2001 From: Shunsuke Watanabe Date: Sun, 22 May 2022 14:34:37 +0800 Subject: [PATCH] allow only dev chain spec --- node/src/chain_spec.rs | 40 +--------------------------------------- node/src/command.rs | 5 +---- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 3745c8f..2579aaf 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -37,44 +37,6 @@ pub fn development_config() -> Result { // ID "dev", ChainType::Development, - move || { - testnet_genesis( - wasm_binary, - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - ], - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - None, - // Properties - None, - // Extensions - None, - )) -} - -pub fn local_testnet_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Local Testnet", - // ID - "local_testnet", - ChainType::Local, move || { testnet_genesis( wasm_binary, @@ -104,8 +66,8 @@ pub fn local_testnet_config() -> Result { None, // Protocol ID None, - // Properties None, + // Properties None, // Extensions None, diff --git a/node/src/command.rs b/node/src/command.rs index 14c04c8..9400984 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -37,10 +37,7 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result, String> { Ok(match id { - "dev" => Box::new(chain_spec::development_config()?), - "" | "local" => Box::new(chain_spec::local_testnet_config()?), - path => - Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), + "dev" | _ => Box::new(chain_spec::development_config()?), }) }