Add spec for westend network (#792)

* add json

* Add spec changes

* Fix config method

* spaces -> tabs
This commit is contained in:
ddorgan
2020-01-23 16:46:40 +00:00
committed by Bastian Köcher
parent 8b39c79fe5
commit 5621c18632
3 changed files with 128 additions and 0 deletions
+4
View File
@@ -28,6 +28,8 @@ pub enum ChainSpec {
LocalTestnet,
/// The Kusama network.
Kusama,
/// The Westend network,
Westend,
/// Whatever the current runtime is with the "global testnet" defaults.
StagingTestnet,
}
@@ -45,6 +47,7 @@ impl ChainSpec {
ChainSpec::Development => Ok(service::chain_spec::development_config()),
ChainSpec::LocalTestnet => Ok(service::chain_spec::local_testnet_config()),
ChainSpec::StagingTestnet => Ok(service::chain_spec::staging_testnet_config()),
ChainSpec::Westend => service::chain_spec::westend_config(),
ChainSpec::Kusama => service::chain_spec::kusama_config(),
}
}
@@ -54,6 +57,7 @@ impl ChainSpec {
"dev" => Some(ChainSpec::Development),
"local" => Some(ChainSpec::LocalTestnet),
"kusama" => Some(ChainSpec::Kusama),
"westend" => Some(ChainSpec::Westend),
"staging" => Some(ChainSpec::StagingTestnet),
"" => Some(ChainSpec::default()),
_ => None,
File diff suppressed because one or more lines are too long
+4
View File
@@ -60,6 +60,10 @@ pub fn kusama_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(&include_bytes!("../res/kusama.json")[..])
}
pub fn westend_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(&include_bytes!("../res/westend.json")[..])
}
fn session_keys(
babe: BabeId,
grandpa: GrandpaId,