diff --git a/Cargo.lock b/Cargo.lock index 1e9f57900..32a6326f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,7 +2,7 @@ name = "parity" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 1.0.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)", "docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)", "docopt_macros 0.6.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -38,6 +38,9 @@ dependencies = [ name = "aster" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_syntax 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "bitflags" @@ -61,7 +64,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clippy" -version = "0.0.41" +version = "0.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "regex-syntax 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -167,7 +170,7 @@ dependencies = [ name = "ethcore" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 0.9.99", @@ -186,16 +189,17 @@ dependencies = [ name = "ethcore-rpc" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 0.9.99", "ethcore-util 0.9.99", "ethsync 0.9.99", - "jsonrpc-core 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -204,7 +208,7 @@ name = "ethcore-util" version = "0.9.99" dependencies = [ "arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -232,7 +236,7 @@ dependencies = [ name = "ethsync" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 0.9.99", "ethcore-util 0.9.99", @@ -346,12 +350,13 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -360,7 +365,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -529,6 +534,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "quasi" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_syntax 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "quasi_codegen" @@ -536,14 +544,8 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quasi_macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quasi_codegen 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -631,7 +633,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aster 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "quasi 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi_macros 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -643,14 +647,6 @@ dependencies = [ "serde 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_macros" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde_codegen 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sha3" version = "0.1.0" @@ -682,11 +678,41 @@ name = "strsim" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "syntex" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_syntax 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_syntax" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "target_info" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "term" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.34" @@ -733,6 +759,11 @@ name = "unicode-normalization" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "url" version = "0.2.38" diff --git a/Cargo.toml b/Cargo.toml index c58cacf0d..0a55038dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ rustc-serialize = "0.3" docopt = "0.6" docopt_macros = "0.6" ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" } -clippy = "0.0.41" +clippy = "0.0.42" ethcore-util = { path = "util" } ethcore = { path = "ethcore" } ethsync = { path = "sync" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 3d4d27520..5298a253f 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ ethcore-util = { path = "../util" } evmjit = { path = "../evmjit", optional = true } ethash = { path = "../ethash" } num_cpus = "0.2" -clippy = "0.0.41" +clippy = "0.0.42" crossbeam = "0.1.5" lazy_static = "0.1" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index b1af0a2fa..4e79fa8f5 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -4,18 +4,28 @@ name = "ethcore-rpc" version = "0.9.99" license = "GPL-3.0" authors = ["Ethcore . //! Ethcore rpc. -#![warn(missing_docs)] -#![feature(custom_derive, custom_attribute, plugin)] -#![plugin(serde_macros)] -#![plugin(clippy)] +#![cfg_attr(nightly, feature(custom_derive, custom_attribute, plugin))] +#![cfg_attr(nightly, plugin(serde_macros, clippy))] extern crate rustc_serialize; extern crate target_info; @@ -30,38 +28,8 @@ extern crate ethcore_util as util; extern crate ethcore; extern crate ethsync; -use self::jsonrpc_core::{IoHandler, IoDelegate}; +#[cfg(feature = "serde_macros")] +include!("lib.rs.in"); -pub mod v1; - -/// Http server. -pub struct HttpServer { - handler: IoHandler, - threads: usize -} - -impl HttpServer { - /// Construct new http server object with given number of threads. - pub fn new(threads: usize) -> HttpServer { - HttpServer { - handler: IoHandler::new(), - threads: threads - } - } - - /// Add io delegate. - pub fn add_delegate(&mut self, delegate: IoDelegate) where D: Send + Sync + 'static { - self.handler.add_delegate(delegate); - } - - /// Start server asynchronously in new thread - pub fn start_async(self, addr: &str) { - let server = jsonrpc_http_server::Server::new(self.handler, self.threads); - server.start_async(addr) - } -} - -/// Lib needs at least 1 test to generate coverage reports correctly. -#[test] -fn if_works() { -} +#[cfg(not(feature = "serde_macros"))] +include!(concat!(env!("OUT_DIR"), "/lib.rs")); diff --git a/rpc/src/lib.rs.in b/rpc/src/lib.rs.in new file mode 100644 index 000000000..f09a25be8 --- /dev/null +++ b/rpc/src/lib.rs.in @@ -0,0 +1,30 @@ +use self::jsonrpc_core::{IoHandler, IoDelegate}; + +pub mod v1; + +/// Http server. +pub struct HttpServer { + handler: IoHandler, + threads: usize +} + +impl HttpServer { + /// Construct new http server object with given number of threads. + pub fn new(threads: usize) -> HttpServer { + HttpServer { + handler: IoHandler::new(), + threads: threads + } + } + + /// Add io delegate. + pub fn add_delegate(&mut self, delegate: IoDelegate) where D: Send + Sync + 'static { + self.handler.add_delegate(delegate); + } + + /// Start server asynchronously in new thread + pub fn start_async(self, addr: &str) { + let server = jsonrpc_http_server::Server::new(self.handler, self.threads); + server.start_async(addr) + } +} diff --git a/sync/Cargo.toml b/sync/Cargo.toml index 92b46fc57..db1a7ba82 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Ethcore