From f1e99ea2e40df59f4ea0b47a6c8a9f98840bdc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 13 Feb 2017 16:38:47 +0100 Subject: [PATCH] Serde 0.9 (#4508) * Porting json * Dapps * Rpc & Ethstore * New ethabi * Last bunch of fixes * Fixing last test * Removing build script * Adding ethcore-ipc-tests back * Fixing grumbles * Fixing blockchain tests (inference regression?) --- Cargo.lock | 222 ++--- Cargo.toml | 13 +- build.rs | 25 - dapps/Cargo.toml | 12 +- dapps/build.rs | 41 - dapps/src/api/mod.rs | 3 - dapps/src/api/types.rs | 51 +- dapps/src/api/types.rs.in | 64 -- dapps/src/lib.rs | 4 +- ethcore/Cargo.toml | 5 +- ethcore/src/blockchain/blockchain.rs | 13 +- ethcore/src/lib.rs | 2 - ethstore/Cargo.toml | 15 +- ethstore/build.rs | 41 - ethstore/src/json/bytes.rs | 23 +- ethstore/src/json/cipher.rs | 21 +- ethstore/src/json/crypto.rs | 60 +- ethstore/src/json/hash.rs | 18 +- ethstore/src/json/id.rs | 16 +- ethstore/src/json/kdf.rs | 44 +- ethstore/src/json/key_file.rs | 48 +- ethstore/src/json/mod.rs | 29 +- ethstore/src/json/mod.rs.in | 26 - ethstore/src/json/vault_file.rs | 77 +- ethstore/src/json/vault_key_file.rs | 183 +--- ethstore/src/json/version.rs | 15 +- ethstore/src/lib.rs | 6 +- evmbin/Cargo.lock | 1268 -------------------------- hash-fetch/Cargo.toml | 2 +- ipc-common-types/Cargo.toml | 1 - ipc-common-types/src/lib.rs | 3 +- ipc/codegen/src/lib.rs | 1 - json/Cargo.toml | 13 +- json/build.rs | 41 - json/src/bytes.rs | 15 +- json/src/hash.rs | 17 +- json/src/lib.rs | 27 +- json/src/lib.rs.in | 32 - json/src/maybe.rs | 21 +- json/src/trie/input.rs | 29 +- json/src/uint.rs | 17 +- logger/src/lib.rs | 1 - parity/main.rs | 110 ++- parity/user_defaults.rs | 22 +- rpc/Cargo.toml | 12 +- rpc/build.rs | 41 - rpc/src/lib.rs | 6 +- rpc/src/v1/tests/mocked/signing.rs | 2 +- rpc/src/v1/types/block.rs | 14 +- rpc/src/v1/types/block_number.rs | 18 +- rpc/src/v1/types/bytes.rs | 17 +- rpc/src/v1/types/confirmations.rs | 4 +- rpc/src/v1/types/filter.rs | 18 +- rpc/src/v1/types/hash.rs | 16 +- rpc/src/v1/types/index.rs | 17 +- rpc/src/v1/types/mod.rs | 59 +- rpc/src/v1/types/mod.rs.in | 69 -- rpc/src/v1/types/sync.rs | 2 +- rpc/src/v1/types/trace.rs | 75 +- rpc/src/v1/types/transaction.rs | 38 +- rpc/src/v1/types/uint.rs | 18 +- rpc/src/v1/types/work.rs | 2 +- rpc_client/Cargo.toml | 6 +- rpc_client/src/lib.rs | 5 - rpc_client/src/signer_client.rs | 11 +- stratum/src/lib.rs | 8 +- updater/Cargo.toml | 2 +- util/src/lib.rs | 6 +- 68 files changed, 683 insertions(+), 2480 deletions(-) delete mode 100644 build.rs delete mode 100644 dapps/build.rs delete mode 100644 dapps/src/api/types.rs.in delete mode 100644 ethstore/build.rs delete mode 100755 ethstore/src/json/mod.rs.in delete mode 100644 evmbin/Cargo.lock delete mode 100644 json/build.rs delete mode 100644 json/src/lib.rs.in delete mode 100644 rpc/build.rs delete mode 100644 rpc/src/v1/types/mod.rs.in diff --git a/Cargo.lock b/Cargo.lock index 2497856e1..18d4177b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,6 @@ dependencies = [ "ethcore-devtools 1.6.0", "ethcore-io 1.6.0", "ethcore-ipc 1.6.0", - "ethcore-ipc-codegen 1.6.0", "ethcore-ipc-hypervisor 1.2.0", "ethcore-ipc-nano 1.6.0", "ethcore-ipc-tests 0.1.0", @@ -42,10 +41,9 @@ dependencies = [ "rpassword 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rpc-cli 1.4.0", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -298,11 +296,6 @@ dependencies = [ "strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "dtoa" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "dtoa" version = "0.4.0" @@ -344,14 +337,13 @@ dependencies = [ [[package]] name = "ethabi" -version = "0.2.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -375,7 +367,7 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.6.0", "ethcore-bloom-journal 0.1.0", "ethcore-devtools 1.6.0", @@ -390,7 +382,6 @@ dependencies = [ "ethstore 0.1.0", "evmjit 1.6.0", "hardware-wallet 1.6.0", - "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.10.0-a.0 (git+https://github.com/ethcore/hyper)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -449,9 +440,9 @@ dependencies = [ "parity-ui 1.6.0", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -621,9 +612,9 @@ dependencies = [ "rlp 0.1.0", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "transient-hashmap 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -721,9 +712,9 @@ version = "0.1.0" dependencies = [ "ethcore-util 1.6.0", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -758,9 +749,9 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1011,7 +1002,6 @@ dependencies = [ "ethcore-ipc 1.6.0", "ethcore-ipc-codegen 1.6.0", "ethcore-util 1.6.0", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1033,11 +1023,6 @@ dependencies = [ "either 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "itoa" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "itoa" version = "0.3.0" @@ -1046,20 +1031,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-core" version = "5.1.0" -source = "git+https://github.com/ethcore/jsonrpc.git#d179ce34d8da8ea1cd67e93a5b4cb1e30f48c156" +source = "git+https://github.com/ethcore/jsonrpc.git#cac47f72090c3db78e83d56d333ada52a22dd3a9" dependencies = [ "futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-http-server" version = "7.0.0" -source = "git+https://github.com/ethcore/jsonrpc.git#d179ce34d8da8ea1cd67e93a5b4cb1e30f48c156" +source = "git+https://github.com/ethcore/jsonrpc.git#cac47f72090c3db78e83d56d333ada52a22dd3a9" dependencies = [ "hyper 0.10.0-a.0 (git+https://github.com/ethcore/hyper)", "jsonrpc-core 5.1.0 (git+https://github.com/ethcore/jsonrpc.git)", @@ -1071,7 +1056,7 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" version = "1.0.0" -source = "git+https://github.com/ethcore/jsonrpc.git#d179ce34d8da8ea1cd67e93a5b4cb1e30f48c156" +source = "git+https://github.com/ethcore/jsonrpc.git#cac47f72090c3db78e83d56d333ada52a22dd3a9" dependencies = [ "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1087,23 +1072,23 @@ dependencies = [ [[package]] name = "jsonrpc-macros" version = "0.2.0" -source = "git+https://github.com/ethcore/jsonrpc.git#d179ce34d8da8ea1cd67e93a5b4cb1e30f48c156" +source = "git+https://github.com/ethcore/jsonrpc.git#cac47f72090c3db78e83d56d333ada52a22dd3a9" dependencies = [ "jsonrpc-core 5.1.0 (git+https://github.com/ethcore/jsonrpc.git)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-tcp-server" version = "1.0.0" -source = "git+https://github.com/ethcore/jsonrpc.git#d179ce34d8da8ea1cd67e93a5b4cb1e30f48c156" +source = "git+https://github.com/ethcore/jsonrpc.git#cac47f72090c3db78e83d56d333ada52a22dd3a9" dependencies = [ "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 5.1.0 (git+https://github.com/ethcore/jsonrpc.git)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1565,7 +1550,7 @@ dependencies = [ name = "parity-hash-fetch" version = "1.6.0" dependencies = [ - "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.6.0", "fetch 0.1.0", "futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1594,12 +1579,10 @@ dependencies = [ "ethcore-util 1.6.0", "futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 5.1.0 (git+https://github.com/ethcore/jsonrpc.git)", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.5.3 (git+https://github.com/ethcore/ws-rs.git?branch=mio-upstream-stable)", @@ -1633,7 +1616,7 @@ dependencies = [ name = "parity-updater" version = "1.6.0" dependencies = [ - "ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.6.0", "ethcore-ipc 1.6.0", "ethcore-ipc-codegen 1.6.0", @@ -1828,8 +1811,8 @@ dependencies = [ "hyper 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2013,54 +1996,36 @@ dependencies = [ [[package]] name = "serde" -version = "0.8.19" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "serde" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_codegen" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen_internals 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_codegen_internals" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen_internals 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_json" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2070,7 +2035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2161,11 +2126,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.10.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2176,36 +2141,6 @@ dependencies = [ "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "syntex" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syntex_errors" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (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 = "syntex_pos" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "syntex_syntax" version = "0.33.0" @@ -2219,21 +2154,6 @@ dependencies = [ "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "syntex_syntax" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (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 = "table" version = "0.1.0" @@ -2265,15 +2185,6 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "term" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "termios" version = "0.2.2" @@ -2410,6 +2321,11 @@ name = "unicode-xid" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "url" version = "1.2.0" @@ -2560,13 +2476,12 @@ dependencies = [ "checksum daemonize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "271ec51b7e0bee92f0d04601422c73eb76ececf197026711c97ad25038a010cf" "checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" "checksum docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4cc0acb4ce0828c6a5a11d47baa432fe885881c27428c3a4e473e454ffe57a76" -"checksum dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd841b58510c9618291ffa448da2e4e0f699d984d436122372f446dae62263d" "checksum dtoa 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5edd69c67b2f8e0911629b7e6b8a34cb3956613cd7c6e6414966dee349c2db4f" "checksum either 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2b503c86dad62aaf414ecf2b8c527439abedb3f8d812537f0b12bfd6f32a91" "checksum elastic-array 0.6.0 (git+https://github.com/ethcore/elastic-array)" = "" "checksum env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "aba65b63ffcc17ffacd6cf5aa843da7c5a25e3bd4bbe0b7def8b214e411250e5" "checksum eth-secp256k1 0.5.6 (git+https://github.com/ethcore/rust-secp256k1)" = "" -"checksum ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0c53453517f620847be51943db329276ae52f2e210cfc659e81182864be2f" +"checksum ethabi 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d8f6cc4c1acd005f48e1d17b06a461adac8fb6eeeb331fbf19a0e656fba91cd" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "3eeb481e957304178d2e782f2da1257f1434dfecbae883bafb61ada2a9fea3bb" "checksum futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bad0a2ac64b227fdc10c254051ae5af542cf19c9328704fd4092f7914196897" @@ -2587,7 +2502,6 @@ dependencies = [ "checksum igd 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c8c12b1795b8b168f577c45fa10379b3814dcb11b7ab702406001f0d63f40484" "checksum isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7408a548dc0e406b7912d9f84c261cc533c1866e047644a811c133c56041ac0c" "checksum itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d95557e7ba6b71377b0f2c3b3ae96c53f1b75a926a6901a500f557a370af730a" -"checksum itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae3088ea4baeceb0284ee9eea42f591226e6beaecf65373e41b38d95a1b8e7a1" "checksum itoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91fd9dc2c587067de817fec4ad355e3818c3d893a78cab32a0a474c7a15bb8d5" "checksum jsonrpc-core 5.1.0 (git+https://github.com/ethcore/jsonrpc.git)" = "" "checksum jsonrpc-http-server 7.0.0 (git+https://github.com/ethcore/jsonrpc.git)" = "" @@ -2684,12 +2598,10 @@ dependencies = [ "checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" "checksum semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae2ff60ecdb19c255841c066cbfa5f8c2a4ada1eb3ae47c77ab6667128da71f5" "checksum semver-parser 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e88e43a5a74dd2a11707f9c21dfd4a423c66bd871df813227bb0a3e78f3a1ae9" -"checksum serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)" = "58a19c0871c298847e6b68318484685cd51fa5478c0c905095647540031356e5" -"checksum serde 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4d8f810025e9d09c4eaa49c16eaf878f34a947889e878cd7d3b5bef3197cc119" -"checksum serde_codegen 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ce29a6ae259579707650ec292199b5fed2c0b8e2a4bdc994452d24d1bcf2242a" -"checksum serde_codegen_internals 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "59933a62554548c690d2673c5164f0c4a46be7c5731edfd94b0ecb1048940732" -"checksum serde_json 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7d3c184d35801fb8b32b46a7d58d57dbcc150b0eb2b46a1eb79645e8ecfd5b" -"checksum serde_json 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fea48f4d4df4e620e3c81fd2bf28c93dd0d266361a76bac4f254b71f0e13f3cd" +"checksum serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0ae9a3c8b07c09dbe43022486d55a18c629a0618d2241e49829aaef9b6d862f9" +"checksum serde_codegen_internals 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3172bf2940b975c0e4f6ab42a511c0a4407d4f46ccef87a9d3615db5c26fa96" +"checksum serde_derive 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ecc6e0379ca933ece58302d2d3034443f06fbf38fd535857c1dc516195cbc3bf" +"checksum serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cf37ce931677e98b4fa5e6469aaa3ab4b6228309ea33b1b22d3ec055adfc4515" "checksum serde_urlencoded 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a81f15da4b9780e1524697f73b09076b6e42298ef673bead9ca8f848b334ef84" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72f20b8f3c060374edb8046591ba28f62448c369ccbdc7b02075103fb3a9e38d" @@ -2705,18 +2617,13 @@ dependencies = [ "checksum spmc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "93bdab61c1a413e591c4d17388ffa859eaff2df27f1e13a5ec8b716700605adf" "checksum stable-heap 0.1.0 (git+https://github.com/carllerche/stable-heap?rev=3c5cd1ca47)" = "" "checksum strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4d73a2c36a4d095ed1a6df5cbeac159863173447f7a82b3f4757426844ab825" -"checksum syn 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94e7d81ecd16d39f16193af05b8d5a0111b9d8d2f3f78f31760f327a247da777" +"checksum syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f94368aae82bb29656c98443a7026ca931a659e8d19dcdc41d6e273054e820" "checksum syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393b6dd0889df2b064beeea954cfda6bc2571604ac460deeae0fed55a53988af" -"checksum syntex 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd253b0d7d787723a33384d426f0ebec7f8edccfaeb2022d0177162bb134da0" -"checksum syntex_errors 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "84822a1178204a191239ad844599f8c85c128cf9f4173397def4eb46b55b0aa1" -"checksum syntex_pos 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a43abded5057c75bac8555e46ec913ce502efb418267b1ab8e9783897470c7db" "checksum syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44bded3cabafc65c90b663b1071bd2d198a9ab7515e6ce729e4570aaf53c407e" -"checksum syntex_syntax 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ef781e4b60f03431f1b5b59843546ce60ae029a787770cf8e0969ac1fd063a5" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" "checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "f2077e54d38055cf1ca0fd7933a2e00cd3ec8f6fed352b2a377f06dcdaaf3281" -"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" "checksum termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d9cf598a6d7ce700a4e6a9199da127e6819a61e64b68609683cc9a01b5683a" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread_local 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0694f51610ef7cfac7a1b81de7f1602ee5356e76541bcd62c40e71933338cab1" @@ -2734,6 +2641,7 @@ dependencies = [ "checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f" "checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172" "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afe9ec54bc4db14bc8744b7fed060d785ac756791450959b2248443319d5b119" "checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" diff --git a/Cargo.toml b/Cargo.toml index 344e0b1a0..f304c917b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,12 +4,6 @@ name = "parity" version = "1.6.0" license = "GPL-3.0" authors = ["Parity Technologies "] -build = "build.rs" - -[build-dependencies] -rustc_version = "0.1" -ethcore-ipc-codegen = { path = "ipc/codegen" } -ethcore-ipc-tests = { path = "ipc/tests" } [dependencies] log = "0.3" @@ -26,8 +20,8 @@ lazy_static = "0.2" regex = "0.1" isatty = "0.1" toml = "0.2" -serde = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_json = "0.9" app_dirs = "1.1.1" fdlimit = "0.1" hyper = { version = "0.9", default-features = false } @@ -55,6 +49,9 @@ parity-reactor = { path = "util/reactor" } ethcore-dapps = { path = "dapps", optional = true } clippy = { version = "0.0.103", optional = true} +[dev-dependencies] +ethcore-ipc-tests = { path = "ipc/tests" } + [target.'cfg(windows)'.dependencies] winapi = "0.2" diff --git a/build.rs b/build.rs deleted file mode 100644 index 6a89bd269..000000000 --- a/build.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -extern crate rustc_version; - -use rustc_version::{version_meta, Channel}; - -fn main() { - if let Channel::Nightly = version_meta().channel { - println!("cargo:rustc-cfg=nightly"); - } -} diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index 459a5ea70..2c99dde4f 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -4,7 +4,6 @@ name = "ethcore-dapps" version = "1.6.0" license = "GPL-3.0" authors = ["Parity Technologies "] -build = "build.rs" [lib] @@ -19,15 +18,15 @@ hyper = { default-features = false, git = "https://github.com/ethcore/hyper" } unicase = "1.3" url = "1.0" rustc-serialize = "0.3" -serde = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_json = "0.9" +serde_derive = "0.9" linked-hash-map = "0.3" parity-dapps-glue = "1.4" base32 = "0.3" mime = "0.2" mime_guess = "1.6.1" time = "0.1.35" -serde_macros = { version = "0.8", optional = true } zip = { version = "0.1", default-features = false } ethcore-devtools = { path = "../devtools" } ethcore-rpc = { path = "../rpc" } @@ -39,12 +38,7 @@ parity-reactor = { path = "../util/reactor" } clippy = { version = "0.0.103", optional = true} -[build-dependencies] -serde_codegen = { version = "0.8", optional = true } - [features] -default = ["serde_codegen"] -nightly = ["serde_macros"] dev = ["clippy", "ethcore-rpc/dev", "ethcore-util/dev"] ui = ["parity-ui/no-precompiled-js"] diff --git a/dapps/build.rs b/dapps/build.rs deleted file mode 100644 index 469e7c37b..000000000 --- a/dapps/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -#[cfg(not(feature = "serde_macros"))] -mod inner { - extern crate serde_codegen; - - use std::env; - use std::path::Path; - - pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - let src = Path::new("./src/api/types.rs.in"); - let dst = Path::new(&out_dir).join("types.rs"); - - serde_codegen::expand(&src, &dst).unwrap(); - } -} - -#[cfg(feature = "serde_macros")] -mod inner { - pub fn main() {} -} - -fn main() { - inner::main(); -} diff --git a/dapps/src/api/mod.rs b/dapps/src/api/mod.rs index 1a6ac2e17..f04b18878 100644 --- a/dapps/src/api/mod.rs +++ b/dapps/src/api/mod.rs @@ -16,9 +16,6 @@ //! REST API -#![cfg_attr(feature="nightly", feature(custom_derive, custom_attribute, plugin))] -#![cfg_attr(feature="nightly", plugin(serde_macros, clippy))] - mod api; mod response; mod types; diff --git a/dapps/src/api/types.rs b/dapps/src/api/types.rs index 428499cbb..a690a0b2b 100644 --- a/dapps/src/api/types.rs +++ b/dapps/src/api/types.rs @@ -14,8 +14,51 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -#[cfg(feature = "serde_macros")] -include!("types.rs.in"); +use endpoint::EndpointInfo; + +#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct App { + pub id: String, + pub name: String, + pub description: String, + pub version: String, + pub author: String, + #[serde(rename="iconUrl")] + pub icon_url: String, +} + +impl App { + /// Creates `App` instance from `EndpointInfo` and `id`. + pub fn from_info(id: &str, info: &EndpointInfo) -> Self { + App { + id: id.to_owned(), + name: info.name.to_owned(), + description: info.description.to_owned(), + version: info.version.to_owned(), + author: info.author.to_owned(), + icon_url: info.icon_url.to_owned(), + } + } +} + +impl Into for App { + fn into(self) -> EndpointInfo { + EndpointInfo { + name: self.name, + description: self.description, + version: self.version, + author: self.author, + icon_url: self.icon_url, + } + } +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct ApiError { + pub code: String, + pub title: String, + pub detail: String, +} -#[cfg(not(feature = "serde_macros"))] -include!(concat!(env!("OUT_DIR"), "/types.rs")); diff --git a/dapps/src/api/types.rs.in b/dapps/src/api/types.rs.in deleted file mode 100644 index a690a0b2b..000000000 --- a/dapps/src/api/types.rs.in +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -use endpoint::EndpointInfo; - -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] -#[serde(deny_unknown_fields)] -pub struct App { - pub id: String, - pub name: String, - pub description: String, - pub version: String, - pub author: String, - #[serde(rename="iconUrl")] - pub icon_url: String, -} - -impl App { - /// Creates `App` instance from `EndpointInfo` and `id`. - pub fn from_info(id: &str, info: &EndpointInfo) -> Self { - App { - id: id.to_owned(), - name: info.name.to_owned(), - description: info.description.to_owned(), - version: info.version.to_owned(), - author: info.author.to_owned(), - icon_url: info.icon_url.to_owned(), - } - } -} - -impl Into for App { - fn into(self) -> EndpointInfo { - EndpointInfo { - name: self.name, - description: self.description, - version: self.version, - author: self.author, - icon_url: self.icon_url, - } - } -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(deny_unknown_fields)] -pub struct ApiError { - pub code: String, - pub title: String, - pub detail: String, -} - diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index cd4479525..bda5b305c 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -15,8 +15,8 @@ // along with Parity. If not, see . //! Ethcore Webapplications for Parity -//! #![warn(missing_docs)] +#![cfg_attr(feature="nightly", feature(plugin))] #![cfg_attr(feature="nightly", plugin(clippy))] extern crate base32; @@ -45,6 +45,8 @@ extern crate parity_reactor; extern crate log; #[macro_use] extern crate mime; +#[macro_use] +extern crate serde_derive; #[cfg(test)] extern crate ethcore_devtools as devtools; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 1f4d7ea96..442f8b785 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -14,7 +14,6 @@ build = "build.rs" log = "0.3" env_logger = "0.3" rustc-serialize = "0.3" -heapsize = "0.3" rust-crypto = "0.2.34" num_cpus = "0.2" crossbeam = "0.2.9" @@ -27,6 +26,8 @@ rand = "0.3" byteorder = "1.0" transient-hashmap = "0.1" linked-hash-map = "0.3.0" +lru-cache = "0.1.0" +ethabi = "1.0.0" evmjit = { path = "../evmjit", optional = true } clippy = { version = "0.0.103", optional = true} ethash = { path = "../ethash" } @@ -40,10 +41,8 @@ ethkey = { path = "../ethkey" } ethcore-ipc-nano = { path = "../ipc/nano" } rlp = { path = "../util/rlp" } ethcore-stratum = { path = "../stratum" } -lru-cache = "0.1.0" ethcore-bloom-journal = { path = "../util/bloom" } hardware-wallet = { path = "../hw" } -ethabi = "0.2.2" [dependencies.hyper] git = "https://github.com/ethcore/hyper" diff --git a/ethcore/src/blockchain/blockchain.rs b/ethcore/src/blockchain/blockchain.rs index 776c9e752..c4031f954 100644 --- a/ethcore/src/blockchain/blockchain.rs +++ b/ethcore/src/blockchain/blockchain.rs @@ -1337,6 +1337,7 @@ mod tests { use transaction::{Transaction, Action}; use log_entry::{LogEntry, LocalizedLogEntry}; use ethkey::Secret; + use header::BlockNumber; fn new_db(path: &str) -> Arc { Arc::new(Database::open(&DatabaseConfig::with_columns(::db::NUM_COLUMNS), path).unwrap()) @@ -2020,14 +2021,14 @@ mod tests { let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5); let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5); - assert_eq!(blocks_b1, vec![]); - assert_eq!(blocks_b2, vec![]); + assert_eq!(blocks_b1, Vec::::new()); + assert_eq!(blocks_b2, Vec::::new()); insert_block(&db, &bc, &b1, vec![]); let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5); let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5); assert_eq!(blocks_b1, vec![1]); - assert_eq!(blocks_b2, vec![]); + assert_eq!(blocks_b2, Vec::::new()); insert_block(&db, &bc, &b2, vec![]); let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5); @@ -2042,15 +2043,15 @@ mod tests { let blocks_ba = bc.blocks_with_bloom(&bloom_ba, 0, 5); assert_eq!(blocks_b1, vec![1]); assert_eq!(blocks_b2, vec![2]); - assert_eq!(blocks_ba, vec![]); + assert_eq!(blocks_ba, Vec::::new()); // fork has happend insert_block(&db, &bc, &b2a, vec![]); let blocks_b1 = bc.blocks_with_bloom(&bloom_b1, 0, 5); let blocks_b2 = bc.blocks_with_bloom(&bloom_b2, 0, 5); let blocks_ba = bc.blocks_with_bloom(&bloom_ba, 0, 5); - assert_eq!(blocks_b1, vec![]); - assert_eq!(blocks_b2, vec![]); + assert_eq!(blocks_b1, Vec::::new()); + assert_eq!(blocks_b2, Vec::::new()); assert_eq!(blocks_ba, vec![1, 2]); // fork back diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index c23defe89..be5247340 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -114,8 +114,6 @@ extern crate ethcore_util as util; #[macro_use] extern crate lazy_static; #[macro_use] -extern crate heapsize; -#[macro_use] extern crate ethcore_ipc as ipc; #[cfg(feature = "jit" )] diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index a8e4be719..2b8609a74 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -2,16 +2,15 @@ name = "ethstore" version = "0.1.0" authors = ["Parity Technologies "] -build = "build.rs" [dependencies] log = "0.3" libc = "0.2.11" rand = "0.3.14" ethkey = { path = "../ethkey" } -serde = "0.8" -serde_json = "0.8" -serde_macros = { version = "0.8", optional = true } +serde = "0.9" +serde_json = "0.9" +serde_derive = "0.9" rustc-serialize = "0.3" rust-crypto = "0.2.36" tiny-keccak = "1.0" @@ -25,14 +24,12 @@ ethcore-util = { path = "../util" } smallvec = "0.3.1" ethcore-devtools = { path = "../devtools" } -[build-dependencies] -serde_codegen = { version = "0.8", optional = true } - [features] -default = ["serde_codegen"] -nightly = ["serde_macros"] cli = ["docopt"] +[lib] + [[bin]] name = "ethstore" +path = "src/bin/main.rs" doc = false diff --git a/ethstore/build.rs b/ethstore/build.rs deleted file mode 100644 index 7ac74533c..000000000 --- a/ethstore/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -#[cfg(not(feature = "serde_macros"))] -mod inner { - extern crate serde_codegen; - - use std::env; - use std::path::Path; - - pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - let src = Path::new("src/json/mod.rs.in"); - let dst = Path::new(&out_dir).join("mod.rs"); - - serde_codegen::expand(&src, &dst).unwrap(); - } -} - -#[cfg(feature = "serde_macros")] -mod inner { - pub fn main() {} -} - -fn main() { - inner::main(); -} diff --git a/ethstore/src/json/bytes.rs b/ethstore/src/json/bytes.rs index 5745c2cea..c7ecfec4c 100644 --- a/ethstore/src/json/bytes.rs +++ b/ethstore/src/json/bytes.rs @@ -1,5 +1,22 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + use std::{ops, str}; -use serde::{Deserialize, Deserializer, Error, Serialize, Serializer}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::Error; use rustc_serialize::hex::{ToHex, FromHex, FromHexError}; #[derive(Debug, PartialEq)] @@ -14,7 +31,7 @@ impl ops::Deref for Bytes { } impl Deserialize for Bytes { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { let s = String::deserialize(deserializer)?; @@ -24,7 +41,7 @@ impl Deserialize for Bytes { } impl Serialize for Bytes { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { serializer.serialize_str(&self.0.to_hex()) } diff --git a/ethstore/src/json/cipher.rs b/ethstore/src/json/cipher.rs index ba0037e60..3505a3e81 100644 --- a/ethstore/src/json/cipher.rs +++ b/ethstore/src/json/cipher.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Serialize, Serializer, Deserialize, Deserializer, Error as SerdeError}; -use serde::de::Visitor; +use std::fmt; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Visitor, Error as SerdeError}; use super::{Error, H128}; #[derive(Debug, PartialEq)] @@ -24,7 +25,7 @@ pub enum CipherSer { } impl Serialize for CipherSer { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { CipherSer::Aes128Ctr => serializer.serialize_str("aes-128-ctr"), @@ -33,7 +34,7 @@ impl Serialize for CipherSer { } impl Deserialize for CipherSer { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(CipherSerVisitor) } @@ -44,14 +45,18 @@ struct CipherSerVisitor; impl Visitor for CipherSerVisitor { type Value = CipherSer; - fn visit_str(&mut self, value: &str) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid cipher identifier") + } + + fn visit_str(self, value: &str) -> Result where E: SerdeError { match value { "aes-128-ctr" => Ok(CipherSer::Aes128Ctr), _ => Err(SerdeError::custom(Error::UnsupportedCipher)) } } - fn visit_string(&mut self, value: String) -> Result where E: SerdeError { + fn visit_string(self, value: String) -> Result where E: SerdeError { self.visit_str(value.as_ref()) } } @@ -67,7 +72,7 @@ pub enum CipherSerParams { } impl Serialize for CipherSerParams { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { CipherSerParams::Aes128Ctr(ref params) => params.serialize(serializer), @@ -76,7 +81,7 @@ impl Serialize for CipherSerParams { } impl Deserialize for CipherSerParams { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { Aes128Ctr::deserialize(deserializer) .map(CipherSerParams::Aes128Ctr) diff --git a/ethstore/src/json/crypto.rs b/ethstore/src/json/crypto.rs index a7f710c50..63d73845f 100644 --- a/ethstore/src/json/crypto.rs +++ b/ethstore/src/json/crypto.rs @@ -14,8 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Deserialize, Deserializer, Serialize, Serializer, Error}; -use serde::de::{Visitor, MapVisitor}; +use std::fmt; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::ser::SerializeStruct; +use serde::de::{Visitor, MapVisitor, Error}; use super::{Cipher, CipherSer, CipherSerParams, Kdf, KdfSer, KdfSerParams, H256, Bytes}; pub type CipherText = Bytes; @@ -38,7 +40,7 @@ enum CryptoField { } impl Deserialize for CryptoField { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(CryptoFieldVisitor) @@ -50,7 +52,11 @@ struct CryptoFieldVisitor; impl Visitor for CryptoFieldVisitor { type Value = CryptoField; - fn visit_str(&mut self, value: &str) -> Result + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid crypto struct description") + } + + fn visit_str(self, value: &str) -> Result where E: Error { match value { @@ -66,7 +72,7 @@ impl Visitor for CryptoFieldVisitor { } impl Deserialize for Crypto { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; @@ -79,7 +85,11 @@ struct CryptoVisitor; impl Visitor for CryptoVisitor { type Value = Crypto; - fn visit_map(&mut self, mut visitor: V) -> Result + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid vault crypto object") + } + + fn visit_map(self, mut visitor: V) -> Result where V: MapVisitor { let mut cipher = None; @@ -103,30 +113,28 @@ impl Visitor for CryptoVisitor { let cipher = match (cipher, cipherparams) { (Some(CipherSer::Aes128Ctr), Some(CipherSerParams::Aes128Ctr(params))) => Cipher::Aes128Ctr(params), - (None, _) => return Err(Error::missing_field("cipher")), - (Some(_), None) => return Err(Error::missing_field("cipherparams")), + (None, _) => return Err(V::Error::missing_field("cipher")), + (Some(_), None) => return Err(V::Error::missing_field("cipherparams")), }; let ciphertext = match ciphertext { Some(ciphertext) => ciphertext, - None => visitor.missing_field("ciphertext")?, + None => return Err(V::Error::missing_field("ciphertext")), }; let kdf = match (kdf, kdfparams) { (Some(KdfSer::Pbkdf2), Some(KdfSerParams::Pbkdf2(params))) => Kdf::Pbkdf2(params), (Some(KdfSer::Scrypt), Some(KdfSerParams::Scrypt(params))) => Kdf::Scrypt(params), - (Some(_), Some(_)) => return Err(Error::custom("Invalid cipherparams")), - (None, _) => return Err(Error::missing_field("kdf")), - (Some(_), None) => return Err(Error::missing_field("kdfparams")), + (Some(_), Some(_)) => return Err(V::Error::custom("Invalid cipherparams")), + (None, _) => return Err(V::Error::missing_field("kdf")), + (Some(_), None) => return Err(V::Error::missing_field("kdfparams")), }; let mac = match mac { Some(mac) => mac, - None => visitor.missing_field("mac")?, + None => return Err(V::Error::missing_field("mac")), }; - visitor.end()?; - let result = Crypto { cipher: cipher, ciphertext: ciphertext, @@ -139,29 +147,29 @@ impl Visitor for CryptoVisitor { } impl Serialize for Crypto { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { - let mut state = serializer.serialize_struct("Crypto", 6)?; + let mut crypto = serializer.serialize_struct("Crypto", 6)?; match self.cipher { Cipher::Aes128Ctr(ref params) => { - serializer.serialize_struct_elt(&mut state, "cipher", &CipherSer::Aes128Ctr)?; - serializer.serialize_struct_elt(&mut state, "cipherparams", params)?; + crypto.serialize_field("cipher", &CipherSer::Aes128Ctr)?; + crypto.serialize_field("cipherparams", params)?; }, } - serializer.serialize_struct_elt(&mut state, "ciphertext", &self.ciphertext)?; + crypto.serialize_field("ciphertext", &self.ciphertext)?; match self.kdf { Kdf::Pbkdf2(ref params) => { - serializer.serialize_struct_elt(&mut state, "kdf", &KdfSer::Pbkdf2)?; - serializer.serialize_struct_elt(&mut state, "kdfparams", params)?; + crypto.serialize_field("kdf", &KdfSer::Pbkdf2)?; + crypto.serialize_field("kdfparams", params)?; }, Kdf::Scrypt(ref params) => { - serializer.serialize_struct_elt(&mut state, "kdf", &KdfSer::Scrypt)?; - serializer.serialize_struct_elt(&mut state, "kdfparams", params)?; + crypto.serialize_field("kdf", &KdfSer::Scrypt)?; + crypto.serialize_field("kdfparams", params)?; }, } - serializer.serialize_struct_elt(&mut state, "mac", &self.mac)?; - serializer.serialize_struct_end(state) + crypto.serialize_field("mac", &self.mac)?; + crypto.end() } } diff --git a/ethstore/src/json/hash.rs b/ethstore/src/json/hash.rs index 30fff6ad4..328f155c2 100644 --- a/ethstore/src/json/hash.rs +++ b/ethstore/src/json/hash.rs @@ -16,8 +16,8 @@ use std::{ops, fmt, str}; use rustc_serialize::hex::{FromHex, ToHex}; -use serde::{Serialize, Serializer, Deserialize, Deserializer, Error as SerdeError}; -use serde::de::Visitor; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Visitor, Error as SerdeError}; use super::Error; macro_rules! impl_hash { @@ -48,25 +48,29 @@ macro_rules! impl_hash { } impl Serialize for $name { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { serializer.serialize_str(&self.0.to_hex()) } } impl Deserialize for $name { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { struct HashVisitor; impl Visitor for HashVisitor { type Value = $name; - fn visit_str(&mut self, value: &str) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a hex-encoded {}", stringify!($name)) + } + + fn visit_str(self, value: &str) -> Result where E: SerdeError { value.parse().map_err(SerdeError::custom) } - fn visit_string(&mut self, value: String) -> Result where E: SerdeError { + fn visit_string(self, value: String) -> Result where E: SerdeError { self.visit_str(value.as_ref()) } } @@ -92,7 +96,7 @@ macro_rules! impl_hash { impl From<&'static str> for $name { fn from(s: &'static str) -> Self { - s.parse().expect(&format!("invalid string literal for {}: '{}'", stringify!(Self), s)) + s.parse().expect(&format!("invalid string literal for {}: '{}'", stringify!($name), s)) } } diff --git a/ethstore/src/json/id.rs b/ethstore/src/json/id.rs index 742d2cce0..8dfcc3028 100644 --- a/ethstore/src/json/id.rs +++ b/ethstore/src/json/id.rs @@ -17,8 +17,8 @@ //! Universaly unique identifier. use std::{fmt, str}; use rustc_serialize::hex::{ToHex, FromHex}; -use serde::{Deserialize, Serialize, Deserializer, Serializer, Error as SerdeError}; -use serde::de::Visitor; +use serde::{Deserialize, Serialize, Deserializer, Serializer}; +use serde::de::{Visitor, Error as SerdeError}; use super::Error; /// Universaly unique identifier. @@ -101,7 +101,7 @@ impl From<&'static str> for Uuid { } impl Serialize for Uuid { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { let s: String = self.into(); serializer.serialize_str(&s) @@ -109,7 +109,7 @@ impl Serialize for Uuid { } impl Deserialize for Uuid { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(UuidVisitor) } @@ -120,11 +120,15 @@ struct UuidVisitor; impl Visitor for UuidVisitor { type Value = Uuid; - fn visit_str(&mut self, value: &str) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid hex-encoded UUID") + } + + fn visit_str(self, value: &str) -> Result where E: SerdeError { value.parse().map_err(SerdeError::custom) } - fn visit_string(&mut self, value: String) -> Result where E: SerdeError { + fn visit_string(self, value: String) -> Result where E: SerdeError { self.visit_str(value.as_ref()) } } diff --git a/ethstore/src/json/kdf.rs b/ethstore/src/json/kdf.rs index b70b183df..9130fe507 100644 --- a/ethstore/src/json/kdf.rs +++ b/ethstore/src/json/kdf.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Serialize, Serializer, Deserialize, Deserializer, Error as SerdeError}; -use serde::de::Visitor; -use serde_json::{Value, value}; +use std::fmt; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Visitor, Error as SerdeError}; use super::{Error, H256}; #[derive(Debug, PartialEq)] @@ -26,7 +26,7 @@ pub enum KdfSer { } impl Serialize for KdfSer { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { KdfSer::Pbkdf2 => serializer.serialize_str("pbkdf2"), @@ -36,7 +36,7 @@ impl Serialize for KdfSer { } impl Deserialize for KdfSer { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(KdfSerVisitor) } @@ -47,7 +47,11 @@ struct KdfSerVisitor; impl Visitor for KdfSerVisitor { type Value = KdfSer; - fn visit_str(&mut self, value: &str) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a kdf algorithm identifier") + } + + fn visit_str(self, value: &str) -> Result where E: SerdeError { match value { "pbkdf2" => Ok(KdfSer::Pbkdf2), "scrypt" => Ok(KdfSer::Scrypt), @@ -55,7 +59,7 @@ impl Visitor for KdfSerVisitor { } } - fn visit_string(&mut self, value: String) -> Result where E: SerdeError { + fn visit_string(self, value: String) -> Result where E: SerdeError { self.visit_str(value.as_ref()) } } @@ -66,7 +70,7 @@ pub enum Prf { } impl Serialize for Prf { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { Prf::HmacSha256 => serializer.serialize_str("hmac-sha256"), @@ -75,7 +79,7 @@ impl Serialize for Prf { } impl Deserialize for Prf { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(PrfVisitor) } @@ -86,14 +90,18 @@ struct PrfVisitor; impl Visitor for PrfVisitor { type Value = Prf; - fn visit_str(&mut self, value: &str) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a prf algorithm identifier") + } + + fn visit_str(self, value: &str) -> Result where E: SerdeError { match value { "hmac-sha256" => Ok(Prf::HmacSha256), _ => Err(SerdeError::custom(Error::InvalidPrf)), } } - fn visit_string(&mut self, value: String) -> Result where E: SerdeError { + fn visit_string(self, value: String) -> Result where E: SerdeError { self.visit_str(value.as_ref()) } } @@ -122,7 +130,7 @@ pub enum KdfSerParams { } impl Serialize for KdfSerParams { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { KdfSerParams::Pbkdf2(ref params) => params.serialize(serializer), @@ -132,13 +140,15 @@ impl Serialize for KdfSerParams { } impl Deserialize for KdfSerParams { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { - let v = Value::deserialize(deserializer)?; + use serde_json::{Value, from_value}; - Deserialize::deserialize(&mut value::Deserializer::new(v.clone())).map(KdfSerParams::Pbkdf2) - .or_else(|_| Deserialize::deserialize(&mut value::Deserializer::new(v)).map(KdfSerParams::Scrypt)) - .map_err(|e| D::Error::custom(format!("{}", e))) + let v: Value = Deserialize::deserialize(deserializer)?; + + from_value(v.clone()).map(KdfSerParams::Pbkdf2) + .or_else(|_| from_value(v).map(KdfSerParams::Scrypt)) + .map_err(|_| D::Error::custom("Invalid KDF algorithm")) } } diff --git a/ethstore/src/json/key_file.rs b/ethstore/src/json/key_file.rs index ed4225ad7..21711df8f 100644 --- a/ethstore/src/json/key_file.rs +++ b/ethstore/src/json/key_file.rs @@ -14,9 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +use std::fmt; use std::io::{Read, Write}; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::{Visitor, MapVisitor}; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error, Visitor, MapVisitor}; use serde_json; use super::{Uuid, Version, Crypto, H160}; @@ -40,7 +41,7 @@ enum KeyFileField { } impl Deserialize for KeyFileField { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(KeyFileFieldVisitor) @@ -52,7 +53,11 @@ struct KeyFileFieldVisitor; impl Visitor for KeyFileFieldVisitor { type Value = KeyFileField; - fn visit_str(&mut self, value: &str) -> Result + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid key file field") + } + + fn visit_str(self, value: &str) -> Result where E: Error { match value { @@ -69,7 +74,7 @@ impl Visitor for KeyFileFieldVisitor { } impl Deserialize for KeyFile { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; @@ -77,12 +82,27 @@ impl Deserialize for KeyFile { } } -struct KeyFileVisitor; +fn none_if_empty(v: Option) -> Option where + T: Deserialize, +{ + v.and_then(|v| if v.is_null() { + None + } else { + serde_json::from_value(v).ok() + }) + +} + +struct KeyFileVisitor; impl Visitor for KeyFileVisitor { type Value = KeyFile; - fn visit_map(&mut self, mut visitor: V) -> Result + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid key object") + } + + fn visit_map(self, mut visitor: V) -> Result where V: MapVisitor { let mut id = None; @@ -98,34 +118,32 @@ impl Visitor for KeyFileVisitor { Some(KeyFileField::Version) => { version = Some(visitor.visit_value()?); } Some(KeyFileField::Crypto) => { crypto = Some(visitor.visit_value()?); } Some(KeyFileField::Address) => { address = Some(visitor.visit_value()?); } - Some(KeyFileField::Name) => { name = visitor.visit_value().ok(); } // ignore anyhing that is not a string to be permissive. - Some(KeyFileField::Meta) => { meta = visitor.visit_value().ok(); } // ignore anyhing that is not a string to be permissive. + Some(KeyFileField::Name) => { name = none_if_empty(visitor.visit_value().ok()) } + Some(KeyFileField::Meta) => { meta = none_if_empty(visitor.visit_value().ok()) } None => { break; } } } let id = match id { Some(id) => id, - None => visitor.missing_field("id")?, + None => return Err(V::Error::missing_field("id")), }; let version = match version { Some(version) => version, - None => visitor.missing_field("version")?, + None => return Err(V::Error::missing_field("version")), }; let crypto = match crypto { Some(crypto) => crypto, - None => visitor.missing_field("crypto")?, + None => return Err(V::Error::missing_field("crypto")), }; let address = match address { Some(address) => address, - None => visitor.missing_field("address")?, + None => return Err(V::Error::missing_field("address")), }; - visitor.end()?; - let result = KeyFile { id: id, version: version, diff --git a/ethstore/src/json/mod.rs b/ethstore/src/json/mod.rs index d52031c16..98033effd 100644 --- a/ethstore/src/json/mod.rs +++ b/ethstore/src/json/mod.rs @@ -16,9 +16,28 @@ //! Contract interface specification. -#[cfg(feature = "serde_macros")] -include!("mod.rs.in"); - -#[cfg(not(feature = "serde_macros"))] -include!(concat!(env!("OUT_DIR"), "/mod.rs")); +mod bytes; +mod cipher; +mod crypto; +mod error; +mod hash; +mod id; +mod kdf; +mod key_file; +mod presale; +mod vault_file; +mod vault_key_file; +mod version; +pub use self::bytes::Bytes; +pub use self::cipher::{Cipher, CipherSer, CipherSerParams, Aes128Ctr}; +pub use self::crypto::{Crypto, CipherText}; +pub use self::error::Error; +pub use self::hash::{H128, H160, H256}; +pub use self::id::Uuid; +pub use self::kdf::{Kdf, KdfSer, Prf, Pbkdf2, Scrypt, KdfSerParams}; +pub use self::key_file::KeyFile; +pub use self::presale::{PresaleWallet, Encseed}; +pub use self::vault_file::VaultFile; +pub use self::vault_key_file::{VaultKeyFile, VaultKeyMeta, insert_vault_name_to_json_meta, remove_vault_name_from_json_meta}; +pub use self::version::Version; diff --git a/ethstore/src/json/mod.rs.in b/ethstore/src/json/mod.rs.in deleted file mode 100755 index 2cec82877..000000000 --- a/ethstore/src/json/mod.rs.in +++ /dev/null @@ -1,26 +0,0 @@ -mod bytes; -mod cipher; -mod crypto; -mod error; -mod hash; -mod id; -mod kdf; -mod key_file; -mod presale; -mod vault_file; -mod vault_key_file; -mod version; - -pub use self::bytes::Bytes; -pub use self::cipher::{Cipher, CipherSer, CipherSerParams, Aes128Ctr}; -pub use self::crypto::{Crypto, CipherText}; -pub use self::error::Error; -pub use self::hash::{H128, H160, H256}; -pub use self::id::Uuid; -pub use self::kdf::{Kdf, KdfSer, Prf, Pbkdf2, Scrypt, KdfSerParams}; -pub use self::key_file::KeyFile; -pub use self::presale::{PresaleWallet, Encseed}; -pub use self::vault_file::VaultFile; -pub use self::vault_key_file::{VaultKeyFile, VaultKeyMeta, insert_vault_name_to_json_meta, remove_vault_name_from_json_meta}; -pub use self::version::Version; - diff --git a/ethstore/src/json/vault_file.rs b/ethstore/src/json/vault_file.rs index c2d86cd0c..d11e71451 100755 --- a/ethstore/src/json/vault_file.rs +++ b/ethstore/src/json/vault_file.rs @@ -15,13 +15,11 @@ // along with Parity. If not, see . use std::io::{Read, Write}; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::{Visitor, MapVisitor}; use serde_json; use super::Crypto; /// Vault meta file -#[derive(Debug, PartialEq, Serialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct VaultFile { /// Vault password, encrypted with vault password pub crypto: Crypto, @@ -29,79 +27,6 @@ pub struct VaultFile { pub meta: Option, } -enum VaultFileField { - Crypto, - Meta, -} - -impl Deserialize for VaultFileField { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer - { - deserializer.deserialize(VaultFileFieldVisitor) - } -} - -struct VaultFileFieldVisitor; - -impl Visitor for VaultFileFieldVisitor { - type Value = VaultFileField; - - fn visit_str(&mut self, value: &str) -> Result - where E: Error - { - match value { - "crypto" => Ok(VaultFileField::Crypto), - "meta" => Ok(VaultFileField::Meta), - _ => Err(Error::custom(format!("Unknown field: '{}'", value))), - } - } -} - -impl Deserialize for VaultFile { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer - { - static FIELDS: &'static [&'static str] = &["crypto", "meta"]; - deserializer.deserialize_struct("VaultFile", FIELDS, VaultFileVisitor) - } -} - -struct VaultFileVisitor; - -impl Visitor for VaultFileVisitor { - type Value = VaultFile; - - fn visit_map(&mut self, mut visitor: V) -> Result - where V: MapVisitor - { - let mut crypto = None; - let mut meta = None; - - loop { - match visitor.visit_key()? { - Some(VaultFileField::Crypto) => { crypto = Some(visitor.visit_value()?); }, - Some(VaultFileField::Meta) => { meta = visitor.visit_value().ok(); }, // meta is optional - None => { break; }, - } - } - - let crypto = match crypto { - Some(crypto) => crypto, - None => visitor.missing_field("crypto")?, - }; - - visitor.end()?; - - let result = VaultFile { - crypto: crypto, - meta: meta, - }; - - Ok(result) - } -} - impl VaultFile { pub fn load(reader: R) -> Result where R: Read { serde_json::from_reader(reader) diff --git a/ethstore/src/json/vault_key_file.rs b/ethstore/src/json/vault_key_file.rs index 83745bf1b..76c59b380 100755 --- a/ethstore/src/json/vault_key_file.rs +++ b/ethstore/src/json/vault_key_file.rs @@ -15,8 +15,7 @@ // along with Parity. If not, see . use std::io::{Read, Write}; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::{Visitor, MapVisitor}; +use serde::de::Error; use serde_json; use serde_json::value::Value; use serde_json::error; @@ -26,7 +25,7 @@ use super::{Uuid, Version, Crypto, H160}; const VAULT_NAME_META_KEY: &'static str = "vault"; /// Key file as stored in vaults -#[derive(Debug, PartialEq, Serialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct VaultKeyFile { /// Key id pub id: Uuid, @@ -39,7 +38,7 @@ pub struct VaultKeyFile { } /// Data, stored in `VaultKeyFile::metacrypto` -#[derive(Debug, PartialEq, Serialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct VaultKeyMeta { /// Key address pub address: H160, @@ -81,182 +80,6 @@ pub fn remove_vault_name_from_json_meta(meta: &str) -> Result(deserializer: &mut D) -> Result - where D: Deserializer - { - deserializer.deserialize(VaultKeyFileFieldVisitor) - } -} - -struct VaultKeyFileFieldVisitor; - -impl Visitor for VaultKeyFileFieldVisitor { - type Value = VaultKeyFileField; - - fn visit_str(&mut self, value: &str) -> Result - where E: Error - { - match value { - "id" => Ok(VaultKeyFileField::Id), - "version" => Ok(VaultKeyFileField::Version), - "crypto" => Ok(VaultKeyFileField::Crypto), - "metacrypto" => Ok(VaultKeyFileField::MetaCrypto), - _ => Err(Error::custom(format!("Unknown field: '{}'", value))), - } - } -} - -impl Deserialize for VaultKeyFile { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer - { - static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "metacrypto"]; - deserializer.deserialize_struct("VaultKeyFile", FIELDS, VaultKeyFileVisitor) - } -} - -struct VaultKeyFileVisitor; - -impl Visitor for VaultKeyFileVisitor { - type Value = VaultKeyFile; - - fn visit_map(&mut self, mut visitor: V) -> Result - where V: MapVisitor - { - let mut id = None; - let mut version = None; - let mut crypto = None; - let mut metacrypto = None; - - loop { - match visitor.visit_key()? { - Some(VaultKeyFileField::Id) => { id = Some(visitor.visit_value()?); } - Some(VaultKeyFileField::Version) => { version = Some(visitor.visit_value()?); } - Some(VaultKeyFileField::Crypto) => { crypto = Some(visitor.visit_value()?); } - Some(VaultKeyFileField::MetaCrypto) => { metacrypto = Some(visitor.visit_value()?); } - None => { break; } - } - } - - let id = match id { - Some(id) => id, - None => visitor.missing_field("id")?, - }; - - let version = match version { - Some(version) => version, - None => visitor.missing_field("version")?, - }; - - let crypto = match crypto { - Some(crypto) => crypto, - None => visitor.missing_field("crypto")?, - }; - - let metacrypto = match metacrypto { - Some(metacrypto) => metacrypto, - None => visitor.missing_field("metacrypto")?, - }; - - visitor.end()?; - - let result = VaultKeyFile { - id: id, - version: version, - crypto: crypto, - metacrypto: metacrypto, - }; - - Ok(result) - } -} - -impl Deserialize for VaultKeyMetaField { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer - { - deserializer.deserialize(VaultKeyMetaFieldVisitor) - } -} - -struct VaultKeyMetaFieldVisitor; - -impl Visitor for VaultKeyMetaFieldVisitor { - type Value = VaultKeyMetaField; - - fn visit_str(&mut self, value: &str) -> Result - where E: Error - { - match value { - "address" => Ok(VaultKeyMetaField::Address), - "name" => Ok(VaultKeyMetaField::Name), - "meta" => Ok(VaultKeyMetaField::Meta), - _ => Err(Error::custom(format!("Unknown field: '{}'", value))), - } - } -} - -impl Deserialize for VaultKeyMeta { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer - { - static FIELDS: &'static [&'static str] = &["address", "name", "meta"]; - deserializer.deserialize_struct("VaultKeyMeta", FIELDS, VaultKeyMetaVisitor) - } -} - -struct VaultKeyMetaVisitor; - -impl Visitor for VaultKeyMetaVisitor { - type Value = VaultKeyMeta; - - fn visit_map(&mut self, mut visitor: V) -> Result - where V: MapVisitor - { - let mut address = None; - let mut name = None; - let mut meta = None; - - loop { - match visitor.visit_key()? { - Some(VaultKeyMetaField::Address) => { address = Some(visitor.visit_value()?); } - Some(VaultKeyMetaField::Name) => { name = Some(visitor.visit_value()?); } - Some(VaultKeyMetaField::Meta) => { meta = Some(visitor.visit_value()?); } - None => { break; } - } - } - - let address = match address { - Some(address) => address, - None => visitor.missing_field("address")?, - }; - - visitor.end()?; - - let result = VaultKeyMeta { - address: address, - name: name, - meta: meta, - }; - - Ok(result) - } -} - impl VaultKeyFile { pub fn load(reader: R) -> Result where R: Read { serde_json::from_reader(reader) diff --git a/ethstore/src/json/version.rs b/ethstore/src/json/version.rs index 67eccc1c8..68f0834a9 100644 --- a/ethstore/src/json/version.rs +++ b/ethstore/src/json/version.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Serialize, Serializer, Deserialize, Deserializer, Error as SerdeError}; -use serde::de::Visitor; +use std::fmt; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Error as SerdeError, Visitor}; use super::Error; #[derive(Debug, PartialEq)] @@ -24,7 +25,7 @@ pub enum Version { } impl Serialize for Version { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { Version::V3 => serializer.serialize_u64(3) @@ -33,7 +34,7 @@ impl Serialize for Version { } impl Deserialize for Version { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(VersionVisitor) } @@ -44,7 +45,11 @@ struct VersionVisitor; impl Visitor for VersionVisitor { type Value = Version; - fn visit_u64(&mut self, value: u64) -> Result where E: SerdeError { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid key version identifier") + } + + fn visit_u64(self, value: u64) -> Result where E: SerdeError { match value { 3 => Ok(Version::V3), _ => Err(SerdeError::custom(Error::UnsupportedVersion)) diff --git a/ethstore/src/lib.rs b/ethstore/src/lib.rs index 33327a01d..51ac0afba 100755 --- a/ethstore/src/lib.rs +++ b/ethstore/src/lib.rs @@ -14,9 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -#![cfg_attr(feature="nightly", feature(custom_derive, plugin))] -#![cfg_attr(feature="nightly", plugin(serde_macros))] - extern crate libc; extern crate itertools; extern crate smallvec; @@ -37,9 +34,10 @@ extern crate ethcore_util as util; #[macro_use] extern crate log; - #[macro_use] extern crate lazy_static; +#[macro_use] +extern crate serde_derive; pub mod dir; pub mod ethkey; diff --git a/evmbin/Cargo.lock b/evmbin/Cargo.lock deleted file mode 100644 index fde83d1bf..000000000 --- a/evmbin/Cargo.lock +++ /dev/null @@ -1,1268 +0,0 @@ -[root] -name = "evm" -version = "0.1.0" -dependencies = [ - "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore 1.4.0", - "ethcore-util 1.4.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "aho-corasick" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ansi_term" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "arrayvec" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nodrop 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "odds 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "aster" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bit-set" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bit-vec" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bloomchain" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "byteorder" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bytes" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cfg-if" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cookie" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "deque" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "docopt" -version = "0.6.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.77 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "dtoa" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "elastic-array" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "env_logger" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.77 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "eth-secp256k1" -version = "0.5.6" -source = "git+https://github.com/ethcore/rust-secp256k1#f998f9a8c18227af200f0f7fdadf8a6560d391ff" -dependencies = [ - "arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethash" -version = "1.4.0" -dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "sha3 0.1.0", -] - -[[package]] -name = "ethcore" -version = "1.4.0" -dependencies = [ - "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ethash 1.4.0", - "ethcore-bloom-journal 0.1.0", - "ethcore-devtools 1.4.0", - "ethcore-io 1.4.0", - "ethcore-ipc 1.4.0", - "ethcore-ipc-codegen 1.4.0", - "ethcore-ipc-nano 1.4.0", - "ethcore-util 1.4.0", - "ethjson 0.1.0", - "ethkey 0.2.0", - "ethstore 0.1.0", - "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.4 (git+https://github.com/ethcore/hyper)", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lru-cache 0.1.0 (git+https://github.com/contain-rs/lru-cache)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.1.0", - "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-bigint" -version = "0.1.1" -dependencies = [ - "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-bloom-journal" -version = "0.1.0" -dependencies = [ - "siphasher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-devtools" -version = "1.4.0" -dependencies = [ - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-io" -version = "1.4.0" -dependencies = [ - "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.5.1 (git+https://github.com/ethcore/mio?branch=v0.5.x)", - "parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-ipc" -version = "1.4.0" -dependencies = [ - "ethcore-devtools 1.4.0", - "ethcore-util 1.4.0", - "nanomsg 0.7.0 (git+https://github.com/ethcore/nanomsg.rs.git)", - "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-ipc-codegen" -version = "1.4.0" -dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi_codegen 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcore-ipc-nano" -version = "1.4.0" -dependencies = [ - "ethcore-ipc 1.4.0", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "nanomsg 0.7.0 (git+https://github.com/ethcore/nanomsg.rs.git)", -] - -[[package]] -name = "ethcore-util" -version = "1.4.0" -dependencies = [ - "ansi_term 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "eth-secp256k1 0.5.6 (git+https://github.com/ethcore/rust-secp256k1)", - "ethcore-bigint 0.1.1", - "ethcore-bloom-journal 0.1.0", - "ethcore-devtools 1.4.0", - "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.77 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.1.0", - "rocksdb 0.4.5 (git+https://github.com/ethcore/rust-rocksdb)", - "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "sha3 0.1.0", - "table 0.1.0", - "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "using_queue 0.1.0", - "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethcrypto" -version = "0.1.0" -dependencies = [ - "eth-secp256k1 0.5.6 (git+https://github.com/ethcore/rust-secp256k1)", - "ethcore-bigint 0.1.1", - "ethkey 0.2.0", - "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethjson" -version = "0.1.0" -dependencies = [ - "ethcore-util 1.4.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethkey" -version = "0.2.0" -dependencies = [ - "eth-secp256k1 0.5.6 (git+https://github.com/ethcore/rust-secp256k1)", - "ethcore-bigint 0.1.1", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethstore" -version = "0.1.0" -dependencies = [ - "ethcrypto 0.1.0", - "ethkey 0.2.0", - "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gcc" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rayon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hamming" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "heapsize" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "httparse" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hyper" -version = "0.9.4" -source = "git+https://github.com/ethcore/hyper#9e346c1d4bc30cd4142dea9d8a0b117d30858ca4" -dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rotor 0.6.3 (git+https://github.com/ethcore/rotor)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "spmc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vecio 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "idna" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itertools" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "itoa" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "linked-hash-map" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lru-cache" -version = "0.1.0" -source = "git+https://github.com/contain-rs/lru-cache#3259e3a7200510af55b049f99db407d0c87ed253" -dependencies = [ - "linked-hash-map 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "matches" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memchr" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mime" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mio" -version = "0.5.1" -source = "git+https://github.com/ethcore/mio?branch=v0.5.x#3842d3b250ffd7bd9b16f9586b875ddcbac2b0dd" -dependencies = [ - "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "miow" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nanomsg" -version = "0.7.0" -source = "git+https://github.com/ethcore/nanomsg.rs.git#e93f14e5014ee6e67f4a39a2d7889b020acec4ea" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "nanomsg-sys 0.7.0 (git+https://github.com/ethcore/nanomsg.rs.git)", -] - -[[package]] -name = "nanomsg-sys" -version = "0.7.0" -source = "git+https://github.com/ethcore/nanomsg.rs.git#e93f14e5014ee6e67f4a39a2d7889b020acec4ea" -dependencies = [ - "gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "net2" -version = "0.2.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nix" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nodrop" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "odds 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nom" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-bigint" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-complex" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-integer" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-rational" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num_cpus" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "odds" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "owning_ref" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "parking_lot" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "primal" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "primal-check 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "primal-sieve 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "primal-bit" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "primal-check" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "primal-estimate" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "primal-sieve" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "primal-bit 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quasi" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quasi_codegen" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quick-error" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "quote" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rand" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex" -version = "0.1.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-syntax" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rlp" -version = "0.1.0" -dependencies = [ - "elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.1.1", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rocksdb" -version = "0.4.5" -source = "git+https://github.com/ethcore/rust-rocksdb#64c63ccbe1f62c2e2b39262486f9ba813793af58" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "rocksdb-sys 0.3.0 (git+https://github.com/ethcore/rust-rocksdb)", -] - -[[package]] -name = "rocksdb-sys" -version = "0.3.0" -source = "git+https://github.com/ethcore/rust-rocksdb#64c63ccbe1f62c2e2b39262486f9ba813793af58" -dependencies = [ - "gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rotor" -version = "0.6.3" -source = "git+https://github.com/ethcore/rotor#e63d45137b2eb66d1e085a7c6321a5db8b187576" -dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.5.1 (git+https://github.com/ethcore/mio?branch=v0.5.x)", - "quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rust-crypto" -version = "0.2.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-serialize" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_codegen" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_codegen_internals" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syn 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_json" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sha3" -version = "0.1.0" -dependencies = [ - "gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "siphasher" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "slab" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "slab" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "smallvec" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "spmc" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "strsim" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "syn" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.3 (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 = "syntex" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syntex" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syntex_errors 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syntex_errors" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (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 = "syntex_pos" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syntex_syntax" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (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 = "syntex_syntax" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_errors 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (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 = "table" -version = "0.1.0" - -[[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.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "term" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread-id" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread_local" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tiny-keccak" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "traitobject" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicase" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-bidi" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -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 = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "using_queue" -version = "0.1.0" - -[[package]] -name = "utf8-ranges" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "vecio" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "vergen" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" -"checksum ansi_term 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "30275ad0ad84ec1c06dde3b3f7d23c6006b7d76d61a85e7060b426b747eff70d" -"checksum arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d89f1b0e242270b5b797778af0c8d182a1a2ccac5d8d6fadf414223cc0fab096" -"checksum aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07d344974f0a155f091948aa389fb1b912d3a58414fbdb9c8d446d193ee3496a" -"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" -"checksum bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5b97c2c8e8bbb4251754f559df8af22fb264853c7d009084a576cdf12565089d" -"checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3" -"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" -"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f421095d2a76fc24cd3fb3f912b90df06be7689912b1bdb423caefae59c258d" -"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -"checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27" -"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" -"checksum cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0e3d6405328b6edb412158b3b7710e2634e23f3614b9bb1c412df7952489a626" -"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97" -"checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" -"checksum docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)" = "4a7ef30445607f6fc8720f0a0a2c7442284b629cf0d049286860fae23e71c4d9" -"checksum dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd841b58510c9618291ffa448da2e4e0f699d984d436122372f446dae62263d" -"checksum elastic-array 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4bc9250a632e7c001b741eb0ec6cee93c9a5b6d5f1879696a4b94d62b012210a" -"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" -"checksum eth-secp256k1 0.5.6 (git+https://github.com/ethcore/rust-secp256k1)" = "" -"checksum gcc 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "41337e9dc80ebadf36b4f252bf7440f61bcf34f99caa170e50dcd0f9a0cdb5d8" -"checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1" -"checksum heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8c80e194758495a9109566134dc06e42ea0423987d6ceca016edaa90381b3549" -"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae" -"checksum hyper 0.9.4 (git+https://github.com/ethcore/hyper)" = "" -"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" -"checksum itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f" -"checksum itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae3088ea4baeceb0284ee9eea42f591226e6beaecf65373e41b38d95a1b8e7a1" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f" -"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8" -"checksum linked-hash-map 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bda158e0dabeb97ee8a401f4d17e479d6b891a14de0bba79d5cc2d4d325b5e48" -"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" -"checksum lru-cache 0.1.0 (git+https://github.com/contain-rs/lru-cache)" = "" -"checksum matches 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc3ad8109fa4b522f9b0cd81440422781f564aaf8c195de6b9d6642177ad0dd" -"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" -"checksum mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5c93a4bd787ddc6e7833c519b73a50883deb5863d76d9b71eb8216fb7f94e66" -"checksum mio 0.5.1 (git+https://github.com/ethcore/mio?branch=v0.5.x)" = "" -"checksum miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d5bfc6782530ac8ace97af10a540054a37126b63b0702ddaaa243b73b5745b9a" -"checksum nanomsg 0.7.0 (git+https://github.com/ethcore/nanomsg.rs.git)" = "" -"checksum nanomsg-sys 0.7.0 (git+https://github.com/ethcore/nanomsg.rs.git)" = "" -"checksum net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "5edf9cb6be97212423aed9413dd4729d62b370b5e1c571750e882cebbbc1e3e2" -"checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79" -"checksum nodrop 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbadd3f4c98dea0bd3d9b4be4c0cdaf1ab57035cb2e41fce3983db5add7cc5" -"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" -"checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120" -"checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49" -"checksum num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c78e054dd19c3fd03419ade63fa661e9c49bb890ce3beb4eee5b7baf93f92f" -"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" -"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" -"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf" -"checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c" -"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" -"checksum odds 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)" = "e04630a62b3f1cc8c58b4d8f2555a40136f02b420e158242936ef286a72d33a0" -"checksum owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8d91377085359426407a287ab16884a0111ba473aa6844ff01d4ec20ce3d75e7" -"checksum parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e1435e7a2a00dfebededd6c6bdbd54008001e94b4a2aadd6aef0dc4c56317621" -"checksum parking_lot_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb1b97670a2ffadce7c397fb80a3d687c4f3060140b885621ef1653d0e5d5068" -"checksum primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0e31b86efadeaeb1235452171a66689682783149a6249ff334a2c5d8218d00a4" -"checksum primal-bit 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "464a91febc06166783d4f5ba3577b5ed8dda8e421012df80bfe48a971ed7be8f" -"checksum primal-check 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "647c81b67bb9551a7b88d0bcd785ac35b7d0bf4b2f358683d7c2375d04daec51" -"checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" -"checksum primal-sieve 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "943788ecb9a362697c46acf6b58164c3fb4e13af576f036af1bbd15b2174151a" -"checksum quasi 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b26543b563704e7d87f3ec7cfafb713010a905c5f1b155a8ab66863af43ca578" -"checksum quasi_codegen 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0881d9a45d5f9ebe4a7e77742f8c604f3658c212baf8dd711a692dd000bc648c" -"checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c" -"checksum quote 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b22ffb272d214bfc8b6c89ff856d0acb52f0cd6b85162243460c9291b93c56e" -"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5" -"checksum rayon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "655df67c314c30fa3055a365eae276eb88aa4f3413a352a1ab32c1320eda41ea" -"checksum regex 0.1.77 (registry+https://github.com/rust-lang/crates.io-index)" = "64b03446c466d35b42f2a8b203c8e03ed8b91c0f17b56e1f84f7210a257aa665" -"checksum regex-syntax 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "48f0573bcee95a48da786f8823465b5f2a1fae288a55407aca991e5b3e0eae11" -"checksum rocksdb 0.4.5 (git+https://github.com/ethcore/rust-rocksdb)" = "" -"checksum rocksdb-sys 0.3.0 (git+https://github.com/ethcore/rust-rocksdb)" = "" -"checksum rotor 0.6.3 (git+https://github.com/ethcore/rotor)" = "" -"checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" -"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" -"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" -"checksum serde 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)" = "14db385091b1ef02cc209ba2236b2f97666a778674cdbad46b1b0cb2c88cb0ed" -"checksum serde_codegen 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e575e583f7d162e163af117fb9791fbd2bd203c31023b3219617e12c5997a738" -"checksum serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "318f7e77aa5187391d74aaf4553d2189f56b0ce25e963414c951b97877ffdcec" -"checksum serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb6b19e74d9f65b9d03343730b643d729a446b29376785cd65efdff4675e2fc" -"checksum siphasher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c44e42fa187b5a8782489cf7740cc27c3125806be2bf33563cf5e02e9533fcd" -"checksum slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d807fd58c4181bbabed77cb3b891ba9748241a552bcc5be698faaebefc54f46e" -"checksum slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6dbdd334bd28d328dad1c41b0ea662517883d8880d8533895ef96c8003dec9c4" -"checksum smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fcc8d19212aacecf95e4a7a2179b26f7aeb9732a915cf01f05b0d3e044865410" -"checksum spmc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "93bdab61c1a413e591c4d17388ffa859eaff2df27f1e13a5ec8b716700605adf" -"checksum strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "50c069df92e4b01425a8bf3576d5d417943a6a7272fbabaf5bd80b1aaa76442e" -"checksum syn 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96fed4e825d615b0ffd74dabb1dc4c5a078ab44e2c8004798f01510edf6cf515" -"checksum syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393b6dd0889df2b064beeea954cfda6bc2571604ac460deeae0fed55a53988af" -"checksum syntex 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)" = "871acb190170a9eb8bd85943aee9f9edd66f4c3bbe8f1856f9c0656fc6debf33" -"checksum syntex_errors 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fb4a792e49d439a271688827ddcd330c0dd45f5830575bed9ad36e732c28694" -"checksum syntex_pos 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24a047946021b25c127b86d7217007e63429b11eaca2bb55151c57ee1bc98dbd" -"checksum syntex_syntax 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44bded3cabafc65c90b663b1071bd2d198a9ab7515e6ce729e4570aaf53c407e" -"checksum syntex_syntax 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0b90281e9f8adf9171d7570638970ffd9f1d858f791c69196ec9a4e22c04242c" -"checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" -"checksum term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "f2077e54d38055cf1ca0fd7933a2e00cd3ec8f6fed352b2a377f06dcdaaf3281" -"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" -"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" -"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" -"checksum time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7ec6d62a20df54e07ab3b78b9a3932972f4b7981de295563686849eb3989af" -"checksum tiny-keccak 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8ac274ea206f5352fe553c7b5d8f5658eea51238e747e12968c48705b791b644" -"checksum traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "07eaeb7689bb7fca7ce15628319635758eda769fed481ecfe6686ddef2600616" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" -"checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f" -"checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172" -"checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" -"checksum url 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8527c62d9869a08325c38272b3f85668df22a65890c61a639d233dc0ed0b23a2" -"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" -"checksum vecio 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0795a11576d29ae80525a3fda315bf7b534f8feb9d34101e5fe63fb95bb2fd24" -"checksum vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c3365f36c57e5df714a34be40902b27a992eeddb9996eca52d0584611cf885d" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 48d0a3f36..f5f31c0a0 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -7,7 +7,7 @@ version = "1.6.0" authors = ["Parity Technologies "] [dependencies] -ethabi = "0.2.2" +ethabi = "1.0.0" futures = "0.1" log = "0.3" mime = "0.2" diff --git a/ipc-common-types/Cargo.toml b/ipc-common-types/Cargo.toml index 9b8316ef3..844962b2d 100644 --- a/ipc-common-types/Cargo.toml +++ b/ipc-common-types/Cargo.toml @@ -10,7 +10,6 @@ build = "build.rs" ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] -log = "0.3" semver = "0.5" ethcore-ipc = { path = "../ipc/rpc" } ethcore-util = { path = "../util" } diff --git a/ipc-common-types/src/lib.rs b/ipc-common-types/src/lib.rs index fd2f1a3b9..2038c9116 100644 --- a/ipc-common-types/src/lib.rs +++ b/ipc-common-types/src/lib.rs @@ -16,11 +16,10 @@ //! Updater for Parity executables -#[macro_use] extern crate log; extern crate semver; extern crate ethcore_util as util; extern crate ethcore_ipc as ipc; mod types; -pub use types::*; \ No newline at end of file +pub use types::*; diff --git a/ipc/codegen/src/lib.rs b/ipc/codegen/src/lib.rs index 51e242039..33894b485 100644 --- a/ipc/codegen/src/lib.rs +++ b/ipc/codegen/src/lib.rs @@ -29,7 +29,6 @@ extern crate quasi; extern crate syntex; #[cfg(feature = "with-syntex")] -#[macro_use] extern crate syntex_syntax as syntax; #[cfg(not(feature = "with-syntex"))] diff --git a/json/Cargo.toml b/json/Cargo.toml index 747be8f7d..577d0d9e8 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -2,19 +2,12 @@ name = "ethjson" version = "0.1.0" authors = ["Parity Technologies "] -build = "build.rs" [dependencies] ethcore-util = { path = "../util" } rustc-serialize = "0.3" -serde = "0.8" -serde_json = "0.8" -serde_macros = { version = "0.8", optional = true } +serde = "0.9" +serde_json = "0.9" +serde_derive = "0.9" clippy = { version = "0.0.103", optional = true} -[build-dependencies] -serde_codegen = { version = "0.8", optional = true } - -[features] -default = ["serde_codegen"] -nightly = ["serde_macros"] diff --git a/json/build.rs b/json/build.rs deleted file mode 100644 index 58e84d886..000000000 --- a/json/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -#[cfg(not(feature = "serde_macros"))] -mod inner { - extern crate serde_codegen; - - use std::env; - use std::path::Path; - - pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - let src = Path::new("src/lib.rs.in"); - let dst = Path::new(&out_dir).join("lib.rs"); - - serde_codegen::expand(&src, &dst).unwrap(); - } -} - -#[cfg(feature = "serde_macros")] -mod inner { - pub fn main() {} -} - -fn main() { - inner::main(); -} diff --git a/json/src/bytes.rs b/json/src/bytes.rs index 15a49612c..0900ec999 100644 --- a/json/src/bytes.rs +++ b/json/src/bytes.rs @@ -16,11 +16,12 @@ //! Lenient bytes json deserialization for test json files. +use std::fmt; use std::str::FromStr; use std::ops::Deref; use rustc_serialize::hex::FromHex; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::Visitor; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error, Visitor}; /// Lenient bytes json deserialization for test json files. #[derive(Default, Debug, PartialEq, Eq, Clone, PartialOrd, Ord)] @@ -67,7 +68,7 @@ impl FromStr for Bytes { } impl Deserialize for Bytes { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(BytesVisitor) } @@ -78,11 +79,15 @@ struct BytesVisitor; impl Visitor for BytesVisitor { type Value = Bytes; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a hex encoded string of bytes") + } + + fn visit_str(self, value: &str) -> Result where E: Error { Bytes::from_str(value).map_err(Error::custom) } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } diff --git a/json/src/hash.rs b/json/src/hash.rs index 26ac888cf..ae6ba1a81 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -17,8 +17,9 @@ //! Lenient hash json deserialization for test json files. use std::str::FromStr; -use serde::{Deserialize, Deserializer, Serialize, Serializer, Error}; -use serde::de::Visitor; +use std::fmt; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::{Error, Visitor}; use rustc_serialize::hex::ToHex; use util::hash::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048}; @@ -42,7 +43,7 @@ macro_rules! impl_hash { } impl Deserialize for $name { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { struct HashVisitor; @@ -50,7 +51,11 @@ macro_rules! impl_hash { impl Visitor for HashVisitor { type Value = $name; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a 0x-prefixed hex-encoded hash") + } + + fn visit_str(self, value: &str) -> Result where E: Error { let value = match value.len() { 0 => $inner::from(0), 2 if value == "0x" => $inner::from(0), @@ -65,7 +70,7 @@ macro_rules! impl_hash { Ok($name(value)) } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } @@ -75,7 +80,7 @@ macro_rules! impl_hash { } impl Serialize for $name { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut hex = "0x".to_owned(); hex.push_str(&self.0.to_hex()); serializer.serialize_str(&hex) diff --git a/json/src/lib.rs b/json/src/lib.rs index 3576bc1fb..b65b18cab 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -14,15 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -//! Json deserialization module. - -#![warn(missing_docs)] -#![cfg_attr(feature="nightly", feature(custom_derive, custom_attribute, plugin))] -#![cfg_attr(feature="nightly", plugin(serde_macros, clippy))] - -#[cfg(feature = "serde_macros")] -include!("lib.rs.in"); - -#[cfg(not(feature = "serde_macros"))] -include!(concat!(env!("OUT_DIR"), "/lib.rs")); +extern crate rustc_serialize; +extern crate serde; +extern crate serde_json; +extern crate ethcore_util as util; +#[macro_use] extern crate serde_derive; +pub mod hash; +pub mod uint; +pub mod bytes; +pub mod blockchain; +pub mod spec; +pub mod trie; +pub mod vm; +pub mod maybe; +pub mod state; +pub mod transaction; +pub mod misc; diff --git a/json/src/lib.rs.in b/json/src/lib.rs.in deleted file mode 100644 index 20541b8a9..000000000 --- a/json/src/lib.rs.in +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -extern crate rustc_serialize; -extern crate serde; -extern crate serde_json; -extern crate ethcore_util as util; - -pub mod hash; -pub mod uint; -pub mod bytes; -pub mod blockchain; -pub mod spec; -pub mod trie; -pub mod vm; -pub mod maybe; -pub mod state; -pub mod transaction; -pub mod misc; diff --git a/json/src/maybe.rs b/json/src/maybe.rs index dd4d5d821..d80020cf2 100644 --- a/json/src/maybe.rs +++ b/json/src/maybe.rs @@ -1,11 +1,11 @@ //! Deserializer of empty string values into optionals. +use std::fmt; use std::marker::PhantomData; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::Visitor; -use serde_json::Value; -use serde_json::value; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error, Visitor}; +use serde::de::value::ValueDeserializer; /// Deserializer of empty string values into optionals. #[derive(Debug, PartialEq)] @@ -17,7 +17,7 @@ pub enum MaybeEmpty { } impl Deserialize for MaybeEmpty where T: Deserialize { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(MaybeEmptyVisitor::new()) } @@ -38,16 +38,19 @@ impl MaybeEmptyVisitor { impl Visitor for MaybeEmptyVisitor where T: Deserialize { type Value = MaybeEmpty; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "an empty string or string-encoded type") + } + + fn visit_str(self, value: &str) -> Result where E: Error { self.visit_string(value.to_owned()) } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { match value.is_empty() { true => Ok(MaybeEmpty::None), false => { - let value = Value::String(value); - T::deserialize(&mut value::Deserializer::new(value)).map(MaybeEmpty::Some).map_err(|_| Error::custom("failed")) + T::deserialize(value.into_deserializer()).map(MaybeEmpty::Some) } } } diff --git a/json/src/trie/input.rs b/json/src/trie/input.rs index f73ca890a..86614294e 100644 --- a/json/src/trie/input.rs +++ b/json/src/trie/input.rs @@ -16,11 +16,12 @@ //! Trie test input deserialization. +use std::fmt; use std::collections::BTreeMap; use std::str::FromStr; use bytes::Bytes; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::{Visitor, MapVisitor, SeqVisitor}; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error as ErrorTrait, Visitor, MapVisitor, SeqVisitor}; /// Trie test input. #[derive(Debug, PartialEq)] @@ -30,7 +31,7 @@ pub struct Input { } impl Deserialize for Input { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(InputVisitor) @@ -42,20 +43,24 @@ struct InputVisitor; impl Visitor for InputVisitor { type Value = Input; - fn visit_map(&mut self, mut visitor: V) -> Result where V: MapVisitor { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a map of bytes into bytes") + } + + fn visit_map(self, mut visitor: V) -> Result where V: MapVisitor { let mut result = BTreeMap::new(); loop { let key_str: Option = visitor.visit_key()?; let key = match key_str { - Some(ref k) if k.starts_with("0x") => Bytes::from_str(k).map_err(Error::custom)?, + Some(ref k) if k.starts_with("0x") => Bytes::from_str(k).map_err(V::Error::custom)?, Some(k) => Bytes::new(k.into_bytes()), None => { break; } }; let val_str: Option = visitor.visit_value()?; let val = match val_str { - Some(ref v) if v.starts_with("0x") => Some(Bytes::from_str(v).map_err(Error::custom)?), + Some(ref v) if v.starts_with("0x") => Some(Bytes::from_str(v).map_err(V::Error::custom)?), Some(v) => Some(Bytes::new(v.into_bytes())), None => None, }; @@ -63,8 +68,6 @@ impl Visitor for InputVisitor { result.insert(key, val); } - visitor.end()?; - let input = Input { data: result }; @@ -72,7 +75,7 @@ impl Visitor for InputVisitor { Ok(input) } - fn visit_seq(&mut self, mut visitor: V) -> Result where V: SeqVisitor { + fn visit_seq(self, mut visitor: V) -> Result where V: SeqVisitor { let mut result = BTreeMap::new(); loop { @@ -83,20 +86,20 @@ impl Visitor for InputVisitor { }; if keyval.len() != 2 { - return Err(Error::custom("Invalid key value pair.")); + return Err(V::Error::custom("Invalid key value pair.")); } let ref key_str: Option = keyval[0]; let ref val_str: Option = keyval[1]; let key = match *key_str { - Some(ref k) if k.starts_with("0x") => Bytes::from_str(k).map_err(Error::custom)?, + Some(ref k) if k.starts_with("0x") => Bytes::from_str(k).map_err(V::Error::custom)?, Some(ref k) => Bytes::new(k.clone().into_bytes()), None => { break; } }; let val = match *val_str { - Some(ref v) if v.starts_with("0x") => Some(Bytes::from_str(v).map_err(Error::custom)?), + Some(ref v) if v.starts_with("0x") => Some(Bytes::from_str(v).map_err(V::Error::custom)?), Some(ref v) => Some(Bytes::new(v.clone().into_bytes())), None => None, }; @@ -104,8 +107,6 @@ impl Visitor for InputVisitor { result.insert(key, val); } - visitor.end()?; - let input = Input { data: result }; diff --git a/json/src/uint.rs b/json/src/uint.rs index 10bccfaae..281820d78 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -16,9 +16,10 @@ //! Lenient uint json deserialization for test json files. +use std::fmt; use std::str::FromStr; -use serde::{Deserialize, Deserializer, Error}; -use serde::de::Visitor; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error, Visitor}; use util::{U256, Uint as U}; /// Lenient uint json deserialization for test json files. @@ -50,7 +51,7 @@ impl Into for Uint { } impl Deserialize for Uint { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(UintVisitor) } @@ -61,11 +62,15 @@ struct UintVisitor; impl Visitor for UintVisitor { type Value = Uint; - fn visit_u64(&mut self, value: u64) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a hex encoded uint") + } + + fn visit_u64(self, value: u64) -> Result where E: Error { Ok(Uint(U256::from(value))) } - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn visit_str(self, value: &str) -> Result where E: Error { let value = match value.len() { 0 => U256::from(0), 2 if value.starts_with("0x") => U256::from(0), @@ -80,7 +85,7 @@ impl Visitor for UintVisitor { Ok(Uint(value)) } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } diff --git a/logger/src/lib.rs b/logger/src/lib.rs index b09d838bf..f9188d928 100644 --- a/logger/src/lib.rs +++ b/logger/src/lib.rs @@ -17,7 +17,6 @@ //! Logger for parity executables extern crate ethcore_util as util; -#[macro_use] extern crate log as rlog; extern crate isatty; extern crate regex; diff --git a/parity/main.rs b/parity/main.rs index f3eb88866..63d59d5fa 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -22,59 +22,52 @@ #![cfg_attr(feature="dev", allow(useless_format))] #![cfg_attr(feature="dev", allow(match_bool))] -extern crate docopt; -extern crate num_cpus; -extern crate rustc_serialize; -extern crate ethcore_devtools as devtools; -extern crate ethcore; -extern crate ethsync; -extern crate env_logger; -extern crate ethcore_logger; +extern crate ansi_term; +extern crate app_dirs; extern crate ctrlc; +extern crate docopt; +extern crate env_logger; extern crate fdlimit; -extern crate time; +extern crate hyper; // for price_info.rs +extern crate isatty; +extern crate jsonrpc_core; +extern crate num_cpus; extern crate number_prefix; +extern crate regex; +extern crate rlp; extern crate rpassword; +extern crate rustc_serialize; extern crate semver; -extern crate ethcore_io as io; -extern crate ethcore_ipc as ipc; -extern crate ethcore_ipc_nano as nanoipc; extern crate serde; extern crate serde_json; -extern crate jsonrpc_core; -extern crate rlp; -extern crate ethcore_light as light; -extern crate parity_hash_fetch as hash_fetch; - -extern crate ethcore_ipc_hypervisor as hypervisor; -extern crate ethcore_rpc; - -extern crate ethcore_signer; -extern crate parity_updater as updater; -extern crate ansi_term; - -extern crate regex; -extern crate isatty; +extern crate time; extern crate toml; -extern crate app_dirs; -extern crate parity_reactor; -#[macro_use] +extern crate ethcore; +extern crate ethcore_devtools as devtools; +extern crate ethcore_io as io; +extern crate ethcore_ipc as ipc; +extern crate ethcore_ipc_hypervisor as hypervisor; +extern crate ethcore_ipc_nano as nanoipc; +extern crate ethcore_light as light; +extern crate ethcore_logger; +extern crate ethcore_rpc; +extern crate ethcore_signer; extern crate ethcore_util as util; -#[macro_use] -extern crate log as rlog; -#[macro_use] -extern crate hyper; // for price_info.rs -#[macro_use] -extern crate lazy_static; +extern crate ethsync; +extern crate parity_hash_fetch as hash_fetch; +extern crate parity_reactor; +extern crate parity_updater as updater; +extern crate rpc_cli; #[cfg(feature="stratum")] extern crate ethcore_stratum; - #[cfg(feature = "dapps")] extern crate ethcore_dapps; -extern crate rpc_cli; + +#[macro_use] +extern crate log as rlog; macro_rules! dependency { ($dep_ty:ident, $url:expr) => { @@ -88,32 +81,33 @@ macro_rules! dependency { } } -mod cache; -mod upgrade; -mod rpc; -mod dapps; -mod informant; -mod cli; -mod configuration; -mod migration; -mod signer; -mod rpc_apis; -mod url; -mod helpers; -mod params; -mod deprecated; -mod dir; -mod modules; mod account; mod blockchain; +mod cache; +mod cli; +mod configuration; +mod dapps; +mod deprecated; +mod dir; +mod helpers; +mod informant; +mod migration; +mod modules; +mod params; mod presale; -mod snapshot; +mod rpc; +mod rpc_apis; mod run; -#[cfg(feature="ipc")] -mod sync; +mod signer; +mod snapshot; +mod upgrade; +mod url; +mod user_defaults; + #[cfg(feature="ipc")] mod boot; -mod user_defaults; +#[cfg(feature="ipc")] +mod sync; #[cfg(feature="stratum")] mod stratum; @@ -211,7 +205,7 @@ fn latest_exe_path() -> Option { fn global_cleanup() { extern "system" { pub fn WSACleanup() -> i32; } // We need to cleanup all sockets before spawning another Parity process. This makes shure everything is cleaned up. - // The loop is required because of internal refernce counter for winsock dll. We don't know how many crates we use do + // The loop is required because of internal refernce counter for winsock dll. We don't know how many crates we use do // initialize it. There's at least 2 now. for _ in 0.. 10 { unsafe { WSACleanup(); } diff --git a/parity/user_defaults.rs b/parity/user_defaults.rs index 3b6089bbc..cc1d8197b 100644 --- a/parity/user_defaults.rs +++ b/parity/user_defaults.rs @@ -14,13 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +use std::fmt; use std::fs::File; use std::io::Write; use std::path::Path; use std::collections::BTreeMap; use std::time::Duration; -use serde::{Serialize, Serializer, Error, Deserialize, Deserializer}; -use serde::de::{Visitor, MapVisitor}; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Error, Visitor, MapVisitor}; use serde::de::impls::BTreeMapVisitor; use serde_json::Value; use serde_json::de::from_reader; @@ -37,7 +38,7 @@ pub struct UserDefaults { } impl Serialize for UserDefaults { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut map: BTreeMap = BTreeMap::new(); map.insert("pruning".into(), Value::String(self.pruning.as_str().into())); @@ -46,12 +47,12 @@ impl Serialize for UserDefaults { let mode_str = match self.mode { Mode::Off => "offline", Mode::Dark(timeout) => { - map.insert("mode.timeout".into(), Value::U64(timeout.as_secs())); + map.insert("mode.timeout".into(), Value::Number(timeout.as_secs().into())); "dark" }, Mode::Passive(timeout, alarm) => { - map.insert("mode.timeout".into(), Value::U64(timeout.as_secs())); - map.insert("mode.alarm".into(), Value::U64(alarm.as_secs())); + map.insert("mode.timeout".into(), Value::Number(timeout.as_secs().into())); + map.insert("mode.alarm".into(), Value::Number(alarm.as_secs().into())); "passive" }, Mode::Active => "active", @@ -65,7 +66,7 @@ impl Serialize for UserDefaults { struct UserDefaultsVisitor; impl Deserialize for UserDefaults { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(UserDefaultsVisitor) } @@ -74,8 +75,11 @@ impl Deserialize for UserDefaults { impl Visitor for UserDefaultsVisitor { type Value = UserDefaults; - fn visit_map(&mut self, visitor: V) -> Result - where V: MapVisitor { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a valid UserDefaults object") + } + + fn visit_map(self, visitor: V) -> Result where V: MapVisitor { let mut map: BTreeMap = BTreeMapVisitor::new().visit_map(visitor)?; let pruning: Value = map.remove("pruning").ok_or_else(|| Error::custom("missing pruning"))?; let pruning = pruning.as_str().ok_or_else(|| Error::custom("invalid pruning value"))?; diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 13d125f59..8b8f9ecd7 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -4,7 +4,6 @@ name = "ethcore-rpc" version = "1.6.0" license = "GPL-3.0" authors = ["Parity Technologies "] -build = "build.rs" [lib] @@ -12,8 +11,9 @@ build = "build.rs" futures = "0.1" log = "0.3" semver = "0.5" -serde = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_json = "0.9" +serde_derive = "0.9" rustc-serialize = "0.3" time = "0.1" transient-hashmap = "0.1" @@ -38,13 +38,7 @@ parity-updater = { path = "../updater" } rlp = { path = "../util/rlp" } fetch = { path = "../util/fetch" } parity-reactor = { path = "../util/reactor" } -serde_macros = { version = "0.8", optional = true } clippy = { version = "0.0.103", optional = true} -[build-dependencies] -serde_codegen = { version = "0.8", optional = true } - [features] -default = ["serde_codegen"] -nightly = ["serde_macros"] dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev"] diff --git a/rpc/build.rs b/rpc/build.rs deleted file mode 100644 index 85ecf14ce..000000000 --- a/rpc/build.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -#[cfg(not(feature = "serde_macros"))] -mod inner { - extern crate serde_codegen; - - use std::env; - use std::path::Path; - - pub fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - let src = Path::new("src/v1/types/mod.rs.in"); - let dst = Path::new(&out_dir).join("mod.rs"); - - serde_codegen::expand(&src, &dst).unwrap(); - } -} - -#[cfg(feature = "serde_macros")] -mod inner { - pub fn main() {} -} - -fn main() { - inner::main(); -} diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 50cde77c5..287bfb1a8 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -16,8 +16,8 @@ //! Ethcore rpc. #![warn(missing_docs)] -#![cfg_attr(feature="nightly", feature(custom_derive, custom_attribute, plugin))] -#![cfg_attr(feature="nightly", plugin(serde_macros, clippy))] +#![cfg_attr(feature="nightly", feature(plugin))] +#![cfg_attr(feature="nightly", plugin(clippy))] extern crate semver; extern crate rustc_serialize; @@ -51,6 +51,8 @@ extern crate log; extern crate ethcore_util as util; #[macro_use] extern crate jsonrpc_macros; +#[macro_use] +extern crate serde_derive; #[cfg(test)] extern crate ethjson; diff --git a/rpc/src/v1/tests/mocked/signing.rs b/rpc/src/v1/tests/mocked/signing.rs index e50682675..10611f139 100644 --- a/rpc/src/v1/tests/mocked/signing.rs +++ b/rpc/src/v1/tests/mocked/signing.rs @@ -388,7 +388,7 @@ fn should_decrypt_message_if_account_is_unlocked() { let encrypted: Success = serde_json::from_str(&tester.io.handle_request_sync(&request).unwrap()).unwrap(); // then call decrypt - let request = format!("{}{:?}{}{:?}{}", + let request = format!("{}{:?}{}{}{}", r#"{"jsonrpc": "2.0", "method": "parity_decryptMessage", "params":["0x"#, address, r#"","#, diff --git a/rpc/src/v1/types/block.rs b/rpc/src/v1/types/block.rs index 7905dc5e5..7c06b9de2 100644 --- a/rpc/src/v1/types/block.rs +++ b/rpc/src/v1/types/block.rs @@ -17,6 +17,7 @@ use std::ops::Deref; use std::collections::BTreeMap; use serde::{Serialize, Serializer}; +use serde::ser::Error; use v1::types::{Bytes, Transaction, H160, H256, H2048, U256}; /// Block Transactions @@ -29,7 +30,7 @@ pub enum BlockTransactions { } impl Serialize for BlockTransactions { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { BlockTransactions::Hashes(ref hashes) => hashes.serialize(serializer), @@ -102,7 +103,7 @@ pub struct RichBlock { pub block: Block, /// Engine-specific fields with additional description. /// Should be included directly to serialized block object. - #[serde(skip_serializing)] + // TODO [ToDr] #[serde(skip_serializing)] pub extra_info: BTreeMap, } @@ -114,17 +115,18 @@ impl Deref for RichBlock { } impl Serialize for RichBlock { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, serializer: S) -> Result where S: Serializer { use serde_json::{to_value, Value}; let serialized = (to_value(&self.block), to_value(&self.extra_info)); - if let (Value::Object(mut block), Value::Object(extras)) = serialized { + if let (Ok(Value::Object(mut block)), Ok(Value::Object(extras))) = serialized { // join two objects block.extend(extras); // and serialize - block.serialize(serializer)?; + block.serialize(serializer) + } else { + Err(S::Error::custom("Unserializable structures.")) } - Ok(()) } } diff --git a/rpc/src/v1/types/block_number.rs b/rpc/src/v1/types/block_number.rs index d8d8c3fe7..65a46879e 100644 --- a/rpc/src/v1/types/block_number.rs +++ b/rpc/src/v1/types/block_number.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Deserialize, Deserializer, Error, Serialize, Serializer}; -use serde::de::Visitor; +use std::fmt; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::{Error, Visitor}; use ethcore::client::BlockId; /// Represents rpc api block number param. @@ -38,8 +39,7 @@ impl Default for BlockNumber { } impl Deserialize for BlockNumber { - fn deserialize(deserializer: &mut D) -> Result - where D: Deserializer { + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(BlockNumberVisitor) } } @@ -55,7 +55,7 @@ impl BlockNumber { } impl Serialize for BlockNumber { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { BlockNumber::Num(ref x) => serializer.serialize_str(&format!("0x{:x}", x)), BlockNumber::Latest => serializer.serialize_str("latest"), @@ -70,7 +70,11 @@ struct BlockNumberVisitor; impl Visitor for BlockNumberVisitor { type Value = BlockNumber; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a block number or 'latest', 'earliest' or 'pending'") + } + + fn visit_str(self, value: &str) -> Result where E: Error { match value { "latest" => Ok(BlockNumber::Latest), "earliest" => Ok(BlockNumber::Earliest), @@ -80,7 +84,7 @@ impl Visitor for BlockNumberVisitor { } } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } diff --git a/rpc/src/v1/types/bytes.rs b/rpc/src/v1/types/bytes.rs index d8bbe6987..b290dd5ac 100644 --- a/rpc/src/v1/types/bytes.rs +++ b/rpc/src/v1/types/bytes.rs @@ -16,9 +16,10 @@ //! Serializable wrapper around vector of bytes +use std::fmt; use rustc_serialize::hex::ToHex; -use serde::{Serialize, Serializer, Deserialize, Deserializer, Error}; -use serde::de::Visitor; +use serde::{Serialize, Serializer, Deserialize, Deserializer}; +use serde::de::{Error, Visitor}; use util::common::FromHex; /// Wrapper structure around vector of bytes. @@ -49,7 +50,7 @@ impl Into> for Bytes { } impl Serialize for Bytes { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut serialized = "0x".to_owned(); serialized.push_str(self.0.to_hex().as_ref()); @@ -58,7 +59,7 @@ impl Serialize for Bytes { } impl Deserialize for Bytes { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(BytesVisitor) } @@ -69,7 +70,11 @@ struct BytesVisitor; impl Visitor for BytesVisitor { type Value = Bytes; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a 0x-prefixed, hex-encoded vector of bytes") + } + + fn visit_str(self, value: &str) -> Result where E: Error { if value.is_empty() { warn!( target: "deprecated", @@ -83,7 +88,7 @@ impl Visitor for BytesVisitor { } } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } diff --git a/rpc/src/v1/types/confirmations.rs b/rpc/src/v1/types/confirmations.rs index 63d4819f3..7a05ee914 100644 --- a/rpc/src/v1/types/confirmations.rs +++ b/rpc/src/v1/types/confirmations.rs @@ -130,7 +130,7 @@ pub enum ConfirmationResponse { } impl Serialize for ConfirmationResponse { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { @@ -225,7 +225,7 @@ impl Serialize for Either where A: Serialize + fmt::Debug + Clone, B: Serialize + fmt::Debug + Clone, { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index 34d12202e..8ccac7efd 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Deserialize, Deserializer, Serialize, Serializer, Error}; -use serde_json::value; -use jsonrpc_core::Value; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::Error; +use serde_json::{Value, from_value}; use ethcore::filter::Filter as EthFilter; use ethcore::client::BlockId; use v1::types::{BlockNumber, H160, H256, Log}; @@ -33,17 +33,17 @@ pub enum VariadicValue where T: Deserialize { } impl Deserialize for VariadicValue where T: Deserialize { - fn deserialize(deserializer: &mut D) -> Result, D::Error> + fn deserialize(deserializer: D) -> Result, D::Error> where D: Deserializer { - let v = Value::deserialize(deserializer)?; + let v: Value = Deserialize::deserialize(deserializer)?; if v.is_null() { return Ok(VariadicValue::Null); } - Deserialize::deserialize(&mut value::Deserializer::new(v.clone())).map(VariadicValue::Single) - .or_else(|_| Deserialize::deserialize(&mut value::Deserializer::new(v.clone())).map(VariadicValue::Multiple)) - .map_err(|_| Error::custom("")) // unreachable, but types must match + from_value(v.clone()).map(VariadicValue::Single) + .or_else(|_| from_value(v).map(VariadicValue::Multiple)) + .map_err(|_| D::Error::custom("Invalid type.")) } } @@ -111,7 +111,7 @@ pub enum FilterChanges { } impl Serialize for FilterChanges { - fn serialize(&self, s: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, s: S) -> Result where S: Serializer { match *self { FilterChanges::Logs(ref logs) => logs.serialize(s), FilterChanges::Hashes(ref hashes) => hashes.serialize(s), diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index a230333ff..0c8672601 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -101,7 +101,7 @@ macro_rules! impl_hash { } impl serde::Serialize for $name { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { let mut hex = "0x".to_owned(); hex.push_str(&self.0.to_hex()); @@ -110,16 +110,20 @@ macro_rules! impl_hash { } impl serde::Deserialize for $name { - fn deserialize(deserializer: &mut D) -> Result<$name, D::Error> where D: serde::Deserializer { + fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer { struct HashVisitor; impl serde::de::Visitor for HashVisitor { type Value = $name; - fn visit_str(&mut self, value: &str) -> Result where E: serde::Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a 0x-prefixed, padded, hex-encoded hash of type {}", stringify!($name)) + } + + fn visit_str(self, value: &str) -> Result where E: serde::de::Error { if value.len() != 2 + $size * 2 { - return Err(serde::Error::custom("Invalid length.")); + return Err(E::custom("Invalid length.")); } match value[2..].from_hex() { @@ -128,11 +132,11 @@ macro_rules! impl_hash { result.copy_from_slice(v); Ok($name(result)) }, - _ => Err(serde::Error::custom("Invalid hex value.")) + _ => Err(E::custom("Invalid hex value.")) } } - fn visit_string(&mut self, value: String) -> Result where E: serde::Error { + fn visit_string(self, value: String) -> Result where E: serde::de::Error { self.visit_str(value.as_ref()) } } diff --git a/rpc/src/v1/types/index.rs b/rpc/src/v1/types/index.rs index 9685185fc..ab8784f49 100644 --- a/rpc/src/v1/types/index.rs +++ b/rpc/src/v1/types/index.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use serde::{Deserialize, Deserializer, Error}; -use serde::de::Visitor; +use std::fmt; +use serde::{Deserialize, Deserializer}; +use serde::de::{Error, Visitor}; /// Represents usize. #[derive(Debug, PartialEq)] @@ -29,7 +30,7 @@ impl Index { } impl Deserialize for Index { - fn deserialize(deserializer: &mut D) -> Result + fn deserialize(deserializer: D) -> Result where D: Deserializer { deserializer.deserialize(IndexVisitor) } @@ -40,14 +41,18 @@ struct IndexVisitor; impl Visitor for IndexVisitor { type Value = Index; - fn visit_str(&mut self, value: &str) -> Result where E: Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a hex-encoded or decimal index") + } + + fn visit_str(self, value: &str) -> Result where E: Error { match value { _ if value.starts_with("0x") => usize::from_str_radix(&value[2..], 16).map(Index).map_err(|_| Error::custom("invalid index")), - _ => value.parse::().map(Index).map_err(|_| Error::custom("invalid index")) + _ => value.parse::().map(Index).map_err(|_| Error::custom("invalid index")), } } - fn visit_string(&mut self, value: String) -> Result where E: Error { + fn visit_string(self, value: String) -> Result where E: Error { self.visit_str(value.as_ref()) } } diff --git a/rpc/src/v1/types/mod.rs b/rpc/src/v1/types/mod.rs index 894946eaa..e32acc8ca 100644 --- a/rpc/src/v1/types/mod.rs +++ b/rpc/src/v1/types/mod.rs @@ -14,10 +14,59 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -//! Structures used in RPC communication -#[cfg(feature = "serde_macros")] -include!("mod.rs.in"); +//! RPC types -#[cfg(not(feature = "serde_macros"))] -include!(concat!(env!("OUT_DIR"), "/mod.rs")); +mod account_info; +mod bytes; +mod block; +mod block_number; +mod call_request; +mod confirmations; +mod dapp_id; +mod filter; +mod hash; +mod index; +mod log; +mod sync; +mod transaction; +mod transaction_request; +mod transaction_condition; +mod receipt; +mod rpc_settings; +mod trace; +mod trace_filter; +mod uint; +mod work; +mod histogram; +mod consensus_status; + +pub use self::bytes::Bytes; +pub use self::block::{RichBlock, Block, BlockTransactions}; +pub use self::block_number::BlockNumber; +pub use self::call_request::CallRequest; +pub use self::confirmations::{ + ConfirmationPayload, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken, + TransactionModification, SignRequest, DecryptRequest, Either +}; +pub use self::dapp_id::DappId; +pub use self::filter::{Filter, FilterChanges}; +pub use self::hash::{H64, H160, H256, H512, H520, H2048}; +pub use self::index::Index; +pub use self::log::Log; +pub use self::sync::{ + SyncStatus, SyncInfo, Peers, PeerInfo, PeerNetworkInfo, PeerProtocolsInfo, + TransactionStats, ChainStatus, EthProtocolInfo, LesProtocolInfo, +}; +pub use self::transaction::{Transaction, RichRawTransaction, LocalTransactionStatus}; +pub use self::transaction_request::TransactionRequest; +pub use self::transaction_condition::TransactionCondition; +pub use self::receipt::Receipt; +pub use self::rpc_settings::RpcSettings; +pub use self::trace::{LocalizedTrace, TraceResults}; +pub use self::trace_filter::TraceFilter; +pub use self::uint::{U128, U256}; +pub use self::work::Work; +pub use self::histogram::Histogram; +pub use self::consensus_status::*; +pub use self::account_info::{AccountInfo, HwAccountInfo}; diff --git a/rpc/src/v1/types/mod.rs.in b/rpc/src/v1/types/mod.rs.in deleted file mode 100644 index 268b57e4c..000000000 --- a/rpc/src/v1/types/mod.rs.in +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -mod account_info; -mod bytes; -mod block; -mod block_number; -mod call_request; -mod confirmations; -mod dapp_id; -mod filter; -mod hash; -mod index; -mod log; -mod sync; -mod transaction; -mod transaction_request; -mod transaction_condition; -mod receipt; -mod rpc_settings; -mod trace; -mod trace_filter; -mod uint; -mod work; -mod histogram; -mod consensus_status; - -pub use self::bytes::Bytes; -pub use self::block::{RichBlock, Block, BlockTransactions}; -pub use self::block_number::BlockNumber; -pub use self::call_request::CallRequest; -pub use self::confirmations::{ - ConfirmationPayload, ConfirmationRequest, ConfirmationResponse, ConfirmationResponseWithToken, - TransactionModification, SignRequest, DecryptRequest, Either -}; -pub use self::dapp_id::DappId; -pub use self::filter::{Filter, FilterChanges}; -pub use self::hash::{H64, H160, H256, H512, H520, H2048}; -pub use self::index::Index; -pub use self::log::Log; -pub use self::sync::{ - SyncStatus, SyncInfo, Peers, PeerInfo, PeerNetworkInfo, PeerProtocolsInfo, - TransactionStats, ChainStatus, EthProtocolInfo, LesProtocolInfo, -}; -pub use self::transaction::{Transaction, RichRawTransaction, LocalTransactionStatus}; -pub use self::transaction_request::TransactionRequest; -pub use self::transaction_condition::TransactionCondition; -pub use self::receipt::Receipt; -pub use self::rpc_settings::RpcSettings; -pub use self::trace::{LocalizedTrace, TraceResults}; -pub use self::trace_filter::TraceFilter; -pub use self::uint::{U128, U256}; -pub use self::work::Work; -pub use self::histogram::Histogram; -pub use self::consensus_status::*; -pub use self::account_info::{AccountInfo, HwAccountInfo}; diff --git a/rpc/src/v1/types/sync.rs b/rpc/src/v1/types/sync.rs index e92721fde..d83a3a64c 100644 --- a/rpc/src/v1/types/sync.rs +++ b/rpc/src/v1/types/sync.rs @@ -139,7 +139,7 @@ pub enum SyncStatus { } impl Serialize for SyncStatus { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { match *self { SyncStatus::Info(ref info) => info.serialize(serializer), diff --git a/rpc/src/v1/types/trace.rs b/rpc/src/v1/types/trace.rs index fe2937b2f..f4f7de5e7 100644 --- a/rpc/src/v1/types/trace.rs +++ b/rpc/src/v1/types/trace.rs @@ -16,6 +16,7 @@ use std::collections::BTreeMap; use serde::{Serialize, Serializer}; +use serde::ser::SerializeStruct; use ethcore::trace::{FlatTrace, LocalizedTrace as EthLocalizedTrace, trace, TraceError}; use ethcore::trace as et; use ethcore::state_diff; @@ -200,7 +201,7 @@ impl From for AccountDiff { pub struct StateDiff(BTreeMap); impl Serialize for StateDiff { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { Serialize::serialize(&self.0, serializer) } @@ -428,41 +429,41 @@ pub struct LocalizedTrace { } impl Serialize for LocalizedTrace { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { - let mut state = serializer.serialize_struct("LocalizedTrace", 9)?; + let mut struc = serializer.serialize_struct("LocalizedTrace", 9)?; match self.action { Action::Call(ref call) => { - serializer.serialize_struct_elt(&mut state, "type", "call")?; - serializer.serialize_struct_elt(&mut state, "action", call)?; + struc.serialize_field("type", "call")?; + struc.serialize_field("action", call)?; }, Action::Create(ref create) => { - serializer.serialize_struct_elt(&mut state, "type", "create")?; - serializer.serialize_struct_elt(&mut state, "action", create)?; + struc.serialize_field("type", "create")?; + struc.serialize_field("action", create)?; }, Action::Suicide(ref suicide) => { - serializer.serialize_struct_elt(&mut state, "type", "suicide")?; - serializer.serialize_struct_elt(&mut state, "action", suicide)?; + struc.serialize_field("type", "suicide")?; + struc.serialize_field("action", suicide)?; }, } match self.result { - Res::Call(ref call) => serializer.serialize_struct_elt(&mut state, "result", call)?, - Res::Create(ref create) => serializer.serialize_struct_elt(&mut state, "result", create)?, - Res::FailedCall(ref error) => serializer.serialize_struct_elt(&mut state, "error", error.to_string())?, - Res::FailedCreate(ref error) => serializer.serialize_struct_elt(&mut state, "error", error.to_string())?, - Res::None => serializer.serialize_struct_elt(&mut state, "result", None as Option)?, + Res::Call(ref call) => struc.serialize_field("result", call)?, + Res::Create(ref create) => struc.serialize_field("result", create)?, + Res::FailedCall(ref error) => struc.serialize_field("error", &error.to_string())?, + Res::FailedCreate(ref error) => struc.serialize_field("error", &error.to_string())?, + Res::None => struc.serialize_field("result", &None as &Option)?, } - serializer.serialize_struct_elt(&mut state, "traceAddress", &self.trace_address)?; - serializer.serialize_struct_elt(&mut state, "subtraces", &self.subtraces)?; - serializer.serialize_struct_elt(&mut state, "transactionPosition", &self.transaction_position)?; - serializer.serialize_struct_elt(&mut state, "transactionHash", &self.transaction_hash)?; - serializer.serialize_struct_elt(&mut state, "blockNumber", &self.block_number)?; - serializer.serialize_struct_elt(&mut state, "blockHash", &self.block_hash)?; + struc.serialize_field("traceAddress", &self.trace_address)?; + struc.serialize_field("subtraces", &self.subtraces)?; + struc.serialize_field("transactionPosition", &self.transaction_position)?; + struc.serialize_field("transactionHash", &self.transaction_hash)?; + struc.serialize_field("blockNumber", &self.block_number)?; + struc.serialize_field("blockHash", &self.block_hash)?; - serializer.serialize_struct_end(state) + struc.end() } } @@ -495,37 +496,37 @@ pub struct Trace { } impl Serialize for Trace { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { - let mut state = serializer.serialize_struct("Trace", 4)?; + let mut struc = serializer.serialize_struct("Trace", 4)?; match self.action { Action::Call(ref call) => { - serializer.serialize_struct_elt(&mut state, "type", "call")?; - serializer.serialize_struct_elt(&mut state, "action", call)?; + struc.serialize_field("type", "call")?; + struc.serialize_field("action", call)?; }, Action::Create(ref create) => { - serializer.serialize_struct_elt(&mut state, "type", "create")?; - serializer.serialize_struct_elt(&mut state, "action", create)?; + struc.serialize_field("type", "create")?; + struc.serialize_field("action", create)?; }, Action::Suicide(ref suicide) => { - serializer.serialize_struct_elt(&mut state, "type", "suicide")?; - serializer.serialize_struct_elt(&mut state, "action", suicide)?; + struc.serialize_field("type", "suicide")?; + struc.serialize_field("action", suicide)?; }, } match self.result { - Res::Call(ref call) => serializer.serialize_struct_elt(&mut state, "result", call)?, - Res::Create(ref create) => serializer.serialize_struct_elt(&mut state, "result", create)?, - Res::FailedCall(ref error) => serializer.serialize_struct_elt(&mut state, "error", error.to_string())?, - Res::FailedCreate(ref error) => serializer.serialize_struct_elt(&mut state, "error", error.to_string())?, - Res::None => serializer.serialize_struct_elt(&mut state, "result", None as Option)?, + Res::Call(ref call) => struc.serialize_field("result", call)?, + Res::Create(ref create) => struc.serialize_field("result", create)?, + Res::FailedCall(ref error) => struc.serialize_field("error", &error.to_string())?, + Res::FailedCreate(ref error) => struc.serialize_field("error", &error.to_string())?, + Res::None => struc.serialize_field("result", &None as &Option)?, } - serializer.serialize_struct_elt(&mut state, "traceAddress", &self.trace_address)?; - serializer.serialize_struct_elt(&mut state, "subtraces", &self.subtraces)?; + struc.serialize_field("traceAddress", &self.trace_address)?; + struc.serialize_field("subtraces", &self.subtraces)?; - serializer.serialize_struct_end(state) + struc.end() } } diff --git a/rpc/src/v1/types/transaction.rs b/rpc/src/v1/types/transaction.rs index 106392fe1..d942c58c3 100644 --- a/rpc/src/v1/types/transaction.rs +++ b/rpc/src/v1/types/transaction.rs @@ -15,6 +15,7 @@ // along with Parity. If not, see . use serde::{Serialize, Serializer}; +use serde::ser::SerializeStruct; use ethcore::miner; use ethcore::contract_address; use ethcore::transaction::{LocalizedTransaction, Action, PendingTransaction, SignedTransaction}; @@ -93,7 +94,7 @@ pub enum LocalTransactionStatus { } impl Serialize for LocalTransactionStatus { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> + fn serialize(&self, serializer: S) -> Result where S: Serializer { use self::LocalTransactionStatus::*; @@ -108,35 +109,36 @@ impl Serialize for LocalTransactionStatus { let status = "status"; let transaction = "transaction"; - let mut state = serializer.serialize_struct("LocalTransactionStatus", elems)?; + let mut struc = serializer.serialize_struct("LocalTransactionStatus", elems)?; match *self { - Pending => serializer.serialize_struct_elt(&mut state, status, "pending")?, - Future => serializer.serialize_struct_elt(&mut state, status, "future")?, + Pending => struc.serialize_field(status, "pending")?, + Future => struc.serialize_field(status, "future")?, Mined(ref tx) => { - serializer.serialize_struct_elt(&mut state, status, "mined")?; - serializer.serialize_struct_elt(&mut state, transaction, tx)?; + struc.serialize_field(status, "mined")?; + struc.serialize_field(transaction, tx)?; }, Dropped(ref tx) => { - serializer.serialize_struct_elt(&mut state, status, "dropped")?; - serializer.serialize_struct_elt(&mut state, transaction, tx)?; + struc.serialize_field(status, "dropped")?; + struc.serialize_field(transaction, tx)?; }, Invalid(ref tx) => { - serializer.serialize_struct_elt(&mut state, status, "invalid")?; - serializer.serialize_struct_elt(&mut state, transaction, tx)?; + struc.serialize_field(status, "invalid")?; + struc.serialize_field(transaction, tx)?; }, Rejected(ref tx, ref reason) => { - serializer.serialize_struct_elt(&mut state, status, "rejected")?; - serializer.serialize_struct_elt(&mut state, transaction, tx)?; - serializer.serialize_struct_elt(&mut state, "error", reason)?; + struc.serialize_field(status, "rejected")?; + struc.serialize_field(transaction, tx)?; + struc.serialize_field("error", reason)?; }, Replaced(ref tx, ref gas_price, ref hash) => { - serializer.serialize_struct_elt(&mut state, status, "replaced")?; - serializer.serialize_struct_elt(&mut state, transaction, tx)?; - serializer.serialize_struct_elt(&mut state, "hash", hash)?; - serializer.serialize_struct_elt(&mut state, "gasPrice", gas_price)?; + struc.serialize_field(status, "replaced")?; + struc.serialize_field(transaction, tx)?; + struc.serialize_field("hash", hash)?; + struc.serialize_field("gasPrice", gas_price)?; }, } - serializer.serialize_struct_end(state) + + struc.end() } } diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index e495c7d1c..ba3b83fa7 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -60,33 +60,37 @@ macro_rules! impl_uint { } impl serde::Serialize for $name { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: serde::Serializer { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { serializer.serialize_str(&format!("0x{}", self.0.to_hex())) } } impl serde::Deserialize for $name { - fn deserialize(deserializer: &mut D) -> Result<$name, D::Error> + fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer { struct UintVisitor; impl serde::de::Visitor for UintVisitor { type Value = $name; - fn visit_str(&mut self, value: &str) -> Result where E: serde::Error { + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a 0x-prefixed, hex-encoded number of type {}", stringify!($name)) + } + + fn visit_str(self, value: &str) -> Result where E: serde::de::Error { // 0x + len if value.len() > 2 + $size * 16 || value.len() < 2 { - return Err(serde::Error::custom("Invalid length.")); + return Err(E::custom("Invalid length.")); } if &value[0..2] != "0x" { - return Err(serde::Error::custom("Use hex encoded numbers with 0x prefix.")) + return Err(E::custom("Use hex encoded numbers with 0x prefix.")) } - $other::from_str(&value[2..]).map($name).map_err(|_| serde::Error::custom("Invalid hex value.")) + $other::from_str(&value[2..]).map($name).map_err(|_| E::custom("Invalid hex value.")) } - fn visit_string(&mut self, value: String) -> Result where E: serde::Error { + fn visit_string(self, value: String) -> Result where E: serde::de::Error { self.visit_str(&value) } } diff --git a/rpc/src/v1/types/work.rs b/rpc/src/v1/types/work.rs index 72ab95ec1..3664892df 100644 --- a/rpc/src/v1/types/work.rs +++ b/rpc/src/v1/types/work.rs @@ -33,7 +33,7 @@ pub struct Work { } impl Serialize for Work { - fn serialize(&self, s: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, s: S) -> Result where S: Serializer { match self.number.as_ref() { Some(num) => (&self.pow_hash, &self.seed_hash, &self.target, U256::from(*num)).serialize(s), None => (&self.pow_hash, &self.seed_hash, &self.target).serialize(s), diff --git a/rpc_client/Cargo.toml b/rpc_client/Cargo.toml index e5c8e9b12..874d220ae 100644 --- a/rpc_client/Cargo.toml +++ b/rpc_client/Cargo.toml @@ -8,12 +8,10 @@ version = "1.4.0" [dependencies] futures = "0.1" -lazy_static = "0.2.1" log = "0.3.6" -matches = "0.1.2" rand = "0.3.14" -serde = "0.8" -serde_json = "0.8" +serde = "0.9" +serde_json = "0.9" tempdir = "0.3.5" url = "1.2.0" jsonrpc-core = { git = "https://github.com/ethcore/jsonrpc.git" } diff --git a/rpc_client/src/lib.rs b/rpc_client/src/lib.rs index 3164480e5..87dd3a6ee 100644 --- a/rpc_client/src/lib.rs +++ b/rpc_client/src/lib.rs @@ -13,11 +13,6 @@ extern crate rand; extern crate tempdir; extern crate jsonrpc_core; -#[macro_use] -extern crate lazy_static; -#[macro_use] -extern crate matches; - #[macro_use] extern crate log; diff --git a/rpc_client/src/signer_client.rs b/rpc_client/src/signer_client.rs index 956a28208..317dc0fec 100644 --- a/rpc_client/src/signer_client.rs +++ b/rpc_client/src/signer_client.rs @@ -1,5 +1,6 @@ use client::{Rpc, RpcError}; use rpc::v1::types::{ConfirmationRequest, TransactionModification, U256, TransactionCondition}; +use serde; use serde_json::{Value as JsonValue, to_value}; use std::path::PathBuf; use futures::{BoxFuture, Canceled}; @@ -27,9 +28,9 @@ impl SignerRpc { ) -> BoxFuture, Canceled> { self.rpc.request("signer_confirmRequest", vec![ - to_value(&format!("{:#x}", id)), - to_value(&TransactionModification { sender: None, gas_price: new_gas_price, gas: new_gas, condition: new_condition }), - to_value(&pwd), + Self::to_value(&format!("{:#x}", id)), + Self::to_value(&TransactionModification { sender: None, gas_price: new_gas_price, gas: new_gas, condition: new_condition }), + Self::to_value(&pwd), ]) } pub fn reject_request(&mut self, id: U256) -> @@ -39,4 +40,8 @@ impl SignerRpc { JsonValue::String(format!("{:#x}", id)) ]) } + + fn to_value(v: &T) -> JsonValue { + to_value(v).expect("Our types are always serializable; qed") + } } diff --git a/stratum/src/lib.rs b/stratum/src/lib.rs index 9ac8b08d1..59964773c 100644 --- a/stratum/src/lib.rs +++ b/stratum/src/lib.rs @@ -198,7 +198,7 @@ impl Stratum { trace!(target: "stratum", "Invalid submit work format {:?}", params); to_value(false) } - }).boxed() + }.expect("Only true/false is returned and it's always serializable; qed")).boxed() } fn subscribe(&self, _params: Params, meta: SocketMetadata) -> RpcResult { @@ -210,14 +210,14 @@ impl Stratum { future::ok(match self.dispatcher.initial() { Some(initial) => match jsonrpc_core::Value::from_str(&initial) { - Ok(val) => val, + Ok(val) => Ok(val), Err(e) => { warn!(target: "stratum", "Invalid payload: '{}' ({:?})", &initial, e); to_value(&[0u8; 0]) }, }, None => to_value(&[0u8; 0]), - }).boxed() + }.expect("Empty slices are serializable; qed")).boxed() } fn authorize(&self, params: Params, meta: SocketMetadata) -> RpcResult { @@ -231,7 +231,7 @@ impl Stratum { trace!(target: "stratum", "New worker #{} registered", worker_id); self.workers.write().insert(meta.addr().clone(), worker_id); to_value(true) - })).boxed() + }).map(|v| v.expect("Only true/false is returned and it's always serializable; qed"))).boxed() } pub fn subscribers(&self) -> RwLockReadGuard> { diff --git a/updater/Cargo.toml b/updater/Cargo.toml index c0e2c15df..8d0014e14 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -11,7 +11,7 @@ ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] log = "0.3" -ethabi = "0.2.2" +ethabi = "1.0.0" target_info = "0.1" ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } diff --git a/util/src/lib.rs b/util/src/lib.rs index 02804d8b0..720b80869 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -106,14 +106,12 @@ extern crate tiny_keccak; extern crate rlp; extern crate regex; extern crate lru_cache; +extern crate heapsize; +extern crate itertools; -#[macro_use] -extern crate heapsize; #[macro_use] extern crate lazy_static; #[macro_use] -extern crate itertools; -#[macro_use] extern crate log as rlog; pub extern crate using_queue;