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" name = "ethcore-util"
version = "1.9.0" version = "1.9.0"
dependencies = [ 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-bigint 0.2.1",
"ethcore-bytes 0.1.0", "ethcore-bytes 0.1.0",
"ethcore-logger 1.9.0",
"hashdb 0.1.1", "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", "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)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memorydb 0.1.1", "memorydb 0.1.1",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"patricia-trie 0.1.0", "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", "triehash 0.1.0",
"util-error 0.1.0",
"vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1938,6 +1921,7 @@ dependencies = [
"parity-rpc 1.9.0", "parity-rpc 1.9.0",
"parity-rpc-client 1.4.0", "parity-rpc-client 1.4.0",
"parity-updater 1.9.0", "parity-updater 1.9.0",
"parity-version 0.1.0",
"parity-whisper 0.1.0", "parity-whisper 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0", "path 0.1.0",
@ -1983,6 +1967,7 @@ dependencies = [
"parity-hash-fetch 1.9.0", "parity-hash-fetch 1.9.0",
"parity-reactor 0.1.0", "parity-reactor 0.1.0",
"parity-ui 1.9.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)", "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)", "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)", "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)", "order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-reactor 0.1.0", "parity-reactor 0.1.0",
"parity-updater 1.9.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)", "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)", "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)", "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)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.9.0", "parity-hash-fetch 1.9.0",
"parity-reactor 0.1.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)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0", "path 0.1.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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]] [[package]]
name = "parity-wasm" name = "parity-wasm"
version = "0.15.3" version = "0.15.3"

View File

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

View File

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

View File

@ -19,7 +19,7 @@
use hyper::{self, mime, header}; use hyper::{self, mime, header};
use hyper::StatusCode; use hyper::StatusCode;
use util::version; use parity_version::version;
use handlers::add_security_headers; use handlers::add_security_headers;
use Embeddable; 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_hash_fetch as hash_fetch;
extern crate parity_ui; extern crate parity_ui;
extern crate keccak_hash as hash; extern crate keccak_hash as hash;
extern crate parity_version;
#[macro_use] #[macro_use]
extern crate futures; extern crate futures;

View File

@ -35,6 +35,15 @@ use std::cell::{RefCell, Cell};
const STORAGE_CACHE_ITEMS: usize = 8192; 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. /// Single account in the system.
/// Keeps track of changes to the code and storage. /// Keeps track of changes to the code and storage.
/// The changes are applied in `commit_storage` and `commit_code` /// The changes are applied in `commit_storage` and `commit_code`

View File

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

View File

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

View File

@ -213,7 +213,7 @@ pub fn default_network_config() -> ::ethsync::NetworkConfiguration {
ip_filter: IpFilter::default(), ip_filter: IpFilter::default(),
reserved_nodes: Vec::new(), reserved_nodes: Vec::new(),
allow_non_reserved: true, 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_reactor;
extern crate parity_rpc; extern crate parity_rpc;
extern crate parity_updater as updater; extern crate parity_updater as updater;
extern crate parity_version;
extern crate parity_whisper; extern crate parity_whisper;
extern crate path; extern crate path;
extern crate rpc_cli; extern crate rpc_cli;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -234,14 +234,14 @@ fn rpc_parity_chain_id() {
#[test] #[test]
fn rpc_parity_default_extra_data() { fn rpc_parity_default_extra_data() {
use util::misc; use version::version_data;
use bytes::ToPretty; use bytes::ToPretty;
let deps = Dependencies::new(); let deps = Dependencies::new();
let io = deps.default_client(); let io = deps.default_client();
let request = r#"{"jsonrpc": "2.0", "method": "parity_defaultExtraData", "params": [], "id": 1}"#; 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)); 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/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
use jsonrpc_core::IoHandler; use jsonrpc_core::IoHandler;
use util::version; use version::version;
use v1::{Web3, Web3Client}; use v1::{Web3, Web3Client};
#[test] #[test]

View File

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

View File

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

View File

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

View File

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

View File

@ -5,39 +5,15 @@ license = "GPL-3.0"
name = "ethcore-util" name = "ethcore-util"
version = "1.9.0" version = "1.9.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[dependencies] [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"] } ethcore-bigint = { path = "bigint", features = ["heapsizeof"] }
parking_lot = "0.4"
tiny-keccak= "1.0"
ethcore-logger = { path = "../logger" }
triehash = { path = "triehash" }
hashdb = { path = "hashdb" } hashdb = { path = "hashdb" }
patricia-trie = { path = "patricia_trie" }
ethcore-bytes = { path = "bytes" }
memorydb = { path = "memorydb" } memorydb = { path = "memorydb" }
util-error = { path = "error" }
kvdb = { path = "kvdb" }
journaldb = { path = "journaldb" }
[dev-dependencies] [dev-dependencies]
kvdb-memorydb = { path = "kvdb-memorydb" } ethcore-bytes = { path = "bytes" }
keccak-hash = { path = "hash" }
[features] log = "0.3"
default = [] patricia-trie = { path = "patricia_trie" }
final = [] triehash = { path = "triehash" }
[build-dependencies]
vergen = "0.1"
rustc_version = "0.1.0"

View File

@ -70,33 +70,10 @@
//! cargo build --release //! 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_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 hashdb;
extern crate memorydb; 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 hashdb::*;
pub use memorydb::MemoryDB; 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 vergen;
extern crate rustc_version; extern crate rustc_version;
use vergen::*;
use std::env; use std::env;
use std::fs::File; use std::fs::File;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
use vergen::{vergen, OutputFns};
fn main() { fn main() {
vergen(OutputFns::all()).unwrap(); vergen(OutputFns::all()).unwrap();

View File

@ -16,9 +16,13 @@
//! Diff misc. //! Diff misc.
use rlp::RlpStream; extern crate target_info;
extern crate ethcore_bytes as bytes;
extern crate rlp;
use target_info::Target; use target_info::Target;
use bytes::Bytes; use bytes::Bytes;
use rlp::RlpStream;
include!(concat!(env!("OUT_DIR"), "/version.rs")); include!(concat!(env!("OUT_DIR"), "/version.rs"));
include!(concat!(env!("OUT_DIR"), "/rustc_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"; const THIS_TRACK: &'static str = "unstable";
// ^^^ This gets used when we're not building a final release; should stay as "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. /// Get the platform identifier.
pub fn platform() -> String { pub fn platform() -> String {
let env = Target::env(); let env = Target::env();