Fix the can-author issue by defaulting to Kusama when no chainspec given. (#728)

* Fix can_author by defaulting correctly.

* Comments

* Better logging

* Bump Substrate

* Minor updates to readme.
This commit is contained in:
Gavin Wood
2020-01-06 23:20:46 +00:00
committed by GitHub
parent 2d5a1c953a
commit b4c031b4fc
3 changed files with 110 additions and 107 deletions
+6 -3
View File
@@ -76,11 +76,14 @@ pub fn run<E: IntoExit>(exit: E, version: cli::VersionInfo) -> error::Result<()>
"parity-polkadot",
std::env::args(),
);
// TODO: Use `IsKusama` trait. #727
if cmd
.shared_params()
.and_then(|p| p.chain.as_ref())
.and_then(|c| ChainSpec::from(c))
.map_or(false, |c| c.is_kusama())
.map_or(true, |p| ChainSpec::from(&p)
.map_or(false, |c| c.is_kusama())
)
{
execute_cmd_with_runtime::<
service::kusama_runtime::RuntimeApi,
@@ -120,7 +123,7 @@ where
info!("{}", version.name);
info!(" version {}", config.full_version());
info!(" by {}, 2017-2019", version.author);
info!("Chain specification: {}", config.chain_spec.name());
info!("Chain specification: {} (native: {})", config.chain_spec.name(), D::native_version().runtime_version);
if config.is_kusama() {
info!("----------------------------");
info!("This chain is not in any way");