parity-version pr reopen (#7136)

* parity-version module split from util

removed unused util deps and features

trigger buildbot again

only kvdb links rocksdb

snappy linker issues

* rm snappy

* fixed old version imports
This commit is contained in:
Marek Kotewicz 2017-12-22 09:37:39 -04:00 committed by GitHub
parent 7c24d0665e
commit d80dd81d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 74 additions and 96 deletions

32
Cargo.lock generated
View File

@ -715,31 +715,14 @@ dependencies = [
name = "ethcore-util"
version = "1.9.0"
dependencies = [
"elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)",
"ethcore-bigint 0.2.1",
"ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0",
"hashdb 0.1.1",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"journaldb 0.1.0",
"keccak-hash 0.1.0",
"kvdb 0.1.0",
"kvdb-memorydb 0.1.0",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memorydb 0.1.1",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"patricia-trie 0.1.0",
"rlp 0.2.1",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"triehash 0.1.0",
"util-error 0.1.0",
"vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1938,6 +1921,7 @@ dependencies = [
"parity-rpc 1.9.0",
"parity-rpc-client 1.4.0",
"parity-updater 1.9.0",
"parity-version 0.1.0",
"parity-whisper 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
@ -1983,6 +1967,7 @@ dependencies = [
"parity-hash-fetch 1.9.0",
"parity-reactor 0.1.0",
"parity-ui 1.9.0",
"parity-version 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2130,6 +2115,7 @@ dependencies = [
"order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-reactor 0.1.0",
"parity-updater 1.9.0",
"parity-version 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2237,12 +2223,24 @@ dependencies = [
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.9.0",
"parity-reactor 0.1.0",
"parity-version 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-version"
version = "0.1.0"
dependencies = [
"ethcore-bytes 0.1.0",
"rlp 0.2.1",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-wasm"
version = "0.15.3"

View File

@ -55,6 +55,7 @@ parity-reactor = { path = "util/reactor" }
parity-rpc = { path = "rpc" }
parity-rpc-client = { path = "rpc_client" }
parity-updater = { path = "updater" }
parity-version = { path = "util/version" }
parity-whisper = { path = "whisper" }
path = { path = "util/path" }
panic_hook = { path = "panic_hook" }
@ -98,7 +99,6 @@ test-heavy = ["ethcore/test-heavy"]
evm-debug = ["ethcore/evm-debug"]
evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"]
final = ["ethcore-util/final"]
secretstore = ["ethcore-secretstore"]
[[bin]]

View File

@ -37,6 +37,7 @@ parity-hash-fetch = { path = "../hash-fetch" }
parity-reactor = { path = "../util/reactor" }
parity-ui = { path = "./ui" }
keccak-hash = { path = "../util/hash" }
parity-version = { path = "../util/version" }
[dev-dependencies]
env_logger = "0.4"

View File

@ -19,7 +19,7 @@
use hyper::{self, mime, header};
use hyper::StatusCode;
use util::version;
use parity_version::version;
use handlers::add_security_headers;
use Embeddable;

View File

@ -41,6 +41,7 @@ extern crate parity_dapps_glue as parity_dapps;
extern crate parity_hash_fetch as hash_fetch;
extern crate parity_ui;
extern crate keccak_hash as hash;
extern crate parity_version;
#[macro_use]
extern crate futures;

View File

@ -35,6 +35,15 @@ use std::cell::{RefCell, Cell};
const STORAGE_CACHE_ITEMS: usize = 8192;
/// Boolean type for clean/dirty status.
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Filth {
/// Data has not been changed.
Clean,
/// Data has been changed.
Dirty,
}
/// Single account in the system.
/// Keeps track of changes to the code and storage.
/// The changes are applied in `commit_storage` and `commit_code`

View File

@ -152,7 +152,7 @@ macro_rules! usage {
use toml;
use std::{fs, io, process};
use std::io::{Read, Write};
use util::version;
use parity_version::version;
use clap::{Arg, App, SubCommand, AppSettings, ArgMatches as ClapArgMatches, Error as ClapError, ErrorKind as ClapErrorKind};
use helpers::replace_home;
use std::ffi::OsStr;

View File

@ -25,7 +25,8 @@ use cli::{Args, ArgsError};
use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{version_data, Address, version};
use util::Address;
use parity_version::{version_data, version};
use bytes::Bytes;
use ansi_term::Colour;
use ethsync::{NetworkConfiguration, validate_node_url, self};

View File

@ -213,7 +213,7 @@ pub fn default_network_config() -> ::ethsync::NetworkConfiguration {
ip_filter: IpFilter::default(),
reserved_nodes: Vec::new(),
allow_non_reserved: true,
client_version: ::util::version(),
client_version: ::parity_version::version(),
}
}

View File

@ -67,6 +67,7 @@ extern crate parity_local_store as local_store;
extern crate parity_reactor;
extern crate parity_rpc;
extern crate parity_updater as updater;
extern crate parity_version;
extern crate parity_whisper;
extern crate path;
extern crate rpc_cli;

View File

@ -17,7 +17,8 @@
use std::{str, fs, fmt};
use std::time::Duration;
use bigint::prelude::U256;
use util::{Address, version_data};
use util::Address;
use parity_version::version_data;
use journaldb::Algorithm;
use ethcore::spec::{Spec, SpecParams};
use ethcore::ethereum;

View File

@ -39,7 +39,7 @@ use parity_reactor::EventLoop;
use parity_rpc::{NetworkSettings, informant, is_major_importing};
use updater::{UpdatePolicy, Updater};
use ansi_term::Colour;
use util::version;
use parity_version::version;
use parking_lot::{Condvar, Mutex};
use node_filter::NodeFilter;
use journaldb::Algorithm;

View File

@ -54,6 +54,7 @@ fetch = { path = "../util/fetch" }
node-health = { path = "../dapps/node-health" }
parity-reactor = { path = "../util/reactor" }
parity-updater = { path = "../updater" }
parity-version = { path = "../util/version" }
rlp = { path = "../util/rlp" }
stats = { path = "../util/stats" }
vm = { path = "../ethcore/vm" }

View File

@ -62,6 +62,7 @@ extern crate fetch;
extern crate node_health;
extern crate parity_reactor;
extern crate parity_updater as updater;
extern crate parity_version as version;
extern crate rlp;
extern crate stats;
extern crate keccak_hash as hash;

View File

@ -18,7 +18,7 @@
use std::sync::Arc;
use std::collections::{BTreeMap, HashSet};
use util::misc::version_data;
use version::version_data;
use crypto::{ecies, DEFAULT_MAC};
use ethkey::{Brain, Generator};

View File

@ -20,7 +20,7 @@ use std::str::FromStr;
use std::collections::{BTreeMap, HashSet};
use util::Address;
use util::misc::version_data;
use version::version_data;
use crypto::{DEFAULT_MAC, ecies};
use ethkey::{Brain, Generator};

View File

@ -17,7 +17,7 @@
//! Web3 rpc implementation.
use hash::keccak;
use jsonrpc_core::Result;
use util::version;
use version::version;
use v1::traits::Web3;
use v1::types::{H256, Bytes};

View File

@ -234,14 +234,14 @@ fn rpc_parity_chain_id() {
#[test]
fn rpc_parity_default_extra_data() {
use util::misc;
use version::version_data;
use bytes::ToPretty;
let deps = Dependencies::new();
let io = deps.default_client();
let request = r#"{"jsonrpc": "2.0", "method": "parity_defaultExtraData", "params": [], "id": 1}"#;
let response = format!(r#"{{"jsonrpc":"2.0","result":"0x{}","id":1}}"#, misc::version_data().to_hex());
let response = format!(r#"{{"jsonrpc":"2.0","result":"0x{}","id":1}}"#, version_data().to_hex());
assert_eq!(io.handle_request_sync(request), Some(response));
}

View File

@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use jsonrpc_core::IoHandler;
use util::version;
use version::version;
use v1::{Web3, Web3Client};
#[test]

View File

@ -19,4 +19,5 @@ futures = "0.1"
parking_lot = "0.4"
parity-hash-fetch = { path = "../hash-fetch" }
parity-reactor = { path = "../util/reactor" }
parity-version = { path = "../util/version" }
path = { path = "../util/path" }

View File

@ -28,6 +28,7 @@ extern crate ethsync;
extern crate futures;
extern crate target_info;
extern crate parity_reactor;
extern crate parity_version as version;
extern crate path;
extern crate semver;

View File

@ -19,7 +19,7 @@
use std::fmt;
use semver::{Version};
use bigint::hash::H160;
use util::misc::raw_package_info;
use version::raw_package_info;
use types::ReleaseTrack;
/// Version information of a particular release.

View File

@ -34,7 +34,7 @@ use bigint::hash::{H160, H256};
use util::Address;
use bytes::Bytes;
use parking_lot::Mutex;
use util::misc;
use version;
/// Filter for releases.
#[derive(Debug, Eq, PartialEq, Clone)]
@ -115,7 +115,7 @@ fn platform() -> String {
} else if cfg!(target_os = "linux") {
format!("{}-unknown-linux-gnu", Target::arch())
} else {
misc::platform()
version::platform()
}
}

View File

@ -5,39 +5,15 @@ license = "GPL-3.0"
name = "ethcore-util"
version = "1.9.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[dependencies]
log = "0.3"
env_logger = "0.4"
rustc-hex = "1.0"
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
elastic-array = "0.9"
rlp = { path = "rlp" }
heapsize = "0.4"
keccak-hash = { path = "hash" }
libc = "0.2.7"
target_info = "0.1"
ethcore-bigint = { path = "bigint", features = ["heapsizeof"] }
parking_lot = "0.4"
tiny-keccak= "1.0"
ethcore-logger = { path = "../logger" }
triehash = { path = "triehash" }
hashdb = { path = "hashdb" }
patricia-trie = { path = "patricia_trie" }
ethcore-bytes = { path = "bytes" }
memorydb = { path = "memorydb" }
util-error = { path = "error" }
kvdb = { path = "kvdb" }
journaldb = { path = "journaldb" }
[dev-dependencies]
kvdb-memorydb = { path = "kvdb-memorydb" }
[features]
default = []
final = []
[build-dependencies]
vergen = "0.1"
rustc_version = "0.1.0"
ethcore-bytes = { path = "bytes" }
keccak-hash = { path = "hash" }
log = "0.3"
patricia-trie = { path = "patricia_trie" }
triehash = { path = "triehash" }

View File

@ -70,33 +70,10 @@
//! cargo build --release
//! ```
extern crate rustc_hex;
extern crate env_logger;
extern crate secp256k1;
extern crate elastic_array;
extern crate libc;
extern crate target_info;
extern crate ethcore_bigint as bigint;
extern crate ethcore_bytes as bytes;
extern crate parking_lot;
extern crate tiny_keccak;
extern crate rlp;
extern crate heapsize;
extern crate ethcore_logger;
extern crate keccak_hash as keccak;
extern crate hashdb;
extern crate memorydb;
extern crate patricia_trie as trie;
extern crate kvdb;
extern crate util_error as error;
#[cfg(test)]
extern crate kvdb_memorydb;
pub mod misc;
pub use misc::*;
pub use hashdb::*;
pub use memorydb::MemoryDB;

14
util/version/Cargo.toml Normal file
View File

@ -0,0 +1,14 @@
[package]
name = "parity-version"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[dependencies]
ethcore-bytes = { path = "../bytes" }
rlp = { path = "../rlp" }
target_info = "0.1"
[build-dependencies]
vergen = "0.1"
rustc_version = "0.1.0"

View File

@ -17,11 +17,11 @@
extern crate vergen;
extern crate rustc_version;
use vergen::*;
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use vergen::{vergen, OutputFns};
fn main() {
vergen(OutputFns::all()).unwrap();

View File

@ -16,9 +16,13 @@
//! Diff misc.
use rlp::RlpStream;
extern crate target_info;
extern crate ethcore_bytes as bytes;
extern crate rlp;
use target_info::Target;
use bytes::Bytes;
use rlp::RlpStream;
include!(concat!(env!("OUT_DIR"), "/version.rs"));
include!(concat!(env!("OUT_DIR"), "/rustc_version.rs"));
@ -31,15 +35,6 @@ const THIS_TRACK: &'static str = "nightly";
const THIS_TRACK: &'static str = "unstable";
// ^^^ This gets used when we're not building a final release; should stay as "unstable".
/// Boolean type for clean/dirty status.
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Filth {
/// Data has not been changed.
Clean,
/// Data has been changed.
Dirty,
}
/// Get the platform identifier.
pub fn platform() -> String {
let env = Target::env();