Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions substrate/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ where
{
panic_hook::set();

let full_version = service::Configuration::<<F>::Configuration, <F>::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,
Expand Down
29 changes: 15 additions & 14 deletions substrate/service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,27 @@ impl<C: Default, G: Serialize + DeserializeOwned + BuildStorage> Configuration<C
configuration
}

/// Returns platform info
pub fn platform() -> 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.
pub fn client_id(&self) -> String {
format!("{}/v{}", self.impl_name, self.full_version())
}
}

/// Returns platform info
pub fn platform() -> String {
let env = Target::env();
let env_dash = if env.is_empty() { "" } else { "-" };
format!("{}-{}{}{}", Target::arch(), Target::os(), env_dash, env)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these tabs or some kind of weird half-tab? github is rendering them strangely. also in the below function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just my attempts to get these changes into GitHub - had a few problems with this today! I'll try to correct them..

Copy link
Contributor Author

@simonljs simonljs Aug 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking around, these strange tab sizes seem common in many files displayed on GitHub. I think it is perhaps just more noticeable in this one with the free functions.
Anyway, I tried pulling this file from Github back to my local machine and the tabs were all normal.

}

/// 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())
}

2 changes: 1 addition & 1 deletion substrate/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down