diff --git a/substrate/cli/src/lib.rs b/substrate/cli/src/lib.rs index d3512a415f1e9..a014189197020 100644 --- a/substrate/cli/src/lib.rs +++ b/substrate/cli/src/lib.rs @@ -163,9 +163,10 @@ where { panic_hook::set(); - let full_version = service::Configuration::<::Configuration, ::Genesis> - ::full_version_from_strs(version.version, version.commit); - + let full_version = service::config::full_version_from_strs( + version.version, + version.commit + ); let yaml = format!(include_str!("./cli.yml"), name = version.executable_name, description = version.description, diff --git a/substrate/service/src/config.rs b/substrate/service/src/config.rs index 7a5696bc261e4..465d7851c6468 100644 --- a/substrate/service/src/config.rs +++ b/substrate/service/src/config.rs @@ -98,22 +98,9 @@ impl Configuration String { - let env = Target::env(); - let env_dash = if env.is_empty() { "" } else { "-" }; - format!("{}-{}{}{}", Target::arch(), Target::os(), env_dash, env) - } - /// Returns full version string of this configuration. pub fn full_version(&self) -> String { - Self::full_version_from_strs(self.impl_version, self.impl_commit) - } - - /// Returns full version string, using supplied version and commit. - pub fn full_version_from_strs(impl_version: &str, impl_commit: &str) -> String { - let commit_dash = if impl_commit.is_empty() { "" } else { "-" }; - format!("{}{}{}-{}", impl_version, commit_dash, impl_commit, Self::platform()) + full_version_from_strs(self.impl_version, self.impl_commit) } /// Implementation id and version. @@ -121,3 +108,17 @@ impl Configuration String { + let env = Target::env(); + let env_dash = if env.is_empty() { "" } else { "-" }; + format!("{}-{}{}{}", Target::arch(), Target::os(), env_dash, env) +} + +/// Returns full version string, using supplied version and commit. +pub fn full_version_from_strs(impl_version: &str, impl_commit: &str) -> String { + let commit_dash = if impl_commit.is_empty() { "" } else { "-" }; + format!("{}{}{}-{}", impl_version, commit_dash, impl_commit, platform()) +} + diff --git a/substrate/service/src/lib.rs b/substrate/service/src/lib.rs index d906bae088e8d..711bd87548361 100644 --- a/substrate/service/src/lib.rs +++ b/substrate/service/src/lib.rs @@ -50,8 +50,8 @@ extern crate serde_derive; mod components; mod error; -mod config; mod chain_spec; +pub mod config; pub mod chain_ops; use std::io;