Skip to content

Commit 0f817b7

Browse files
committed
revert node part update
1 parent 89a5e7f commit 0f817b7

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

node/src/chain_spec/localnet.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use super::*;
55

6-
pub fn localnet_config(authority_count: u32) -> Result<ChainSpec, String> {
6+
pub fn localnet_config(single_authority: bool) -> Result<ChainSpec, String> {
77
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
88

99
// Give front-ends necessary data to present to users
@@ -32,19 +32,11 @@ pub fn localnet_config(authority_count: u32) -> Result<ChainSpec, String> {
3232
.with_genesis_config_patch(localnet_genesis(
3333
// Initial PoA authorities (Validators)
3434
// aura | grandpa
35-
if authority_count == 1 {
35+
if single_authority {
3636
// single authority allows you to run the network using a single node
3737
vec![authority_keys_from_seed("One")]
38-
} else if authority_count == 2 {
39-
vec![
40-
authority_keys_from_seed("One"),
41-
authority_keys_from_seed("Two"),
42-
]
4338
} else {
4439
vec![
45-
authority_keys_from_seed("Dave"),
46-
authority_keys_from_seed("Eve"),
47-
authority_keys_from_seed("Ferdie"),
4840
authority_keys_from_seed("One"),
4941
authority_keys_from_seed("Two"),
5042
authority_keys_from_seed("Three"),

node/src/command.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ impl SubstrateCli for Cli {
4545

4646
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
4747
Ok(match id {
48-
"dev" => Box::new(chain_spec::localnet::localnet_config(1)?),
49-
"local" => Box::new(chain_spec::localnet::localnet_config(2)?),
50-
"local5" => Box::new(chain_spec::localnet::localnet_config(5)?),
48+
"dev" => Box::new(chain_spec::localnet::localnet_config(true)?),
49+
"local" => Box::new(chain_spec::localnet::localnet_config(false)?),
5150
"finney" => Box::new(chain_spec::finney::finney_mainnet_config()?),
5251
"devnet" => Box::new(chain_spec::devnet::devnet_config()?),
5352
"" | "test_finney" => Box::new(chain_spec::testnet::finney_testnet_config()?),

0 commit comments

Comments
 (0)