Use proper version string.

This commit is contained in:
Gav Wood
2016-02-21 20:00:45 +01:00
parent 75129613c5
commit 63bbd0ccd8
9 changed files with 21 additions and 9 deletions

View File

@@ -29,6 +29,7 @@ serde = "0.6.7"
clippy = { version = "0.0.42", optional = true }
json-tests = { path = "json-tests" }
target_info = "0.1.0"
rustc_version = "0.1.0"
igd = "0.4.2"
ethcore-devtools = { path = "../devtools" }
libc = "0.2.7"

View File

@@ -108,6 +108,7 @@ extern crate log as rlog;
extern crate igd;
extern crate ethcore_devtools as devtools;
extern crate libc;
extern crate rustc_version;
pub mod standard;
#[macro_use]

View File

@@ -18,6 +18,8 @@
use std::fs::File;
use common::*;
use target_info::Target;
use rustc_version;
#[derive(Debug,Clone,PartialEq,Eq)]
/// Diff type for specifying a change (or not).
@@ -62,3 +64,8 @@ pub fn contents(name: &str) -> Result<Bytes, UtilError> {
try!(file.read_to_end(&mut ret));
Ok(ret)
}
/// Get the standard version string for this software.
pub fn version() -> String {
format!("Parity/-/{}/{}-{}-{}/{}", env!("CARGO_PKG_VERSION"), Target::arch(), Target::env(), Target::os(), rustc_version::version())
}

View File

@@ -26,8 +26,8 @@ use std::io::{Read, Write};
use std::fs;
use mio::*;
use mio::tcp::*;
use target_info::Target;
use hash::*;
use misc::version;
use crypto::*;
use sha3::Hashable;
use rlp::*;
@@ -360,7 +360,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
config: config,
nonce: H256::random(),
protocol_version: PROTOCOL_VERSION,
client_version: format!("Parity/{}/{}-{}-{}", env!("CARGO_PKG_VERSION"), Target::arch(), Target::env(), Target::os()),
client_version: version(),
listen_port: 0,
capabilities: Vec::new(),
}),