From a9aaacd88b99b6d33f71794c8ed959865a5b87de Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 12:19:11 +0200 Subject: [PATCH 01/15] bigint upgraded to version 3.0 --- Cargo.lock | 46 ++++++---- dapps/Cargo.toml | 2 +- dapps/src/apps/fetcher/mod.rs | 2 +- dapps/src/lib.rs | 2 +- dapps/src/tests/fetch.rs | 2 +- dapps/src/tests/helpers/registrar.rs | 2 +- ethcore/Cargo.toml | 1 + ethcore/src/blockchain/blockchain.rs | 2 +- ethcore/src/builtin.rs | 8 +- ethcore/src/client/test_client.rs | 1 + ethcore/src/env_info.rs | 2 - ethcore/src/header.rs | 2 +- ethcore/src/lib.rs | 1 + ethcore/src/miner/transaction_queue.rs | 5 +- ethcore/src/spec/spec.rs | 1 + ethcore/src/state/mod.rs | 1 - ethcore/src/types/receipt.rs | 4 +- ethcore/src/types/transaction.rs | 4 +- ethcore/src/views/block.rs | 2 +- ethcore/src/views/header.rs | 2 +- ethcore/src/views/transaction.rs | 2 +- ethkey/Cargo.toml | 2 +- ethkey/cli/Cargo.toml | 2 +- ethkey/cli/src/main.rs | 4 +- ethkey/src/keypair.rs | 2 +- ethkey/src/lib.rs | 2 +- ethkey/src/signature.rs | 2 +- ethstore/Cargo.toml | 2 +- ethstore/cli/Cargo.toml | 2 +- ethstore/cli/src/main.rs | 2 +- ethstore/src/json/bytes.rs | 2 +- ethstore/src/json/hash.rs | 2 +- ethstore/src/json/id.rs | 2 +- ethstore/src/lib.rs | 2 +- evmbin/Cargo.toml | 1 + evmbin/benches/mod.rs | 4 +- evmbin/src/display/json.rs | 2 +- evmbin/src/main.rs | 4 +- hash-fetch/Cargo.toml | 2 +- hash-fetch/src/lib.rs | 2 +- hash-fetch/src/urlhint.rs | 4 +- hw/Cargo.toml | 2 +- hw/src/ledger.rs | 2 +- hw/src/lib.rs | 2 +- json/Cargo.toml | 2 +- json/src/bytes.rs | 2 +- json/src/hash.rs | 2 +- json/src/lib.rs | 2 +- rpc/Cargo.toml | 2 +- rpc/src/lib.rs | 2 +- rpc/src/v1/helpers/secretstore.rs | 2 +- rpc/src/v1/tests/mocked/eth.rs | 2 +- rpc/src/v1/tests/mocked/parity_set.rs | 2 +- rpc/src/v1/types/bytes.rs | 5 +- rpc/src/v1/types/call_request.rs | 2 +- rpc/src/v1/types/hash.rs | 2 +- rpc/src/v1/types/transaction_request.rs | 2 +- rpc_cli/Cargo.toml | 2 +- secret_store/Cargo.toml | 2 +- secret_store/src/lib.rs | 2 +- secret_store/src/serialization.rs | 2 +- util/Cargo.toml | 4 +- util/benches/bigint.rs | 111 ------------------------ util/bigint/Cargo.toml | 7 +- util/bigint/src/hash.rs | 12 +-- util/bigint/src/lib.rs | 7 +- util/network/Cargo.toml | 1 + util/network/src/discovery.rs | 2 +- util/network/src/handshake.rs | 2 +- util/network/src/lib.rs | 1 + util/rlp/Cargo.toml | 2 +- util/rlp/src/lib.rs | 2 +- util/rlp/src/rlpin.rs | 2 +- util/rlp/src/untrusted_rlp.rs | 4 +- util/src/error.rs | 2 +- util/src/lib.rs | 2 +- util/src/standard.rs | 6 +- 77 files changed, 123 insertions(+), 228 deletions(-) delete mode 100644 util/benches/bigint.rs diff --git a/Cargo.lock b/Cargo.lock index 63597b890..17a28933b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,13 +69,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bigint" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -406,6 +405,7 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (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.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", @@ -417,11 +417,11 @@ dependencies = [ name = "ethcore-bigint" version = "0.1.3" dependencies = [ - "bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -570,6 +570,7 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -597,7 +598,7 @@ dependencies = [ "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "native-contracts 0.1.0", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (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)", @@ -653,7 +654,7 @@ dependencies = [ "rlp 0.2.0", "rocksdb 0.4.5 (git+https://github.com/paritytech/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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.1.0", "table 0.1.0", @@ -682,7 +683,7 @@ version = "0.1.0" dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (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)", @@ -698,7 +699,7 @@ dependencies = [ "lazy_static 0.2.8 (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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -708,7 +709,7 @@ version = "0.1.0" dependencies = [ "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.2.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -725,7 +726,7 @@ dependencies = [ "parking_lot 0.4.0 (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)", + "rustc-hex 1.0.0 (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)", @@ -741,7 +742,7 @@ version = "0.1.0" dependencies = [ "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.1.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -777,6 +778,7 @@ dependencies = [ "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-util 1.7.0", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -896,7 +898,7 @@ dependencies = [ "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1655,7 +1657,7 @@ dependencies = [ "parity-reactor 0.1.0", "parity-ui 1.7.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)", + "rustc-hex 1.0.0 (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)", @@ -1693,7 +1695,7 @@ dependencies = [ "native-contracts 0.1.0", "parity-reactor 0.1.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1769,7 +1771,7 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (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)", @@ -2133,7 +2135,7 @@ dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2193,7 +2195,7 @@ dependencies = [ name = "rpc-cli" version = "1.4.0" dependencies = [ - "bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.7.0", @@ -2213,6 +2215,11 @@ dependencies = [ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustc-hex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rustc-serialize" version = "0.3.19" @@ -2919,7 +2926,7 @@ dependencies = [ "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" -"checksum bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d493e6869ed11b135750f4a4f44d574a52bf8f67e656cdc15b4085316c2098b6" +"checksum bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0673c930652d3d4d6dcd5c45b5db4fa5f8f33994d7323618c43c083b223e8c" "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" "checksum bit-set 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6e1e6fb1c9e3d6fcdec57216a74eaa03e41f52a22f13a16438251d8e88b89da" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" @@ -3077,6 +3084,7 @@ dependencies = [ "checksum rpassword 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d3a99497c5c544e629cc8b359ae5ede321eba5fa8e5a8078f3ced727a976c3f" "checksum rpassword 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab6e42be826e215f30ff830904f8f4a0933c6e2ae890e1af8b408f5bae60081e" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" "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 rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e114e275f7c9b5d50bb52b28f9aac1921209f02aa6077c8b255e21eefaf8ffa" diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index 429ed01f5..ba6cf67ce 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -17,7 +17,7 @@ parity-dapps-glue = "1.7" mime = "0.2" mime_guess = "1.6.1" rand = "0.3" -rustc-serialize = "0.3" +rustc-hex = "1.0" serde = "0.9" serde_derive = "0.9" serde_json = "0.9" diff --git a/dapps/src/apps/fetcher/mod.rs b/dapps/src/apps/fetcher/mod.rs index d621042c4..ff14def7b 100644 --- a/dapps/src/apps/fetcher/mod.rs +++ b/dapps/src/apps/fetcher/mod.rs @@ -23,7 +23,7 @@ mod installers; use std::{fs, env}; use std::path::PathBuf; use std::sync::Arc; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use fetch::{Client as FetchClient, Fetch}; use hash_fetch::urlhint::{URLHintContract, URLHint, URLHintResult}; use parity_reactor::Remote; diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 1cbc446a7..0b93f4e39 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -24,7 +24,7 @@ extern crate futures; extern crate linked_hash_map; extern crate mime_guess; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate time; diff --git a/dapps/src/tests/fetch.rs b/dapps/src/tests/fetch.rs index 51650a963..8abc86196 100644 --- a/dapps/src/tests/fetch.rs +++ b/dapps/src/tests/fetch.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use devtools::http_client; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use tests::helpers::{ serve_with_registrar, serve_with_registrar_and_sync, serve_with_fetch, serve_with_registrar_and_fetch, serve_with_registrar_and_fetch_and_threads, diff --git a/dapps/src/tests/helpers/registrar.rs b/dapps/src/tests/helpers/registrar.rs index 58aad9886..d7890675b 100644 --- a/dapps/src/tests/helpers/registrar.rs +++ b/dapps/src/tests/helpers/registrar.rs @@ -17,7 +17,7 @@ use std::str; use std::sync::Arc; use std::collections::HashMap; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use hash_fetch::urlhint::ContractClient; use util::{Bytes, Address, Mutex, H256, ToPretty}; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 168cf803c..99986d6da 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -46,6 +46,7 @@ num_cpus = "1.2" rand = "0.3" rlp = { path = "../util/rlp" } rust-crypto = "0.2.34" +rustc-hex = "1.0" rustc-serialize = "0.3" semver = "0.6" stats = { path = "../util/stats" } diff --git a/ethcore/src/blockchain/blockchain.rs b/ethcore/src/blockchain/blockchain.rs index 8f66c270d..4412df567 100644 --- a/ethcore/src/blockchain/blockchain.rs +++ b/ethcore/src/blockchain/blockchain.rs @@ -1460,7 +1460,7 @@ impl BlockChain { mod tests { #![cfg_attr(feature="dev", allow(similar_names))] use std::sync::Arc; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::kvdb::KeyValueDB; use util::hash::*; use util::sha3::Hashable; diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs index 90190ac8e..084be4666 100644 --- a/ethcore/src/builtin.rs +++ b/ethcore/src/builtin.rs @@ -500,7 +500,7 @@ mod tests { use super::{Builtin, Linear, ethereum_builtin, Pricer, Modexp}; use ethjson; use util::{U256, BytesRef}; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; #[test] fn identity() { @@ -524,7 +524,6 @@ mod tests { #[test] fn sha256() { - use rustc_serialize::hex::FromHex; let f = ethereum_builtin("sha256"); let i = [0u8; 0]; @@ -548,7 +547,6 @@ mod tests { #[test] fn ripemd160() { - use rustc_serialize::hex::FromHex; let f = ethereum_builtin("ripemd160"); let i = [0u8; 0]; @@ -568,7 +566,6 @@ mod tests { #[test] fn ecrecover() { - use rustc_serialize::hex::FromHex; /*let k = KeyPair::from_secret(b"test".sha3()).unwrap(); let a: Address = From::from(k.public().sha3()); println!("Address: {}", a); @@ -627,7 +624,6 @@ mod tests { #[test] fn modexp() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Modexp { divisor: 20 }), @@ -714,7 +710,6 @@ mod tests { #[test] fn bn128_add() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Linear { base: 0, word: 0 }), @@ -776,7 +771,6 @@ mod tests { #[test] fn bn128_mul() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Linear { base: 0, word: 0 }), diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 19fdd74c8..e656e6c42 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -17,6 +17,7 @@ //! Test client. use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrder}; +use rustc_hex::FromHex; use util::*; use rlp::*; use ethkey::{Generator, Random}; diff --git a/ethcore/src/env_info.rs b/ethcore/src/env_info.rs index cc42008d5..4f6a330b0 100644 --- a/ethcore/src/env_info.rs +++ b/ethcore/src/env_info.rs @@ -76,8 +76,6 @@ impl From for EnvInfo { #[cfg(test)] mod tests { - extern crate rustc_serialize; - use std::str::FromStr; use super::*; use util::{U256, Address}; diff --git a/ethcore/src/header.rs b/ethcore/src/header.rs index aa114c01e..f5bf1dcfd 100644 --- a/ethcore/src/header.rs +++ b/ethcore/src/header.rs @@ -305,7 +305,7 @@ impl HeapSizeOf for Header { #[cfg(test)] mod tests { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use rlp; use super::Header; diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 7dc49fff8..746a737bf 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -99,6 +99,7 @@ extern crate num_cpus; extern crate num; extern crate rand; extern crate rlp; +extern crate rustc_hex; extern crate rustc_serialize; extern crate semver; extern crate stats; diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index d833f8f6a..4e559df2e 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -27,13 +27,13 @@ //! extern crate ethcore_util as util; //! extern crate ethcore; //! extern crate ethkey; -//! extern crate rustc_serialize; +//! extern crate rustc_hex; //! //! use util::{U256, Address}; //! use ethkey::{Random, Generator}; //! use ethcore::miner::{TransactionQueue, RemovalReason, TransactionQueueDetailsProvider, AccountDetails, TransactionOrigin}; //! use ethcore::transaction::*; -//! use rustc_serialize::hex::FromHex; +//! use rustc_hex::FromHex; //! //! #[derive(Default)] //! struct DummyTransactionDetailsProvider; @@ -1422,7 +1422,6 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option for PendingTransaction { #[test] fn sender_test() { - let t: UnverifiedTransaction = decode(&::rustc_serialize::hex::FromHex::from_hex("f85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804").unwrap()); + let t: UnverifiedTransaction = decode(&::rustc_hex::FromHex::from_hex("f85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804").unwrap()); assert_eq!(t.data, b""); assert_eq!(t.gas, U256::from(0x5208u64)); assert_eq!(t.gas_price, U256::from(0x01u64)); @@ -612,7 +612,7 @@ fn should_recover_from_network_specific_signing() { #[test] fn should_agree_with_vitalik() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let test_vector = |tx_data: &str, address: &'static str| { let signed = decode(&FromHex::from_hex(tx_data).unwrap()); diff --git a/ethcore/src/views/block.rs b/ethcore/src/views/block.rs index 463eb7240..f00ca548f 100644 --- a/ethcore/src/views/block.rs +++ b/ethcore/src/views/block.rs @@ -163,7 +163,7 @@ impl<'a> Hashable for BlockView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::H256; use super::BlockView; diff --git a/ethcore/src/views/header.rs b/ethcore/src/views/header.rs index 618728525..4506d98ec 100644 --- a/ethcore/src/views/header.rs +++ b/ethcore/src/views/header.rs @@ -104,7 +104,7 @@ impl<'a> Hashable for HeaderView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::{H256, Address, H2048, U256}; use super::HeaderView; diff --git a/ethcore/src/views/transaction.rs b/ethcore/src/views/transaction.rs index 0b5b2e1ff..11c7fc2f1 100644 --- a/ethcore/src/views/transaction.rs +++ b/ethcore/src/views/transaction.rs @@ -77,7 +77,7 @@ impl<'a> Hashable for TransactionView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::U256; use super::TransactionView; diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 7d038a7f7..342410adc 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -8,7 +8,7 @@ rand = "0.3.14" lazy_static = "0.2" tiny-keccak = "1.2" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -rustc-serialize = "0.3" +rustc-hex = "1.0" ethcore-bigint = { path = "../util/bigint" } rust-crypto = "0.2" byteorder = "1.0" diff --git a/ethkey/cli/Cargo.toml b/ethkey/cli/Cargo.toml index 01cc9849f..b8da13908 100644 --- a/ethkey/cli/Cargo.toml +++ b/ethkey/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] ethkey = { path = "../" } -rustc-serialize = "0.3" +rustc-hex = "1.0" docopt = "0.7" [[bin]] diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index 757c8198f..53a6adb4d 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -15,13 +15,13 @@ // along with Parity. If not, see . extern crate docopt; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate ethkey; use std::{env, fmt, process}; use std::num::ParseIntError; use docopt::Docopt; -use rustc_serialize::hex::{FromHex, FromHexError}; +use rustc_hex::{FromHex, FromHexError}; use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; pub const USAGE: &'static str = r#" diff --git a/ethkey/src/keypair.rs b/ethkey/src/keypair.rs index 8975063d5..5a13d476b 100644 --- a/ethkey/src/keypair.rs +++ b/ethkey/src/keypair.rs @@ -16,7 +16,7 @@ use std::fmt; use secp256k1::key; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use keccak::Keccak256; use super::{Secret, Public, Address, SECP256K1, Error}; diff --git a/ethkey/src/lib.rs b/ethkey/src/lib.rs index 60039b671..e87e198df 100644 --- a/ethkey/src/lib.rs +++ b/ethkey/src/lib.rs @@ -19,7 +19,7 @@ extern crate rand; extern crate lazy_static; extern crate tiny_keccak; extern crate secp256k1; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate ethcore_bigint as bigint; extern crate crypto as rcrypto; extern crate byteorder; diff --git a/ethkey/src/signature.rs b/ethkey/src/signature.rs index 91fe3e2a3..67115c98b 100644 --- a/ethkey/src/signature.rs +++ b/ethkey/src/signature.rs @@ -21,7 +21,7 @@ use std::str::FromStr; use std::hash::{Hash, Hasher}; use secp256k1::{Message as SecpMessage, RecoverableSignature, RecoveryId, Error as SecpError}; use secp256k1::key::{SecretKey, PublicKey}; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use bigint::hash::{H520, H256}; use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address}; diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index a2efaf286..62263d801 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -11,7 +11,7 @@ ethkey = { path = "../ethkey" } serde = "0.9" serde_json = "0.9" serde_derive = "0.9" -rustc-serialize = "0.3" +rustc-hex = "1.0" rust-crypto = "0.2.36" tiny-keccak = "1.0" time = "0.1.34" diff --git a/ethstore/cli/Cargo.toml b/ethstore/cli/Cargo.toml index 28e210cec..09ec9d13f 100644 --- a/ethstore/cli/Cargo.toml +++ b/ethstore/cli/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -rustc-serialize = "0.3" +rustc-hex = "1.0" docopt = "0.7" ethstore = { path = "../" } diff --git a/ethstore/cli/src/main.rs b/ethstore/cli/src/main.rs index 3e8df3a35..b73f06711 100644 --- a/ethstore/cli/src/main.rs +++ b/ethstore/cli/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate rustc_serialize; +extern crate rustc_hex; extern crate docopt; extern crate ethstore; diff --git a/ethstore/src/json/bytes.rs b/ethstore/src/json/bytes.rs index c7ecfec4c..3a48fa2a1 100644 --- a/ethstore/src/json/bytes.rs +++ b/ethstore/src/json/bytes.rs @@ -17,7 +17,7 @@ use std::{ops, str}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::Error; -use rustc_serialize::hex::{ToHex, FromHex, FromHexError}; +use rustc_hex::{ToHex, FromHex, FromHexError}; #[derive(Debug, PartialEq)] pub struct Bytes(Vec); diff --git a/ethstore/src/json/hash.rs b/ethstore/src/json/hash.rs index 328f155c2..43920c3a0 100644 --- a/ethstore/src/json/hash.rs +++ b/ethstore/src/json/hash.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use std::{ops, fmt, str}; -use rustc_serialize::hex::{FromHex, ToHex}; +use rustc_hex::{FromHex, ToHex}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use super::Error; diff --git a/ethstore/src/json/id.rs b/ethstore/src/json/id.rs index 8dfcc3028..a1db0ccc5 100644 --- a/ethstore/src/json/id.rs +++ b/ethstore/src/json/id.rs @@ -16,7 +16,7 @@ //! Universaly unique identifier. use std::{fmt, str}; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use serde::{Deserialize, Serialize, Deserializer, Serializer}; use serde::de::{Visitor, Error as SerdeError}; use super::Error; diff --git a/ethstore/src/lib.rs b/ethstore/src/lib.rs index 06a8259de..65935f89c 100755 --- a/ethstore/src/lib.rs +++ b/ethstore/src/lib.rs @@ -23,7 +23,7 @@ extern crate itertools; extern crate libc; extern crate parking_lot; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate smallvec; diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 55defab7b..c43a48042 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -9,6 +9,7 @@ name = "parity-evm" path = "./src/main.rs" [dependencies] +rustc-hex = "1.0" rustc-serialize = "0.3" docopt = { version = "0.7" } ethcore = { path = "../ethcore" } diff --git a/evmbin/benches/mod.rs b/evmbin/benches/mod.rs index 7ddc50681..a3017c37e 100644 --- a/evmbin/benches/mod.rs +++ b/evmbin/benches/mod.rs @@ -26,14 +26,14 @@ extern crate test; extern crate ethcore; extern crate evm; extern crate ethcore_util; -extern crate rustc_serialize; +extern crate rustc_hex; use self::test::{Bencher, black_box}; use evm::run_vm; use ethcore::action_params::ActionParams; use ethcore_util::U256; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; #[bench] fn simple_loop_usize(b: &mut Bencher) { diff --git a/evmbin/src/display/json.rs b/evmbin/src/display/json.rs index 38265c14c..1791640d6 100644 --- a/evmbin/src/display/json.rs +++ b/evmbin/src/display/json.rs @@ -122,7 +122,7 @@ impl trace::VMTracer for Informant { fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized { let mut vm = Informant::default(); vm.depth = self.depth + 1; - vm.code = code.into_vec(); + vm.code = code.to_vec(); vm.gas_used = self.gas_used; vm } diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index a7d90b90b..ab4ddc4c1 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -19,6 +19,7 @@ #![warn(missing_docs)] #![allow(dead_code)] extern crate ethcore; +extern crate rustc_hex; extern crate rustc_serialize; extern crate docopt; extern crate ethcore_util as util; @@ -26,7 +27,8 @@ extern crate ethcore_util as util; use std::sync::Arc; use std::{fmt, fs}; use docopt::Docopt; -use util::{U256, FromHex, Bytes, Address}; +use rustc_hex::FromHex; +use util::{U256, Bytes, Address}; use ethcore::spec; use ethcore::action_params::ActionParams; diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 600402559..b02a74f64 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -13,7 +13,7 @@ log = "0.3" mime = "0.2" mime_guess = "1.6.1" rand = "0.3" -rustc-serialize = "0.3" +rustc-hex = "1.0" fetch = { path = "../util/fetch" } ethcore-util = { path = "../util" } parity-reactor = { path = "../util/reactor" } diff --git a/hash-fetch/src/lib.rs b/hash-fetch/src/lib.rs index 9019f744d..4952ecea2 100644 --- a/hash-fetch/src/lib.rs +++ b/hash-fetch/src/lib.rs @@ -30,7 +30,7 @@ extern crate mime_guess; extern crate native_contracts; extern crate parity_reactor; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; pub extern crate fetch; diff --git a/hash-fetch/src/urlhint.rs b/hash-fetch/src/urlhint.rs index cd7d2a2c5..bc4b63cf2 100644 --- a/hash-fetch/src/urlhint.rs +++ b/hash-fetch/src/urlhint.rs @@ -17,7 +17,7 @@ //! URLHint Contract use std::sync::Arc; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use mime::Mime; use mime_guess; @@ -209,7 +209,7 @@ fn guess_mime_type(url: &str) -> Option { pub mod tests { use std::sync::Arc; use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use futures::{BoxFuture, Future, IntoFuture}; diff --git a/hw/Cargo.toml b/hw/Cargo.toml index ca236d130..261721470 100644 --- a/hw/Cargo.toml +++ b/hw/Cargo.toml @@ -15,4 +15,4 @@ ethkey = { path = "../ethkey" } ethcore-bigint = { path = "../util/bigint" } [dev-dependencies] -rustc-serialize = "0.3" +rustc-hex = "1.0" diff --git a/hw/src/ledger.rs b/hw/src/ledger.rs index 2f209afa5..0d787588d 100644 --- a/hw/src/ledger.rs +++ b/hw/src/ledger.rs @@ -340,7 +340,7 @@ impl Manager { #[test] fn smoke() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let mut manager = Manager::new().unwrap(); manager.update_devices().unwrap(); for d in &manager.devices { diff --git a/hw/src/lib.rs b/hw/src/lib.rs index a35607305..cda6c2241 100644 --- a/hw/src/lib.rs +++ b/hw/src/lib.rs @@ -22,7 +22,7 @@ extern crate libusb; extern crate ethkey; extern crate ethcore_bigint as bigint; #[macro_use] extern crate log; -#[cfg(test)] extern crate rustc_serialize; +#[cfg(test)] extern crate rustc_hex; mod ledger; diff --git a/json/Cargo.toml b/json/Cargo.toml index 577d0d9e8..d0fec9933 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore-util = { path = "../util" } -rustc-serialize = "0.3" +rustc-hex = "1.0" serde = "0.9" serde_json = "0.9" serde_derive = "0.9" diff --git a/json/src/bytes.rs b/json/src/bytes.rs index 0900ec999..5b474ba7d 100644 --- a/json/src/bytes.rs +++ b/json/src/bytes.rs @@ -19,7 +19,7 @@ use std::fmt; use std::str::FromStr; use std::ops::Deref; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use serde::{Deserialize, Deserializer}; use serde::de::{Error, Visitor}; diff --git a/json/src/hash.rs b/json/src/hash.rs index 78fa77bd9..6a2df6515 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -20,7 +20,7 @@ use std::str::FromStr; use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use util::hash::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048}; diff --git a/json/src/lib.rs b/json/src/lib.rs index b65b18cab..c03b9f439 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate ethcore_util as util; diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index c2fe7fb8a..7b083a3ac 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -15,7 +15,7 @@ multihash ="0.6" order-stat = "0.1" rand = "0.3" rust-crypto = "0.2" -rustc-serialize = "0.3" +rustc-hex = "1.0" semver = "0.6" serde = "0.9" serde_derive = "0.9" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 7b8e207b8..38dafc0a4 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -26,7 +26,7 @@ extern crate futures; extern crate multihash; extern crate order_stat; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate semver; extern crate serde; extern crate serde_json; diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index 43c2c8943..d8d63b5fa 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -99,7 +99,7 @@ fn decrypt_with_shadow_coefficients(mut decrypted_shadow: Public, mut common_sha #[cfg(test)] mod tests { use util::Bytes; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use super::{encrypt_document, decrypt_document, decrypt_document_with_shadow}; #[test] diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 3f158f1c5..29dffe16f 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -18,7 +18,7 @@ use std::str::FromStr; use std::collections::HashMap; use std::sync::Arc; use std::time::{Instant, Duration}; -use rustc_serialize::hex::{FromHex, ToHex}; +use rustc_hex::{FromHex, ToHex}; use time::get_time; use rlp; diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index cff9e710d..443379b4f 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use std::str::FromStr; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use util::{U256, Address}; use ethcore::miner::MinerService; diff --git a/rpc/src/v1/types/bytes.rs b/rpc/src/v1/types/bytes.rs index b290dd5ac..22a74f97d 100644 --- a/rpc/src/v1/types/bytes.rs +++ b/rpc/src/v1/types/bytes.rs @@ -17,10 +17,9 @@ //! Serializable wrapper around vector of bytes use std::fmt; -use rustc_serialize::hex::ToHex; +use rustc_hex::{ToHex, FromHex}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; use serde::de::{Error, Visitor}; -use util::common::FromHex; /// Wrapper structure around vector of bytes. #[derive(Debug, PartialEq, Eq, Default, Hash, Clone)] @@ -98,7 +97,7 @@ impl Visitor for BytesVisitor { mod tests { use super::*; use serde_json; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; #[test] fn test_bytes_serialize() { diff --git a/rpc/src/v1/types/call_request.rs b/rpc/src/v1/types/call_request.rs index 04c9efcaf..71b562e45 100644 --- a/rpc/src/v1/types/call_request.rs +++ b/rpc/src/v1/types/call_request.rs @@ -55,7 +55,7 @@ impl Into for CallRequest { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use serde_json; use v1::types::{U256, H160}; use super::CallRequest; diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index 2f230510d..166aebfa3 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -19,7 +19,7 @@ use std::str::FromStr; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use serde; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use util::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, H2048 as Eth2048}; macro_rules! impl_hash { diff --git a/rpc/src/v1/types/transaction_request.rs b/rpc/src/v1/types/transaction_request.rs index 242c02360..cb74e071b 100644 --- a/rpc/src/v1/types/transaction_request.rs +++ b/rpc/src/v1/types/transaction_request.rs @@ -131,7 +131,7 @@ impl Into for TransactionRequest { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use serde_json; use v1::types::{U256, H160, TransactionCondition}; use super::*; diff --git a/rpc_cli/Cargo.toml b/rpc_cli/Cargo.toml index 2a473a6ab..52fc58fe4 100644 --- a/rpc_cli/Cargo.toml +++ b/rpc_cli/Cargo.toml @@ -9,7 +9,7 @@ version = "1.4.0" [dependencies] futures = "0.1" rpassword = "0.3.0" -bigint = "2.0" +bigint = "3.0" parity-rpc = { path = "../rpc" } parity-rpc-client = { path = "../rpc_client" } ethcore-util = { path = "../util" } diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index d31ebe11d..2d7eccfa4 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -19,7 +19,7 @@ serde_json = "0.9" serde_derive = "0.9" futures = "0.1" futures-cpupool = "0.1" -rustc-serialize = "0.3" +rustc-hex = "1.0" tokio-core = "0.1.6" tokio-io = "0.1.0" tokio-service = "0.1" diff --git a/secret_store/src/lib.rs b/secret_store/src/lib.rs index 209a32cc2..4176bd322 100644 --- a/secret_store/src/lib.rs +++ b/secret_store/src/lib.rs @@ -22,7 +22,7 @@ extern crate futures; extern crate futures_cpupool; extern crate hyper; extern crate parking_lot; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; #[macro_use] diff --git a/secret_store/src/serialization.rs b/secret_store/src/serialization.rs index c88e9edf7..4b42311cf 100644 --- a/secret_store/src/serialization.rs +++ b/secret_store/src/serialization.rs @@ -17,7 +17,7 @@ use std::fmt; use std::cmp::{Ord, PartialOrd, Ordering}; use std::ops::Deref; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use serde::{Serialize, Deserialize, Serializer, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use ethkey::{Public, Secret, Signature}; diff --git a/util/Cargo.toml b/util/Cargo.toml index 0af5635ab..8a0928ff5 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -10,7 +10,7 @@ build = "build.rs" [dependencies] log = "0.3" env_logger = "0.4" -rustc-serialize = "0.3" +rustc-hex = "1.0" rand = "0.3.12" time = "0.1.34" rocksdb = { git = "https://github.com/paritytech/rust-rocksdb" } @@ -26,7 +26,7 @@ ethcore-devtools = { path = "../devtools" } libc = "0.2.7" vergen = "0.1" target_info = "0.1" -ethcore-bigint = { path = "bigint" } +ethcore-bigint = { path = "bigint", features = ["heapsizeof"] } parking_lot = "0.4" using_queue = { path = "using_queue" } table = { path = "table" } diff --git a/util/benches/bigint.rs b/util/benches/bigint.rs deleted file mode 100644 index 59377c511..000000000 --- a/util/benches/bigint.rs +++ /dev/null @@ -1,111 +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 . - -//! benchmarking for bigint -//! should be started with: -//! ```bash -//! multirust run nightly cargo bench -//! ``` - -#![feature(test)] -#![feature(asm)] - -extern crate test; -extern crate ethcore_util; - -use test::{Bencher, black_box}; -use ethcore_util::{U256, U512, U128}; - -#[bench] -fn u256_add(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let zero = black_box(U256::zero()); - (0..n).fold(zero, |old, new| { old.overflowing_add(U256::from(black_box(new))).0 }) - }); -} - -#[bench] -fn u256_sub(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let max = black_box(U256::max_value()); - (0..n).fold(max, |old, new| { old.overflowing_sub(U256::from(black_box(new))).0 }) - }); -} - -#[bench] -fn u512_sub(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let max = black_box(U512::max_value()); - (0..n).fold( - max, - |old, new| { - let new = black_box(new); - let p = new % 2; - old.overflowing_sub(U512([p, p, p, p, p, p, p, new])).0 - } - ) - }); -} - -#[bench] -fn u512_add(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let zero = black_box(U512::zero()); - (0..n).fold(zero, - |old, new| { - let new = black_box(new); - old.overflowing_add(U512([new, new, new, new, new, new, new, new])).0 - }) - }); -} - -#[bench] -fn u256_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let one = black_box(U256::one()); - (0..n).fold(one, |old, new| { old.overflowing_mul(U256::from(black_box(new))).0 }) - }); -} - - -#[bench] -fn u256_full_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let one = black_box(U256::one()); - (0..n).fold(one, - |old, new| { - let new = black_box(new); - let U512(ref u512words) = old.full_mul(U256([new, new, new, new])); - U256([u512words[0], u512words[2], u512words[2], u512words[3]]) - }) - }); -} - - -#[bench] -fn u128_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - (0..n).fold(U128([12345u64, 0u64]), |old, new| { old.overflowing_mul(U128::from(new)).0 }) - }); -} - diff --git a/util/bigint/Cargo.toml b/util/bigint/Cargo.toml index c1225f72c..477925334 100644 --- a/util/bigint/Cargo.toml +++ b/util/bigint/Cargo.toml @@ -8,12 +8,13 @@ version = "0.1.3" authors = ["Parity Technologies "] [dependencies] -bigint = "2.0" -rustc-serialize = "0.3" -heapsize = "0.4" +bigint = "3.0" +rustc-hex = "1.0" rand = "0.3.12" libc = "0.2" +heapsize = { version = "0.4", optional = true } [features] x64asm_arithmetic=[] rust_arithmetic=[] +heapsizeof = ["heapsize", "bigint/heapsizeof"] diff --git a/util/bigint/src/hash.rs b/util/bigint/src/hash.rs index 942ffc6fb..748236285 100644 --- a/util/bigint/src/hash.rs +++ b/util/bigint/src/hash.rs @@ -8,15 +8,14 @@ //! General hash types, a fixed-size raw-data type used as the output of hash functions. -use std::{ops, fmt, cmp}; +use std::{ops, fmt, cmp, str}; use std::cmp::{min, Ordering}; use std::ops::{Deref, DerefMut, BitXor, BitAnd, BitOr, IndexMut, Index}; use std::hash::{Hash, Hasher, BuildHasherDefault}; use std::collections::{HashMap, HashSet}; -use std::str::FromStr; use rand::Rng; use rand::os::OsRng; -use rustc_serialize::hex::{FromHex, FromHexError}; +use rustc_hex::{FromHex, FromHexError}; use bigint::U256; use libc::{c_void, memcmp}; @@ -141,7 +140,7 @@ macro_rules! impl_hash { } } - impl FromStr for $from { + impl str::FromStr for $from { type Err = FromHexError; fn from_str(s: &str) -> Result<$from, FromHexError> { @@ -349,9 +348,9 @@ macro_rules! impl_hash { fn from(s: &'static str) -> $from { let s = clean_0x(s); if s.len() % 2 == 1 { - $from::from_str(&("0".to_owned() + s)).unwrap() + ("0".to_owned() + s).parse().unwrap() } else { - $from::from_str(s).unwrap() + s.parse().unwrap() } } } @@ -435,6 +434,7 @@ impl_hash!(H520, 65); impl_hash!(H1024, 128); impl_hash!(H2048, 256); +#[cfg(feature="heapsizeof")] known_heap_size!(0, H32, H64, H128, H160, H256, H264, H512, H520, H1024, H2048); // Specialized HashMap and HashSet diff --git a/util/bigint/src/lib.rs b/util/bigint/src/lib.rs index ed22bfcfb..7a85de6a1 100644 --- a/util/bigint/src/lib.rs +++ b/util/bigint/src/lib.rs @@ -11,10 +11,13 @@ #![cfg_attr(asm_available, feature(asm))] extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate bigint; extern crate libc; -#[macro_use] extern crate heapsize; + +#[cfg(feature="heapsizeof")] +#[macro_use] +extern crate heapsize; pub mod hash; diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index edbbefd17..63b5ad50e 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -20,6 +20,7 @@ igd = "0.6" libc = "0.2.7" parking_lot = "0.4" ansi_term = "0.9" +rustc-hex = "1.0" rustc-serialize = "0.3" ethcore-io = { path = "../io" } ethcore-util = { path = ".." } diff --git a/util/network/src/discovery.rs b/util/network/src/discovery.rs index ad995188d..138ba23ba 100644 --- a/util/network/src/discovery.rs +++ b/util/network/src/discovery.rs @@ -559,7 +559,7 @@ mod tests { use node_table::{Node, NodeId, NodeEndpoint}; use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use ethkey::{Random, Generator}; use AllowIP; diff --git a/util/network/src/handshake.rs b/util/network/src/handshake.rs index 9f6474c39..f5c4e118a 100644 --- a/util/network/src/handshake.rs +++ b/util/network/src/handshake.rs @@ -331,7 +331,7 @@ impl Handshake { #[cfg(test)] mod test { use std::sync::Arc; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use super::*; use util::hash::H256; use io::*; diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index 8fae474ff..80654d503 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -66,6 +66,7 @@ extern crate crypto as rcrypto; extern crate rand; extern crate time; extern crate ansi_term; //TODO: remove this +extern crate rustc_hex; extern crate rustc_serialize; extern crate igd; extern crate libc; diff --git a/util/rlp/Cargo.toml b/util/rlp/Cargo.toml index b6ca67984..aa682e469 100644 --- a/util/rlp/Cargo.toml +++ b/util/rlp/Cargo.toml @@ -10,5 +10,5 @@ authors = ["Parity Technologies "] elastic-array = "0.9" ethcore-bigint = { path = "../bigint" } lazy_static = "0.2" -rustc-serialize = "0.3" +rustc-hex = "1.0" byteorder = "1.0" diff --git a/util/rlp/src/lib.rs b/util/rlp/src/lib.rs index e7e20b17d..f7596b2bc 100644 --- a/util/rlp/src/lib.rs +++ b/util/rlp/src/lib.rs @@ -41,7 +41,7 @@ extern crate byteorder; extern crate ethcore_bigint as bigint; extern crate elastic_array; -extern crate rustc_serialize; +extern crate rustc_hex; #[macro_use] extern crate lazy_static; diff --git a/util/rlp/src/rlpin.rs b/util/rlp/src/rlpin.rs index 918db4d0c..f4f3d3d58 100644 --- a/util/rlp/src/rlpin.rs +++ b/util/rlp/src/rlpin.rs @@ -273,7 +273,7 @@ impl<'a, 'view> Iterator for RlpIterator<'a, 'view> { #[test] fn break_it() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use bigint::prelude::U256; let h: Vec = FromHex::from_hex("f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470").unwrap(); diff --git a/util/rlp/src/untrusted_rlp.rs b/util/rlp/src/untrusted_rlp.rs index bc47dee0f..c027438b0 100644 --- a/util/rlp/src/untrusted_rlp.rs +++ b/util/rlp/src/untrusted_rlp.rs @@ -8,7 +8,7 @@ use std::cell::Cell; use std::fmt; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use impls::decode_usize; use {Decodable, DecoderError}; @@ -389,7 +389,7 @@ mod tests { #[test] fn test_rlp_display() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let data = "f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470".from_hex().unwrap(); let rlp = UntrustedRlp::new(&data); assert_eq!(format!("{}", rlp), "[\"0x05\", \"0x010efbef67941f79b2\", \"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\", \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\"]"); diff --git a/util/src/error.rs b/util/src/error.rs index 5fcc6fd8f..4ed2fc9bd 100644 --- a/util/src/error.rs +++ b/util/src/error.rs @@ -16,7 +16,7 @@ //! General error types for use in ethcore. -use rustc_serialize::hex::FromHexError; +use rustc_hex::FromHexError; use rlp::DecoderError; use std::fmt; use hash::H256; diff --git a/util/src/lib.rs b/util/src/lib.rs index 5c988bbbc..c6a50f58b 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -87,7 +87,7 @@ //! cargo build --release //! ``` -extern crate rustc_serialize; +extern crate rustc_hex; extern crate rand; extern crate rocksdb; extern crate env_logger; diff --git a/util/src/standard.rs b/util/src/standard.rs index 6363eecd8..19521a5d5 100644 --- a/util/src/standard.rs +++ b/util/src/standard.rs @@ -39,11 +39,7 @@ pub use std::cmp::*; pub use std::sync::Arc; pub use std::collections::*; -pub use rustc_serialize::json::Json; -pub use rustc_serialize::base64::FromBase64; -pub use rustc_serialize::hex::{FromHex, FromHexError}; - pub use heapsize::HeapSizeOf; pub use itertools::Itertools; -pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; \ No newline at end of file +pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; From 286526072fa5dfc3f355773b623af89fe3b20760 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 14:31:16 +0200 Subject: [PATCH 02/15] migrated ethkey, ethstore, evmbin and parity executables to serde 1.0 --- Cargo.lock | 49 ++++++++++++++++++++++----------- Cargo.toml | 11 ++++---- ethkey/cli/Cargo.toml | 4 ++- ethkey/cli/src/main.rs | 16 ++++++++--- ethstore/cli/Cargo.toml | 4 ++- ethstore/cli/src/main.rs | 58 +++++++++++++++++++++++++++++----------- evmbin/Cargo.toml | 5 ++-- evmbin/src/main.rs | 8 +++--- parity/blockchain.rs | 2 +- parity/cli/mod.rs | 34 +++++++++++------------ parity/cli/usage.rs | 46 ++++++++----------------------- parity/main.rs | 4 ++- parity/user_defaults.rs | 16 +++++------ 13 files changed, 150 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17a28933b..ec2d1ec88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,12 +295,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "docopt" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -707,9 +708,11 @@ dependencies = [ name = "ethkey-cli" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.2.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -740,9 +743,11 @@ dependencies = [ name = "ethstore-cli" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -775,11 +780,12 @@ dependencies = [ name = "evmbin" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-util 1.7.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1587,7 +1593,7 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)", "daemonize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-devtools 1.7.0", @@ -1624,13 +1630,14 @@ dependencies = [ "rlp 0.2.0", "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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", + "toml 0.4.2 (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)", ] @@ -2373,6 +2380,17 @@ dependencies = [ "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_json" +version = "1.0.2" +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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "serde_urlencoded" version = "0.4.1" @@ -2736,10 +2754,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.2.0" +version = "0.4.2" 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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2955,7 +2973,7 @@ 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 difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" -"checksum docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab32ea6e284d87987066f21a9e809a73c14720571ef34516f0890b3d355ccfd8" +"checksum docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b5b93718f8b3e5544fcc914c43de828ca6c6ace23e0332c6080a2977b49787a" "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.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258ff6a9a94f648d0379dbd79110e057edbb53eb85cc237e33eadf8e5a30df85" @@ -3104,6 +3122,7 @@ dependencies = [ "checksum serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd81eef9f0b4ec341b11095335b6a4b28ed85581b12dd27585dee1529df35e0" "checksum serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "021c338d22c7e30f957a6ab7e388cb6098499dda9fd4ba1661ee074ca7a180d1" "checksum serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cf37ce931677e98b4fa5e6469aaa3ab4b6228309ea33b1b22d3ec055adfc4515" +"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" "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" @@ -3143,7 +3162,7 @@ dependencies = [ "checksum tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86f33def658c14724fc13ec6289b3875a8152ee8ae767a5b1ccbded363b03db8" "checksum tokio-uds 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bd209039933255ea77c6d7a1d18abc20b997d161acb900acca6eb74cdd049f31" "checksum toml 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "fcd27a04ca509aff336ba5eb2abc58d456f52c4ff64d9724d88acb85ead560b6" -"checksum toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a442dfc13508e603c3f763274361db7f79d7469a0e95c411cde53662ab30fc72" +"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "715254c8f0811be1a79ad3ea5e6fa3c8eddec2b03d7f5ba78cf093e56d79c24f" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" diff --git a/Cargo.toml b/Cargo.toml index d9b3734ec..429ea0dd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ build = "build.rs" [dependencies] log = "0.3" env_logger = "0.4" -rustc-serialize = "0.3" -docopt = "0.7" +rustc-hex = "1.0" +docopt = "0.8" time = "0.1" num_cpus = "1.2" number_prefix = "0.2" @@ -19,9 +19,10 @@ semver = "0.6" ansi_term = "0.9" regex = "0.2" isatty = "0.1" -toml = "0.2" -serde = "0.9" -serde_json = "0.9" +toml = "0.4" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" app_dirs = "1.1.1" futures = "0.1" fdlimit = "0.1" diff --git a/ethkey/cli/Cargo.toml b/ethkey/cli/Cargo.toml index b8da13908..3ea931e25 100644 --- a/ethkey/cli/Cargo.toml +++ b/ethkey/cli/Cargo.toml @@ -5,8 +5,10 @@ authors = ["Parity Technologies "] [dependencies] ethkey = { path = "../" } +serde = "1.0" +serde_derive = "1.0" rustc-hex = "1.0" -docopt = "0.7" +docopt = "0.8" [[bin]] name = "ethkey" diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index 53a6adb4d..0d96c2a89 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -16,6 +16,9 @@ extern crate docopt; extern crate rustc_hex; +extern crate serde; +#[macro_use] +extern crate serde_derive; extern crate ethkey; use std::{env, fmt, process}; @@ -54,7 +57,7 @@ Commands: verify Verify signer of the signature. "#; -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_info: bool, cmd_generate: bool, @@ -83,6 +86,7 @@ enum Error { Ethkey(EthkeyError), FromHex(FromHexError), ParseInt(ParseIntError), + Docopt(docopt::Error), } impl From for Error { @@ -103,12 +107,19 @@ impl From for Error { } } +impl From for Error { + fn from(err: docopt::Error) -> Self { + Error::Docopt(err) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { Error::Ethkey(ref e) => write!(f, "{}", e), Error::FromHex(ref e) => write!(f, "{}", e), Error::ParseInt(ref e) => write!(f, "{}", e), + Error::Docopt(ref e) => write!(f, "{}", e), } } } @@ -155,8 +166,7 @@ fn display(keypair: KeyPair, mode: DisplayMode) -> String { fn execute(command: I) -> Result where I: IntoIterator, S: AsRef { let args: Args = Docopt::new(USAGE) - .and_then(|d| d.argv(command).decode()) - .unwrap_or_else(|e| e.exit()); + .and_then(|d| d.argv(command).deserialize())?; return if args.cmd_info { let display_mode = DisplayMode::new(&args); diff --git a/ethstore/cli/Cargo.toml b/ethstore/cli/Cargo.toml index 09ec9d13f..80d20f792 100644 --- a/ethstore/cli/Cargo.toml +++ b/ethstore/cli/Cargo.toml @@ -5,7 +5,9 @@ authors = ["Parity Technologies "] [dependencies] rustc-hex = "1.0" -docopt = "0.7" +serde = "1.0" +serde_derive = "1.0" +docopt = "0.8" ethstore = { path = "../" } [[bin]] diff --git a/ethstore/cli/src/main.rs b/ethstore/cli/src/main.rs index b73f06711..06ebfcd20 100644 --- a/ethstore/cli/src/main.rs +++ b/ethstore/cli/src/main.rs @@ -16,14 +16,17 @@ extern crate rustc_hex; extern crate docopt; +extern crate serde; +#[macro_use] +extern crate serde_derive; extern crate ethstore; -use std::{env, process, fs}; +use std::{env, process, fs, fmt}; use std::io::Read; use docopt::Docopt; use ethstore::ethkey::Address; use ethstore::dir::{paths, KeyDirectory, RootDiskDirectory}; -use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, Error, PresaleWallet, +use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, SecretVaultRef, StoreAccountRef}; pub const USAGE: &'static str = r#" @@ -75,7 +78,7 @@ Commands: move-from-vault Move account to root directory from given vault. "#; -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_insert: bool, cmd_change_pwd: bool, @@ -104,6 +107,32 @@ struct Args { flag_vault_pwd: String, } +enum Error { + Ethstore(ethstore::Error), + Docopt(docopt::Error), +} + +impl From for Error { + fn from(err: ethstore::Error) -> Self { + Error::Ethstore(err) + } +} + +impl From for Error { + fn from(err: docopt::Error) -> Self { + Error::Docopt(err) + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::Ethstore(ref err) => fmt::Display::fmt(err, f), + Error::Docopt(ref err) => fmt::Display::fmt(err, f), + } + } +} + fn main() { match execute(env::args()) { Ok(result) => println!("{}", result), @@ -159,9 +188,9 @@ fn format_vaults(vaults: &[String]) -> String { } fn load_password(path: &str) -> Result { - let mut file = fs::File::open(path).map_err(|e| Error::Custom(format!("Error opening password file {}: {}", path, e)))?; + let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file {}: {}", path, e)))?; let mut password = String::new(); - file.read_to_string(&mut password).map_err(|e| Error::Custom(format!("Error reading password file {}: {}", path, e)))?; + file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file {}: {}", path, e)))?; // drop EOF let _ = password.pop(); Ok(password) @@ -169,19 +198,18 @@ fn load_password(path: &str) -> Result { fn execute(command: I) -> Result where I: IntoIterator, S: AsRef { let args: Args = Docopt::new(USAGE) - .and_then(|d| d.argv(command).decode()) - .unwrap_or_else(|e| e.exit()); + .and_then(|d| d.argv(command).deserialize())?; let store = EthStore::open(key_dir(&args.flag_dir)?)?; return if args.cmd_insert { - let secret = args.arg_secret.parse().map_err(|_| Error::InvalidSecret)?; + let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?; let password = load_password(&args.arg_password)?; let vault_ref = open_args_vault(&store, &args)?; let address = store.insert_account(vault_ref, secret, &password)?; Ok(format!("0x{:?}", address)) } else if args.cmd_change_pwd { - let address = args.arg_address.parse().map_err(|_| Error::InvalidAccount)?; + let address = args.arg_address.parse().map_err(|_| ethstore::Error::InvalidAccount)?; let old_pwd = load_password(&args.arg_old_pwd)?; let new_pwd = load_password(&args.arg_new_pwd)?; let account_ref = open_args_vault_account(&store, address, &args)?; @@ -209,20 +237,20 @@ fn execute(command: I) -> Result where I: IntoIterator(command: I) -> Result where I: IntoIterator(args: Args, mut informant: T) { informant.finish(result); } -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_stats: bool, flag_from: Option, diff --git a/parity/blockchain.rs b/parity/blockchain.rs index 17e486b5b..26de04f95 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -20,7 +20,7 @@ use std::io::{BufReader, BufRead}; use std::time::{Instant, Duration}; use std::thread::sleep; use std::sync::Arc; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use util::{ToPretty, U256, H256, Address, Hashable}; use rlp::PayloadInfo; use ethcore::service::ClientService; diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 5aea26000..2b678659c 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -381,7 +381,7 @@ usage! { } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Config { parity: Option, account: Option, @@ -401,7 +401,7 @@ struct Config { stratum: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Operating { mode: Option, mode_timeout: Option, @@ -420,7 +420,7 @@ struct Operating { no_persistent_txqueue: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Account { unlock: Option>, password: Option>, @@ -429,7 +429,7 @@ struct Account { fast_unlock: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ui { force: Option, disable: Option, @@ -439,7 +439,7 @@ struct Ui { path: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Network { warp: Option, port: Option, @@ -458,7 +458,7 @@ struct Network { no_serve_light: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Rpc { disable: Option, port: Option, @@ -469,7 +469,7 @@ struct Rpc { threads: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ws { disable: Option, port: Option, @@ -479,14 +479,14 @@ struct Ws { hosts: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ipc { disable: Option, path: Option, apis: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Dapps { disable: Option, port: Option, @@ -498,7 +498,7 @@ struct Dapps { pass: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct SecretStore { disable: Option, self_secret: Option, @@ -510,7 +510,7 @@ struct SecretStore { path: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ipfs { enable: Option, port: Option, @@ -519,7 +519,7 @@ struct Ipfs { hosts: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Mining { author: Option, engine_signer: Option, @@ -547,14 +547,14 @@ struct Mining { refuse_service_transactions: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Stratum { interface: Option, port: Option, secret: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Footprint { tracing: Option, pruning: Option, @@ -572,17 +572,17 @@ struct Footprint { num_verifiers: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Snapshots { disable_periodic: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct VM { jit: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Misc { logging: Option, log_file: Option, diff --git a/parity/cli/usage.rs b/parity/cli/usage.rs index 949106ae7..26f697ed8 100644 --- a/parity/cli/usage.rs +++ b/parity/cli/usage.rs @@ -55,28 +55,18 @@ macro_rules! usage { use util::version; use docopt::{Docopt, Error as DocoptError}; use helpers::replace_home; - use rustc_serialize; #[derive(Debug)] pub enum ArgsError { Docopt(DocoptError), - Parsing(Vec), - Decode(toml::DecodeError), + Decode(toml::de::Error), Config(String, io::Error), - UnknownFields(String), } impl ArgsError { pub fn exit(self) -> ! { match self { ArgsError::Docopt(e) => e.exit(), - ArgsError::Parsing(errors) => { - println_stderr!("There is an error in config file."); - for e in &errors { - println_stderr!("{}", e); - } - process::exit(2) - }, ArgsError::Decode(e) => { println_stderr!("You might have supplied invalid parameters in config file."); println_stderr!("{}", e); @@ -87,21 +77,20 @@ macro_rules! usage { println_stderr!("{}", e); process::exit(2) }, - ArgsError::UnknownFields(fields) => { - println_stderr!("You have some extra fields in your config file:"); - println_stderr!("{}", fields); - process::exit(2) - } } } } impl From for ArgsError { - fn from(e: DocoptError) -> Self { ArgsError::Docopt(e) } + fn from(e: DocoptError) -> Self { + ArgsError::Docopt(e) + } } - impl From for ArgsError { - fn from(e: toml::DecodeError) -> Self { ArgsError::Decode(e) } + impl From for ArgsError { + fn from(e: toml::de::Error) -> Self { + ArgsError::Decode(e) + } } #[derive(Debug, PartialEq)] @@ -137,7 +126,7 @@ macro_rules! usage { } } - #[derive(Default, Debug, PartialEq, Clone, RustcDecodable)] + #[derive(Default, Debug, PartialEq, Clone, Deserialize)] struct RawArgs { $( $field_a: $typ_a, @@ -192,20 +181,7 @@ macro_rules! usage { } fn parse_config(config: &str) -> Result { - let mut value_parser = toml::Parser::new(&config); - match value_parser.parse() { - Some(value) => { - let mut decoder = toml::Decoder::new(toml::Value::Table(value)); - let result = rustc_serialize::Decodable::decode(&mut decoder); - - match (result, decoder.toml) { - (Err(e), _) => Err(e.into()), - (_, Some(toml)) => Err(ArgsError::UnknownFields(toml::encode_str(&toml))), - (Ok(config), None) => Ok(config), - } - }, - None => Err(ArgsError::Parsing(value_parser.errors)), - } + Ok(toml::from_str(config)?) } pub fn print_version() -> String { @@ -229,7 +205,7 @@ macro_rules! usage { } pub fn parse>(command: &[S]) -> Result { - Docopt::new(Self::usage()).and_then(|d| d.argv(command).decode()) + Docopt::new(Self::usage()).and_then(|d| d.argv(command).deserialize()) } fn usage() -> String { diff --git a/parity/main.rs b/parity/main.rs index 65a621adf..dc009ff62 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -36,10 +36,12 @@ extern crate number_prefix; extern crate regex; extern crate rlp; extern crate rpassword; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate semver; extern crate serde; extern crate serde_json; +#[macro_use] +extern crate serde_derive; extern crate time; extern crate toml; diff --git a/parity/user_defaults.rs b/parity/user_defaults.rs index cc1d8197b..12bb9937f 100644 --- a/parity/user_defaults.rs +++ b/parity/user_defaults.rs @@ -21,8 +21,8 @@ use std::path::Path; use std::collections::BTreeMap; use std::time::Duration; use serde::{Serialize, Serializer, Deserialize, Deserializer}; -use serde::de::{Error, Visitor, MapVisitor}; -use serde::de::impls::BTreeMapVisitor; +use serde::de::{Error, Visitor, MapAccess}; +use serde::de::value::MapAccessDeserializer; use serde_json::Value; use serde_json::de::from_reader; use serde_json::ser::to_string; @@ -65,22 +65,22 @@ impl Serialize for UserDefaults { struct UserDefaultsVisitor; -impl Deserialize for UserDefaults { +impl<'a> Deserialize<'a> for UserDefaults { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UserDefaultsVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UserDefaultsVisitor) } } -impl Visitor for UserDefaultsVisitor { +impl<'a> Visitor<'a> for UserDefaultsVisitor { type Value = UserDefaults; 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)?; + fn visit_map(self, visitor: V) -> Result where V: MapAccess<'a> { + let mut map: BTreeMap = Deserialize::deserialize(MapAccessDeserializer::new(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"))?; let pruning = pruning.parse().map_err(|_| Error::custom("invalid pruning method"))?; From 9c911c7a28eaec1d618d01442361a77a129176bd Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 17:00:42 +0200 Subject: [PATCH 03/15] migrated ethjson to serde 1.0 --- Cargo.lock | 6 +++--- json/Cargo.toml | 6 +++--- json/src/bytes.rs | 8 ++++---- json/src/hash.rs | 8 ++++---- json/src/maybe.rs | 11 +++++------ json/src/spec/ethash.rs | 2 ++ json/src/trie/input.rs | 20 ++++++++++---------- json/src/uint.rs | 8 ++++---- 8 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec2d1ec88..cddda146c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -685,9 +685,9 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "rustc-hex 1.0.0 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/json/Cargo.toml b/json/Cargo.toml index d0fec9933..81af58ac7 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -6,8 +6,8 @@ authors = ["Parity Technologies "] [dependencies] ethcore-util = { path = "../util" } rustc-hex = "1.0" -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" clippy = { version = "0.0.103", optional = true} diff --git a/json/src/bytes.rs b/json/src/bytes.rs index 5b474ba7d..79ba4f896 100644 --- a/json/src/bytes.rs +++ b/json/src/bytes.rs @@ -67,16 +67,16 @@ impl FromStr for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(BytesVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(BytesVisitor) } } struct BytesVisitor; -impl Visitor for BytesVisitor { +impl<'a> Visitor<'a> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/json/src/hash.rs b/json/src/hash.rs index 6a2df6515..64da93e1c 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -42,13 +42,13 @@ macro_rules! impl_hash { } } - impl Deserialize for $name { + impl<'a> Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -75,7 +75,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/json/src/maybe.rs b/json/src/maybe.rs index 16a01dc44..075aaefbd 100644 --- a/json/src/maybe.rs +++ b/json/src/maybe.rs @@ -4,8 +4,7 @@ use std::fmt; use std::marker::PhantomData; use serde::{Deserialize, Deserializer}; -use serde::de::{Error, Visitor}; -use serde::de::value::ValueDeserializer; +use serde::de::{Error, Visitor, IntoDeserializer}; /// Deserializer of empty string values into optionals. #[derive(Debug, PartialEq, Clone)] @@ -16,10 +15,10 @@ pub enum MaybeEmpty { None, } -impl Deserialize for MaybeEmpty where T: Deserialize { +impl<'a, T> Deserialize<'a> for MaybeEmpty where T: Deserialize<'a> { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(MaybeEmptyVisitor::new()) + where D: Deserializer<'a> { + deserializer.deserialize_any(MaybeEmptyVisitor::new()) } } @@ -35,7 +34,7 @@ impl MaybeEmptyVisitor { } } -impl Visitor for MaybeEmptyVisitor where T: Deserialize { +impl<'a, T> Visitor<'a> for MaybeEmptyVisitor where T: Deserialize<'a> { type Value = MaybeEmpty; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index 44edb5288..f3391e067 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -236,6 +236,7 @@ mod tests { eip161d_transition: Some(Uint(U256::from(0x47))), ecip1010_pause_transition: None, ecip1010_continue_transition: None, + ecip1017_era_rounds: None, max_code_size: None, max_gas_limit_transition: None, max_gas_limit: None, @@ -282,6 +283,7 @@ mod tests { eip161d_transition: None, ecip1010_pause_transition: None, ecip1010_continue_transition: None, + ecip1017_era_rounds: None, max_code_size: None, max_gas_limit_transition: None, max_gas_limit: None, diff --git a/json/src/trie/input.rs b/json/src/trie/input.rs index 86614294e..c84f1aa1e 100644 --- a/json/src/trie/input.rs +++ b/json/src/trie/input.rs @@ -21,7 +21,7 @@ use std::collections::BTreeMap; use std::str::FromStr; use bytes::Bytes; use serde::{Deserialize, Deserializer}; -use serde::de::{Error as ErrorTrait, Visitor, MapVisitor, SeqVisitor}; +use serde::de::{Error as ErrorTrait, Visitor, MapAccess, SeqAccess}; /// Trie test input. #[derive(Debug, PartialEq)] @@ -30,35 +30,35 @@ pub struct Input { pub data: BTreeMap>, } -impl Deserialize for Input { +impl<'a> Deserialize<'a> for Input { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(InputVisitor) + deserializer.deserialize_any(InputVisitor) } } struct InputVisitor; -impl Visitor for InputVisitor { +impl<'a> Visitor<'a> for InputVisitor { type Value = Input; 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 { + fn visit_map(self, mut visitor: V) -> Result where V: MapAccess<'a> { let mut result = BTreeMap::new(); loop { - let key_str: Option = visitor.visit_key()?; + let key_str: Option = visitor.next_key()?; let key = match key_str { 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_str: Option = visitor.next_value()?; let val = match val_str { 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())), @@ -75,11 +75,11 @@ impl Visitor for InputVisitor { Ok(input) } - fn visit_seq(self, mut visitor: V) -> Result where V: SeqVisitor { + fn visit_seq(self, mut visitor: V) -> Result where V: SeqAccess<'a> { let mut result = BTreeMap::new(); loop { - let keyval: Option>> = visitor.visit()?; + let keyval: Option>> = visitor.next_element()?; let keyval = match keyval { Some(k) => k, _ => { break; }, diff --git a/json/src/uint.rs b/json/src/uint.rs index d408b76dc..5e98a9dca 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -50,16 +50,16 @@ impl Into for Uint { } } -impl Deserialize for Uint { +impl<'a> Deserialize<'a> for Uint { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UintVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UintVisitor) } } struct UintVisitor; -impl Visitor for UintVisitor { +impl<'a> Visitor<'a> for UintVisitor { type Value = Uint; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { From 972d30c288ff331b5ced82c8b330f48a704b05ef Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 17:23:06 +0200 Subject: [PATCH 04/15] migrated ethcore, ethstore, secret_store, updater and hash-fetch to serde 1.0 --- Cargo.lock | 36 +++++++++---------- ethcore/Cargo.toml | 2 +- ethcore/native_contracts/Cargo.toml | 2 +- ethcore/native_contracts/generator/Cargo.toml | 2 +- ethcore/native_contracts/generator/src/lib.rs | 2 +- ethstore/Cargo.toml | 6 ++-- ethstore/src/json/bytes.rs | 4 +-- ethstore/src/json/cipher.rs | 12 +++---- ethstore/src/json/crypto.rs | 32 ++++++++--------- ethstore/src/json/hash.rs | 8 ++--- ethstore/src/json/id.rs | 8 ++--- ethstore/src/json/kdf.rs | 20 +++++------ ethstore/src/json/key_file.rs | 36 +++++++++---------- ethstore/src/json/version.rs | 8 ++--- hash-fetch/Cargo.toml | 2 +- secret_store/Cargo.toml | 8 ++--- secret_store/src/serialization.rs | 36 +++++++++---------- updater/Cargo.toml | 2 +- 18 files changed, 113 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cddda146c..472fe96c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,13 +346,13 @@ dependencies = [ [[package]] name = "ethabi" -version = "1.0.5" +version = "2.0.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)", - "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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -377,7 +377,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.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.7.0", "ethcore-bloom-journal 0.1.0", "ethcore-devtools 1.7.0", @@ -583,7 +583,7 @@ name = "ethcore-secretstore" version = "1.0.0" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-devtools 1.7.0", "ethcore-ipc 1.7.0", @@ -600,9 +600,9 @@ dependencies = [ "native-contracts 0.1.0", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -730,9 +730,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-hex 1.0.0 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1399,7 +1399,7 @@ dependencies = [ name = "native-contract-generator" version = "0.1.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1408,7 +1408,7 @@ name = "native-contracts" version = "0.1.0" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "native-contract-generator 0.1.0", @@ -1692,7 +1692,7 @@ dependencies = [ name = "parity-hash-fetch" version = "1.7.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "fetch 0.1.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1852,7 +1852,7 @@ dependencies = [ name = "parity-updater" version = "1.7.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", @@ -2979,7 +2979,7 @@ dependencies = [ "checksum elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258ff6a9a94f648d0379dbd79110e057edbb53eb85cc237e33eadf8e5a30df85" "checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" "checksum eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)" = "" -"checksum ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "65f71b9ac0b0f8e6230d32dbf5acf7c2c61334af1148175d0a7e72b14c3d475e" +"checksum ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3d62319ee0f35abf20afe8859dd2668195912614346447bb2dee9fb8da7c62" "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 fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 99986d6da..0a2909dd2 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ byteorder = "1.0" clippy = { version = "0.0.103", optional = true} crossbeam = "0.2.9" env_logger = "0.4" -ethabi = "1.0" +ethabi = "2.0" ethash = { path = "../ethash" } ethcore-bloom-journal = { path = "../util/bloom" } ethcore-devtools = { path = "../devtools" } diff --git a/ethcore/native_contracts/Cargo.toml b/ethcore/native_contracts/Cargo.toml index 6b225220f..5dc18c8f5 100644 --- a/ethcore/native_contracts/Cargo.toml +++ b/ethcore/native_contracts/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] build = "build.rs" [dependencies] -ethabi = "1.0" +ethabi = "2.0" futures = "0.1" byteorder = "1.0" ethcore-util = { path = "../../util" } diff --git a/ethcore/native_contracts/generator/Cargo.toml b/ethcore/native_contracts/generator/Cargo.toml index a114420f0..a599e756e 100644 --- a/ethcore/native_contracts/generator/Cargo.toml +++ b/ethcore/native_contracts/generator/Cargo.toml @@ -5,5 +5,5 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethabi = "1.0" +ethabi = "2.0" heck = "0.2" diff --git a/ethcore/native_contracts/generator/src/lib.rs b/ethcore/native_contracts/generator/src/lib.rs index 08ce1c97b..793ad6085 100644 --- a/ethcore/native_contracts/generator/src/lib.rs +++ b/ethcore/native_contracts/generator/src/lib.rs @@ -112,7 +112,7 @@ pub fn {snake_name}(&self, call: F, {params}) -> BoxFuture<{output_type}, U: IntoFuture, Error=String>, U::Future: Send + 'static {{ - let function = self.contract.function(r#"{abi_name}"#.to_string()) + let function = self.contract.function(r#"{abi_name}"#) .expect("function existence checked at compile-time; qed"); let call_addr = self.address; diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index 62263d801..117332022 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -8,9 +8,9 @@ log = "0.3" libc = "0.2" rand = "0.3" ethkey = { path = "../ethkey" } -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" rustc-hex = "1.0" rust-crypto = "0.2.36" tiny-keccak = "1.0" diff --git a/ethstore/src/json/bytes.rs b/ethstore/src/json/bytes.rs index 3a48fa2a1..de2c64563 100644 --- a/ethstore/src/json/bytes.rs +++ b/ethstore/src/json/bytes.rs @@ -30,9 +30,9 @@ impl ops::Deref for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { let s = String::deserialize(deserializer)?; let data = s.from_hex().map_err(|e| Error::custom(format!("Invalid hex value {}", e)))?; diff --git a/ethstore/src/json/cipher.rs b/ethstore/src/json/cipher.rs index 3505a3e81..33f4ec572 100644 --- a/ethstore/src/json/cipher.rs +++ b/ethstore/src/json/cipher.rs @@ -33,16 +33,16 @@ impl Serialize for CipherSer { } } -impl Deserialize for CipherSer { +impl<'a> Deserialize<'a> for CipherSer { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(CipherSerVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(CipherSerVisitor) } } struct CipherSerVisitor; -impl Visitor for CipherSerVisitor { +impl<'a> Visitor<'a> for CipherSerVisitor { type Value = CipherSer; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -80,9 +80,9 @@ impl Serialize for CipherSerParams { } } -impl Deserialize for CipherSerParams { +impl<'a> Deserialize<'a> for CipherSerParams { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { Aes128Ctr::deserialize(deserializer) .map(CipherSerParams::Aes128Ctr) .map_err(|_| Error::InvalidCipherParams) diff --git a/ethstore/src/json/crypto.rs b/ethstore/src/json/crypto.rs index ee1f08502..03f72e576 100644 --- a/ethstore/src/json/crypto.rs +++ b/ethstore/src/json/crypto.rs @@ -17,7 +17,7 @@ use std::{fmt, str}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::ser::SerializeStruct; -use serde::de::{Visitor, MapVisitor, Error}; +use serde::de::{Visitor, MapAccess, Error}; use serde_json; use super::{Cipher, CipherSer, CipherSerParams, Kdf, KdfSer, KdfSerParams, H256, Bytes}; @@ -54,17 +54,17 @@ enum CryptoField { Mac, } -impl Deserialize for CryptoField { +impl<'a> Deserialize<'a> for CryptoField { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(CryptoFieldVisitor) + deserializer.deserialize_any(CryptoFieldVisitor) } } struct CryptoFieldVisitor; -impl Visitor for CryptoFieldVisitor { +impl<'a> Visitor<'a> for CryptoFieldVisitor { type Value = CryptoField; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -86,9 +86,9 @@ impl Visitor for CryptoFieldVisitor { } } -impl Deserialize for Crypto { +impl<'a> Deserialize<'a> for Crypto { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; deserializer.deserialize_struct("Crypto", FIELDS, CryptoVisitor) @@ -97,7 +97,7 @@ impl Deserialize for Crypto { struct CryptoVisitor; -impl Visitor for CryptoVisitor { +impl<'a> Visitor<'a> for CryptoVisitor { type Value = Crypto; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -105,7 +105,7 @@ impl Visitor for CryptoVisitor { } fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor + where V: MapAccess<'a> { let mut cipher = None; let mut cipherparams = None; @@ -115,13 +115,13 @@ impl Visitor for CryptoVisitor { let mut mac = None; loop { - match visitor.visit_key()? { - Some(CryptoField::Cipher) => { cipher = Some(visitor.visit_value()?); } - Some(CryptoField::CipherParams) => { cipherparams = Some(visitor.visit_value()?); } - Some(CryptoField::CipherText) => { ciphertext = Some(visitor.visit_value()?); } - Some(CryptoField::Kdf) => { kdf = Some(visitor.visit_value()?); } - Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.visit_value()?); } - Some(CryptoField::Mac) => { mac = Some(visitor.visit_value()?); } + match visitor.next_key()? { + Some(CryptoField::Cipher) => { cipher = Some(visitor.next_value()?); } + Some(CryptoField::CipherParams) => { cipherparams = Some(visitor.next_value()?); } + Some(CryptoField::CipherText) => { ciphertext = Some(visitor.next_value()?); } + Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); } + Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); } + Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); } None => { break; } } } diff --git a/ethstore/src/json/hash.rs b/ethstore/src/json/hash.rs index 43920c3a0..13564c95d 100644 --- a/ethstore/src/json/hash.rs +++ b/ethstore/src/json/hash.rs @@ -54,12 +54,12 @@ macro_rules! impl_hash { } } - impl Deserialize for $name { + impl<'a> Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -75,7 +75,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/ethstore/src/json/id.rs b/ethstore/src/json/id.rs index a1db0ccc5..aa90a4d7a 100644 --- a/ethstore/src/json/id.rs +++ b/ethstore/src/json/id.rs @@ -108,16 +108,16 @@ impl Serialize for Uuid { } } -impl Deserialize for Uuid { +impl<'a> Deserialize<'a> for Uuid { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UuidVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UuidVisitor) } } struct UuidVisitor; -impl Visitor for UuidVisitor { +impl<'a> Visitor<'a> for UuidVisitor { type Value = Uuid; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/ethstore/src/json/kdf.rs b/ethstore/src/json/kdf.rs index 9130fe507..6498323be 100644 --- a/ethstore/src/json/kdf.rs +++ b/ethstore/src/json/kdf.rs @@ -35,16 +35,16 @@ impl Serialize for KdfSer { } } -impl Deserialize for KdfSer { +impl<'a> Deserialize<'a> for KdfSer { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(KdfSerVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(KdfSerVisitor) } } struct KdfSerVisitor; -impl Visitor for KdfSerVisitor { +impl<'a> Visitor<'a> for KdfSerVisitor { type Value = KdfSer; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -78,16 +78,16 @@ impl Serialize for Prf { } } -impl Deserialize for Prf { +impl<'a> Deserialize<'a> for Prf { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(PrfVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(PrfVisitor) } } struct PrfVisitor; -impl Visitor for PrfVisitor { +impl<'a> Visitor<'a> for PrfVisitor { type Value = Prf; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -139,9 +139,9 @@ impl Serialize for KdfSerParams { } } -impl Deserialize for KdfSerParams { +impl<'a> Deserialize<'a> for KdfSerParams { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { use serde_json::{Value, from_value}; let v: Value = Deserialize::deserialize(deserializer)?; diff --git a/ethstore/src/json/key_file.rs b/ethstore/src/json/key_file.rs index a1c20acf2..60b34681e 100644 --- a/ethstore/src/json/key_file.rs +++ b/ethstore/src/json/key_file.rs @@ -17,7 +17,7 @@ use std::fmt; use std::io::{Read, Write}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; -use serde::de::{Error, Visitor, MapVisitor}; +use serde::de::{Error, Visitor, MapAccess, DeserializeOwned}; use serde_json; use super::{Uuid, Version, Crypto, H160}; @@ -60,17 +60,17 @@ enum KeyFileField { Meta, } -impl Deserialize for KeyFileField { +impl<'a> Deserialize<'a> for KeyFileField { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(KeyFileFieldVisitor) + deserializer.deserialize_any(KeyFileFieldVisitor) } } struct KeyFileFieldVisitor; -impl Visitor for KeyFileFieldVisitor { +impl<'a> Visitor<'a> for KeyFileFieldVisitor { type Value = KeyFileField; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -93,9 +93,9 @@ impl Visitor for KeyFileFieldVisitor { } } -impl Deserialize for KeyFile { +impl<'a> Deserialize<'a> for KeyFile { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; deserializer.deserialize_struct("KeyFile", FIELDS, KeyFileVisitor) @@ -103,8 +103,8 @@ impl Deserialize for KeyFile { } -fn none_if_empty(v: Option) -> Option where - T: Deserialize, +fn none_if_empty<'a, T>(v: Option) -> Option where + T: DeserializeOwned { v.and_then(|v| if v.is_null() { None @@ -115,7 +115,7 @@ fn none_if_empty(v: Option) -> Option where } struct KeyFileVisitor; -impl Visitor for KeyFileVisitor { +impl<'a> Visitor<'a> for KeyFileVisitor { type Value = KeyFile; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -123,7 +123,7 @@ impl Visitor for KeyFileVisitor { } fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor + where V: MapAccess<'a> { let mut id = None; let mut version = None; @@ -133,13 +133,13 @@ impl Visitor for KeyFileVisitor { let mut meta = None; loop { - match visitor.visit_key()? { - Some(KeyFileField::Id) => { id = Some(visitor.visit_value()?); } - 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 = none_if_empty(visitor.visit_value().ok()) } - Some(KeyFileField::Meta) => { meta = none_if_empty(visitor.visit_value().ok()) } + match visitor.next_key()? { + Some(KeyFileField::Id) => { id = Some(visitor.next_value()?); } + Some(KeyFileField::Version) => { version = Some(visitor.next_value()?); } + Some(KeyFileField::Crypto) => { crypto = Some(visitor.next_value()?); } + Some(KeyFileField::Address) => { address = Some(visitor.next_value()?); } + Some(KeyFileField::Name) => { name = none_if_empty(visitor.next_value().ok()) } + Some(KeyFileField::Meta) => { meta = none_if_empty(visitor.next_value().ok()) } None => { break; } } } diff --git a/ethstore/src/json/version.rs b/ethstore/src/json/version.rs index 68f0834a9..0eb8450f1 100644 --- a/ethstore/src/json/version.rs +++ b/ethstore/src/json/version.rs @@ -33,16 +33,16 @@ impl Serialize for Version { } } -impl Deserialize for Version { +impl<'a> Deserialize<'a> for Version { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(VersionVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(VersionVisitor) } } struct VersionVisitor; -impl Visitor for VersionVisitor { +impl<'a> Visitor<'a> for VersionVisitor { type Value = Version; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index b02a74f64..17da00215 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -7,7 +7,7 @@ version = "1.7.0" authors = ["Parity Technologies "] [dependencies] -ethabi = "1.0" +ethabi = "2.0" futures = "0.1" log = "0.3" mime = "0.2" diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index 2d7eccfa4..eea49978d 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -14,9 +14,9 @@ byteorder = "1.0" log = "0.3" parking_lot = "0.4" hyper = { version = "0.10", default-features = false } -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" futures = "0.1" futures-cpupool = "0.1" rustc-hex = "1.0" @@ -25,7 +25,7 @@ tokio-io = "0.1.0" tokio-service = "0.1" tokio-proto = "0.1" url = "1.0" -ethabi = "1.0" +ethabi = "2.0" ethcore = { path = "../ethcore" } ethcore-devtools = { path = "../devtools" } ethcore-util = { path = "../util" } diff --git a/secret_store/src/serialization.rs b/secret_store/src/serialization.rs index 4b42311cf..edece1dac 100644 --- a/secret_store/src/serialization.rs +++ b/secret_store/src/serialization.rs @@ -66,9 +66,9 @@ impl Serialize for SerializableBytes { } } -impl Deserialize for SerializableBytes { +impl<'a> Deserialize<'a> for SerializableBytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { let s = String::deserialize(deserializer)?; if s.len() >= 2 && &s[0..2] == "0x" && s.len() & 1 == 0 { @@ -112,11 +112,11 @@ impl Serialize for SerializableSignature { } } -impl Deserialize for SerializableSignature { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableSignature { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableSignature; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -136,7 +136,7 @@ impl Deserialize for SerializableSignature { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -172,11 +172,11 @@ impl Serialize for SerializableH256 { } } -impl Deserialize for SerializableH256 { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableH256 { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableH256; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -196,7 +196,7 @@ impl Deserialize for SerializableH256 { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -232,11 +232,11 @@ impl Serialize for SerializableSecret { } } -impl Deserialize for SerializableSecret { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableSecret { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableSecret; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -256,7 +256,7 @@ impl Deserialize for SerializableSecret { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -312,11 +312,11 @@ impl Serialize for SerializablePublic { } } -impl Deserialize for SerializablePublic { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializablePublic { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializablePublic; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -336,7 +336,7 @@ impl Deserialize for SerializablePublic { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 49083cee9..8c85d5daf 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -11,7 +11,7 @@ ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] log = "0.3" -ethabi = "1.0" +ethabi = "2.0" target_info = "0.1" ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } From e448b84845a4ae8a6001fa986c7fa5a7b3b222c4 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 18:12:39 +0200 Subject: [PATCH 05/15] migrated ethcore-network to bytes 0.4 --- Cargo.lock | 37 +++++++++++++++------------------- util/network/Cargo.toml | 2 +- util/network/src/connection.rs | 10 ++++----- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 472fe96c7..69e1e4bff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,12 +151,7 @@ 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 = "bytes" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -554,7 +549,7 @@ name = "ethcore-network" version = "1.7.0" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-devtools 1.7.0", "ethcore-io 1.7.0", @@ -1084,7 +1079,7 @@ name = "jsonrpc-ipc-server" version = "7.0.0" source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1143,7 +1138,7 @@ name = "jsonrpc-tcp-server" version = "7.0.0" source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1160,7 +1155,7 @@ dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "ws 0.6.0 (git+https://github.com/tomusdrw/ws-rs)", + "ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)", ] [[package]] @@ -1812,7 +1807,7 @@ name = "parity-tokio-ipc" version = "0.1.5" source = "git+https://github.com/nikvolf/parity-tokio-ipc#d6c5b3cfcc913a1b9cf0f0562a10b083ceb9fb7c" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", @@ -2632,7 +2627,7 @@ name = "tokio-core" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2647,7 +2642,7 @@ name = "tokio-io" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2672,7 +2667,7 @@ name = "tokio-named-pipes" version = "0.1.0" source = "git+https://github.com/nikvolf/tokio-named-pipes#0b9b728eaeb0a6673c287ac7692be398fd651752" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2733,7 +2728,7 @@ name = "tokio-uds" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2880,10 +2875,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ws" -version = "0.6.0" -source = "git+https://github.com/tomusdrw/ws-rs#7f8e416b7f048880228005457e117128be38bf0f" +version = "0.7.1" +source = "git+https://github.com/tomusdrw/ws-rs#f8306a798b7541d64624299a83a2c934f173beed" dependencies = [ - "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2956,8 +2952,7 @@ dependencies = [ "checksum bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f421095d2a76fc24cd3fb3f912b90df06be7689912b1bdb423caefae59c258d" "checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "" "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" -"checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27" -"checksum bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9edb851115d67d1f18680f9326901768a91d37875b87015518357c6ce22b553" +"checksum bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24f16593f445422331a5eed46b72f7f171f910fead4f2ea8f17e727e9c5c14" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "34aa7da06f10541fbca6850719cdaa8fa03060a5d2fb33840f149cf8133a00c7" "checksum clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4fabf979ddf6419a313c1c0ada4a5b95cfd2049c56e8418d622d27b4b6ff32" @@ -3181,7 +3176,7 @@ dependencies = [ "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 ws 0.6.0 (git+https://github.com/tomusdrw/ws-rs)" = "" +"checksum ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)" = "" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77b831a5ba77110f438f0ac5583aafeb087f70432998ba6b7dcb1d32185db453" "checksum xml-rs 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "65e74b96bd3179209dc70a980da6df843dff09e46eee103a0376c0949257e3ef" diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 63b5ad50e..0d1c3719f 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Parity Technologies "] [dependencies] log = "0.3" mio = "0.6.8" -bytes = "0.3.0" +bytes = "0.4" rand = "0.3.12" time = "0.1.34" tiny-keccak = "1.0" diff --git a/util/network/src/connection.rs b/util/network/src/connection.rs index c54c951fa..a9cb05c00 100644 --- a/util/network/src/connection.rs +++ b/util/network/src/connection.rs @@ -35,7 +35,7 @@ use rcrypto::aessafe::*; use rcrypto::symmetriccipher::*; use rcrypto::buffer::*; use tiny_keccak::Keccak; -use bytes::{Buf, MutBuf}; +use bytes::{Buf, BufMut}; use crypto; const ENCRYPTED_HEADER_LEN: usize = 32; @@ -83,9 +83,9 @@ impl GenericConnection { let sock_ref = ::by_ref(&mut self.socket); loop { let max = self.rec_size - self.rec_buf.len(); - match sock_ref.take(max as u64).try_read(unsafe { self.rec_buf.mut_bytes() }) { + match sock_ref.take(max as u64).try_read(unsafe { self.rec_buf.bytes_mut() }) { Ok(Some(size)) if size != 0 => { - unsafe { self.rec_buf.advance(size); } + unsafe { self.rec_buf.advance_mut(size); } self.stats.inc_recv(size); trace!(target:"network", "{}: Read {} of {} bytes", self.token, self.rec_buf.len(), self.rec_size); if self.rec_size != 0 && self.rec_buf.len() == self.rec_size { @@ -136,8 +136,8 @@ impl GenericConnection { warn!(target:"net", "Unexpected connection data"); return Ok(WriteStatus::Complete) } - let buf = buf as &mut Buf; - match self.socket.try_write(buf.bytes()) { + + match self.socket.try_write(Buf::bytes(&buf)) { Ok(Some(size)) if (pos + size) < send_size => { buf.advance(size); self.stats.inc_send(size); From 2e5f7f1632ea43ef418791c0742f4df31483ee1a Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 5 Jul 2017 10:18:19 +0200 Subject: [PATCH 06/15] migrated ethcore engine to new ethabi interface --- ethcore/src/engines/validator_set/safe_contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index de8d16ddc..8603af46e 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -200,7 +200,7 @@ impl ValidatorSafeContract { // decode log manually until the native contract generator is // good enough to do it for us. - let &(_, _, ref validators_token) = &matched_event.params[1]; + let validators_token = &matched_event[1].value; let validators = validators_token.clone().to_array() .and_then(|a| a.into_iter() From 2c4f55a8fb86b3b21bda5212bbb8594a42ea04d6 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 5 Jul 2017 10:27:56 +0200 Subject: [PATCH 07/15] migrated rpc to serde 1.0 --- Cargo.lock | 98 ++++++++++++++------------------ local-store/Cargo.toml | 6 +- rpc/Cargo.toml | 6 +- rpc/src/v1/types/block_number.rs | 8 +-- rpc/src/v1/types/bytes.rs | 8 +-- rpc/src/v1/types/derivation.rs | 8 +-- rpc/src/v1/types/filter.rs | 8 +-- rpc/src/v1/types/hash.rs | 8 +-- rpc/src/v1/types/index.rs | 8 +-- rpc/src/v1/types/pubsub.rs | 4 +- rpc/src/v1/types/uint.rs | 8 +-- util/fetch/Cargo.toml | 4 +- 12 files changed, 80 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69e1e4bff..66a78ae64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,14 +173,6 @@ dependencies = [ "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "clippy" -version = "0.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "clippy_lints 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "clippy" version = "0.0.103" @@ -189,20 +181,6 @@ dependencies = [ "clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "clippy_lints" -version = "0.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quine-mc_cluskey 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.3.1 (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)", - "toml 0.1.28 (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 = "clippy_lints" version = "0.0.103" @@ -802,13 +780,12 @@ dependencies = [ name = "fetch" version = "0.1.0" dependencies = [ - "clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1052,19 +1029,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-core" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-http-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1077,7 +1054,7 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1090,18 +1067,19 @@ dependencies = [ [[package]] name = "jsonrpc-macros" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", - "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-minihttp-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1114,7 +1092,7 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1124,7 +1102,7 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1136,21 +1114,21 @@ dependencies = [ [[package]] name = "jsonrpc-tcp-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-ws-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1192,6 +1170,14 @@ name = "libc" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libflate" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "libusb" version = "0.3.0" @@ -1723,9 +1709,9 @@ dependencies = [ "ethkey 0.2.0", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", - "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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1775,9 +1761,9 @@ dependencies = [ "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2105,15 +2091,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "reqwest" -version = "0.4.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (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)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2388,12 +2375,12 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.4.1" +version = "0.5.1" 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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2650,14 +2637,16 @@ dependencies = [ [[package]] name = "tokio-minihttp" version = "0.1.0" -source = "git+https://github.com/tomusdrw/tokio-minihttp#8acbafae3e77e7f7eb516b441ec84695580221dd" +source = "git+https://github.com/tomusdrw/tokio-minihttp#67a400060bd29e51beaf206c552845255b6f699f" dependencies = [ + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (git+https://github.com/tomusdrw/tokio-proto)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2956,9 +2945,7 @@ dependencies = [ "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "34aa7da06f10541fbca6850719cdaa8fa03060a5d2fb33840f149cf8133a00c7" "checksum clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4fabf979ddf6419a313c1c0ada4a5b95cfd2049c56e8418d622d27b4b6ff32" -"checksum clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "d19bda68c3db98e3a780342f6101b44312fef20a5f13ce756d1202a35922b01b" "checksum clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "ce96ec05bfe018a0d5d43da115e54850ea2217981ff0f2e462780ab9d594651a" -"checksum clippy_lints 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "3d4ed67c69b9bb35169be2538691d290a3aa0cbfd4b9f0bfb7c221fc1d399a96" "checksum cookie 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d53b80dde876f47f03cda35303e368a79b91c70b0d65ecba5fd5280944a08591" "checksum core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "20a6d0448d3a99d977ae4a2aa5a98d886a923e863e81ad9ff814645b6feb3bbd" "checksum core-foundation-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "05eed248dc504a5391c63794fe4fb64f46f071280afaa1b73308f3c0ce4574c5" @@ -3016,6 +3003,7 @@ dependencies = [ "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" "checksum lazycell 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec38a5c22f1ef3e30d2642aa875620d60edeef36cef43c4739d86215ce816331" "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135" +"checksum libflate 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "59fa4619e0f202f63fde6046eafe0e754e829369c5e892abeca0c22a12dcfec9" "checksum libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)" = "" "checksum libusb-sys 0.2.3 (git+https://github.com/paritytech/libusb-sys)" = "" "checksum linked-hash-map 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bda158e0dabeb97ee8a401f4d17e479d6b891a14de0bba79d5cc2d4d325b5e48" @@ -3089,7 +3077,7 @@ dependencies = [ "checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" "checksum regex-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "841591b1e05609a643e3b4d0045fce04f701daba7151ddcd3ad47b080693d5a9" "checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" -"checksum reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bef9ed8fdfcc30947d6b774938dc0c3f369a474efe440df2c7f278180b2d2e6" +"checksum reqwest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1d56dbe269dbe19d716b76ec8c3efce8ef84e974f5b7e5527463e8c0507d4e17" "checksum ring 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "873ec7c2b7c9bf58024eb8f1bbc40a6499cd23c1adc59532f4af9e355f1de0f3" "checksum rocksdb 0.4.5 (git+https://github.com/paritytech/rust-rocksdb)" = "" "checksum rocksdb-sys 0.3.0 (git+https://github.com/paritytech/rust-rocksdb)" = "" @@ -3118,7 +3106,7 @@ dependencies = [ "checksum serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "021c338d22c7e30f957a6ab7e388cb6098499dda9fd4ba1661ee074ca7a180d1" "checksum serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cf37ce931677e98b4fa5e6469aaa3ab4b6228309ea33b1b22d3ec055adfc4515" "checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" -"checksum serde_urlencoded 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a81f15da4b9780e1524697f73b09076b6e42298ef673bead9ca8f848b334ef84" +"checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480" "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" "checksum siphasher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c44e42fa187b5a8782489cf7740cc27c3125806be2bf33563cf5e02e9533fcd" diff --git a/local-store/Cargo.toml b/local-store/Cargo.toml index aa71ab9a2..d7b957fd7 100644 --- a/local-store/Cargo.toml +++ b/local-store/Cargo.toml @@ -9,8 +9,8 @@ ethcore-util = { path = "../util" } ethcore-io = { path = "../util/io" } ethcore = { path = "../ethcore" } rlp = {path = "../util/rlp" } -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" log = "0.3" ethkey = { path = "../ethkey" } diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 7b083a3ac..3d0b1e7d3 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -17,9 +17,9 @@ rand = "0.3" rust-crypto = "0.2" rustc-hex = "1.0" semver = "0.6" -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" time = "0.1" tokio-timer = "0.1" transient-hashmap = "0.4" diff --git a/rpc/src/v1/types/block_number.rs b/rpc/src/v1/types/block_number.rs index 65a46879e..8f3f09f51 100644 --- a/rpc/src/v1/types/block_number.rs +++ b/rpc/src/v1/types/block_number.rs @@ -38,9 +38,9 @@ impl Default for BlockNumber { } } -impl Deserialize for BlockNumber { - fn deserialize(deserializer: D) -> Result where D: Deserializer { - deserializer.deserialize(BlockNumberVisitor) +impl<'a> Deserialize<'a> for BlockNumber { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { + deserializer.deserialize_any(BlockNumberVisitor) } } @@ -67,7 +67,7 @@ impl Serialize for BlockNumber { struct BlockNumberVisitor; -impl Visitor for BlockNumberVisitor { +impl<'a> Visitor<'a> for BlockNumberVisitor { type Value = BlockNumber; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/bytes.rs b/rpc/src/v1/types/bytes.rs index 22a74f97d..deaa234fc 100644 --- a/rpc/src/v1/types/bytes.rs +++ b/rpc/src/v1/types/bytes.rs @@ -57,16 +57,16 @@ impl Serialize for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(BytesVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(BytesVisitor) } } struct BytesVisitor; -impl Visitor for BytesVisitor { +impl<'a> Visitor<'a> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/derivation.rs b/rpc/src/v1/types/derivation.rs index decf48171..cf0f03c85 100644 --- a/rpc/src/v1/types/derivation.rs +++ b/rpc/src/v1/types/derivation.rs @@ -102,15 +102,15 @@ impl Derive { } } -impl Deserialize for DerivationType { - fn deserialize(deserializer: D) -> Result where D: Deserializer { - deserializer.deserialize(DerivationTypeVisitor) +impl<'a> Deserialize<'a> for DerivationType { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { + deserializer.deserialize_any(DerivationTypeVisitor) } } struct DerivationTypeVisitor; -impl Visitor for DerivationTypeVisitor { +impl<'a> Visitor<'a> for DerivationTypeVisitor { type Value = DerivationType; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index cd1d43fcb..8a1181eb8 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use serde::de::Error; +use serde::de::{Error, DeserializeOwned}; use serde_json::{Value, from_value}; use ethcore::filter::Filter as EthFilter; use ethcore::client::BlockId; @@ -23,7 +23,7 @@ use v1::types::{BlockNumber, H160, H256, Log}; /// Variadic value #[derive(Debug, PartialEq, Eq, Clone, Hash)] -pub enum VariadicValue where T: Deserialize { +pub enum VariadicValue where T: DeserializeOwned { /// Single Single(T), /// List @@ -32,9 +32,9 @@ pub enum VariadicValue where T: Deserialize { Null, } -impl Deserialize for VariadicValue where T: Deserialize { +impl<'a, T> Deserialize<'a> for VariadicValue where T: DeserializeOwned { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer { + where D: Deserializer<'a> { let v: Value = Deserialize::deserialize(deserializer)?; if v.is_null() { diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index 166aebfa3..1816c96d5 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -116,11 +116,11 @@ macro_rules! impl_hash { } } - impl serde::Deserialize for $name { - fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer { + impl<'a> serde::Deserialize<'a> for $name { + fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer<'a> { struct HashVisitor; - impl serde::de::Visitor for HashVisitor { + impl<'b> serde::de::Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -151,7 +151,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } } diff --git a/rpc/src/v1/types/index.rs b/rpc/src/v1/types/index.rs index ab8784f49..3c9d56f6e 100644 --- a/rpc/src/v1/types/index.rs +++ b/rpc/src/v1/types/index.rs @@ -29,16 +29,16 @@ impl Index { } } -impl Deserialize for Index { +impl<'a> Deserialize<'a> for Index { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(IndexVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(IndexVisitor) } } struct IndexVisitor; -impl Visitor for IndexVisitor { +impl<'a> Visitor<'a> for IndexVisitor { type Value = Index; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/pubsub.rs b/rpc/src/v1/types/pubsub.rs index 1be0d19e3..ce9d6d38d 100644 --- a/rpc/src/v1/types/pubsub.rs +++ b/rpc/src/v1/types/pubsub.rs @@ -74,9 +74,9 @@ impl Default for Params { } } -impl Deserialize for Params { +impl<'a> Deserialize<'a> for Params { fn deserialize(deserializer: D) -> ::std::result::Result - where D: Deserializer { + where D: Deserializer<'a> { let v: Value = Deserialize::deserialize(deserializer)?; if v.is_null() { diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index 58e2bad4f..e783aac1f 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -65,12 +65,12 @@ macro_rules! impl_uint { } } - impl serde::Deserialize for $name { + impl<'a> serde::Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result<$name, D::Error> - where D: serde::Deserializer { + where D: serde::Deserializer<'a> { struct UintVisitor; - impl serde::de::Visitor for UintVisitor { + impl<'b> serde::de::Visitor<'b> for UintVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -95,7 +95,7 @@ macro_rules! impl_uint { } } - deserializer.deserialize(UintVisitor) + deserializer.deserialize_any(UintVisitor) } } diff --git a/util/fetch/Cargo.toml b/util/fetch/Cargo.toml index 84cf15b6d..f88bdb551 100644 --- a/util/fetch/Cargo.toml +++ b/util/fetch/Cargo.toml @@ -11,10 +11,8 @@ futures = "0.1" futures-cpupool = "0.1" parking_lot = "0.4" log = "0.3" -reqwest = "0.4" +reqwest = "0.6" mime = "0.2" -clippy = { version = "0.0.90", optional = true} [features] default = [] -dev = ["clippy"] From 2d69c7ecf6e1813ddb5737d084775629445e79a4 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 5 Jul 2017 10:34:23 +0200 Subject: [PATCH 08/15] finished migration to serde 1.0 --- Cargo.lock | 126 ++++++++++++++------------------------- dapps/Cargo.toml | 6 +- rpc_client/Cargo.toml | 4 +- rpc_client/src/client.rs | 4 +- 4 files changed, 51 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66a78ae64..6b2a7b494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,7 +85,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -273,8 +273,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -323,8 +323,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -500,8 +500,8 @@ dependencies = [ "log 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)", "rlp 0.2.0", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -573,8 +573,8 @@ dependencies = [ "native-contracts 0.1.0", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -658,8 +658,8 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -684,8 +684,8 @@ dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.2.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -703,8 +703,8 @@ 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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -719,8 +719,8 @@ dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -757,8 +757,8 @@ dependencies = [ "ethcore 1.7.0", "ethcore-util 1.7.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1033,8 +1033,8 @@ source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476 dependencies = [ "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1071,7 +1071,7 @@ source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476 dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1614,8 +1614,8 @@ dependencies = [ "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1646,9 +1646,9 @@ dependencies = [ "parity-ui 1.7.0", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", @@ -1709,8 +1709,8 @@ dependencies = [ "ethkey 0.2.0", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1761,8 +1761,8 @@ dependencies = [ "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1782,8 +1782,8 @@ dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.7.0", "rand 0.3.14 (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 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", ] @@ -2098,7 +2098,7 @@ dependencies = [ "hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libflate 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2306,62 +2306,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.9.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "serde" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_codegen_internals" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_derive" -version = "0.9.6" +version = "1.0.9" 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.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive" -version = "1.0.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)", - "serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive_internals" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_json" -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.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_json" version = "1.0.2" @@ -2370,7 +2336,7 @@ 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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2380,7 +2346,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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2741,7 +2707,7 @@ name = "toml" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3098,13 +3064,9 @@ dependencies = [ "checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0ae9a3c8b07c09dbe43022486d55a18c629a0618d2241e49829aaef9b6d862f9" -"checksum serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "991ef6be409a3b7a46cb9ee701d86156ce851825c65dbee7f16dbd5c4e7e2d47" -"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_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd81eef9f0b4ec341b11095335b6a4b28ed85581b12dd27585dee1529df35e0" -"checksum serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "021c338d22c7e30f957a6ab7e388cb6098499dda9fd4ba1661ee074ca7a180d1" -"checksum serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cf37ce931677e98b4fa5e6469aaa3ab4b6228309ea33b1b22d3ec055adfc4515" +"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" +"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" +"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" "checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" "checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index ba6cf67ce..f34335d2f 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -18,9 +18,9 @@ mime = "0.2" mime_guess = "1.6.1" rand = "0.3" rustc-hex = "1.0" -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" time = "0.1.35" unicase = "1.3" url = "1.0" diff --git a/rpc_client/Cargo.toml b/rpc_client/Cargo.toml index c6df530be..5cc688fb5 100644 --- a/rpc_client/Cargo.toml +++ b/rpc_client/Cargo.toml @@ -10,8 +10,8 @@ version = "1.4.0" futures = "0.1" log = "0.3.6" rand = "0.3.14" -serde = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_json = "1.0" tempdir = "0.3.5" url = "1.2.0" matches = "0.1" diff --git a/rpc_client/src/client.rs b/rpc_client/src/client.rs index f31570c7a..3f55fbe73 100644 --- a/rpc_client/src/client.rs +++ b/rpc_client/src/client.rs @@ -25,7 +25,7 @@ use ws::ws::{ Result as WsResult, }; -use serde::Deserialize; +use serde::de::DeserializeOwned; use serde_json::{ self as json, Value as JsonValue, @@ -247,7 +247,7 @@ impl Rpc { pub fn request( &mut self, method: &'static str, params: Vec ) -> BoxFuture, Canceled> - where T: Deserialize + Send + Sized { + where T: DeserializeOwned + Send + Sized { let (c, p) = oneshot::>(); From 7dcbcb5c313916f4b293534d27a73640bca9a606 Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 10:18:48 +0200 Subject: [PATCH 09/15] fixed missing FromHex import in ethcore tests --- ethcore/src/engines/tendermint/mod.rs | 1 + ethcore/src/engines/validator_set/contract.rs | 1 + ethcore/src/engines/validator_set/safe_contract.rs | 1 + ethcore/src/evm/interpreter/shared_cache.rs | 2 +- ethcore/src/evm/tests.rs | 3 ++- ethcore/src/executive.rs | 3 ++- ethcore/src/miner/banning_queue.rs | 3 ++- ethcore/src/miner/miner.rs | 3 ++- ethcore/src/miner/transaction_queue.rs | 1 + ethcore/src/state/mod.rs | 1 + ethcore/src/views/body.rs | 2 +- 11 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index 70d4e0ced..e7d0dab86 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -651,6 +651,7 @@ impl Engine for Tendermint { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use block::*; use error::{Error, BlockError}; diff --git a/ethcore/src/engines/validator_set/contract.rs b/ethcore/src/engines/validator_set/contract.rs index c2d3fd064..46f5c8512 100644 --- a/ethcore/src/engines/validator_set/contract.rs +++ b/ethcore/src/engines/validator_set/contract.rs @@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use rlp::encode; use spec::Spec; diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index de8d16ddc..e999439ee 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -420,6 +420,7 @@ impl ValidatorSet for ValidatorSafeContract { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use types::ids::BlockId; use spec::Spec; diff --git a/ethcore/src/evm/interpreter/shared_cache.rs b/ethcore/src/evm/interpreter/shared_cache.rs index ed3b59340..a93afa79a 100644 --- a/ethcore/src/evm/interpreter/shared_cache.rs +++ b/ethcore/src/evm/interpreter/shared_cache.rs @@ -92,7 +92,7 @@ impl Default for SharedCache { #[test] fn test_find_jump_destinations() { - use util::FromHex; + use rustc_hex::FromHex; // given let code = "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b01600055".from_hex().unwrap(); diff --git a/ethcore/src/evm/tests.rs b/ethcore/src/evm/tests.rs index 7f3cf0e1c..f7d82daa4 100644 --- a/ethcore/src/evm/tests.rs +++ b/ethcore/src/evm/tests.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +use std::fmt::Debug; +use rustc_hex::FromHex; use util::*; use action_params::{ActionParams, ActionValue}; use env_info::EnvInfo; use types::executed::CallType; use evm::{self, Ext, Schedule, Factory, GasLeft, VMType, ContractCreateResult, MessageCallResult, CreateContractAddress, ReturnData}; -use std::fmt::Debug; use tests::helpers::*; use types::transaction::SYSTEM_ADDRESS; use executive::Executive; diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index b486aa8d4..4038fe30d 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -578,9 +578,10 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> { #[allow(dead_code)] mod tests { use std::sync::Arc; + use rustc_hex::FromHex; use ethkey::{Generator, Random}; use super::*; - use util::{H256, U256, U512, Address, FromHex, FromStr}; + use util::{H256, U256, U512, Address, FromStr}; use util::bytes::BytesRef; use action_params::{ActionParams, ActionValue}; use env_info::EnvInfo; diff --git a/ethcore/src/miner/banning_queue.rs b/ethcore/src/miner/banning_queue.rs index 20b46d760..46d7e7cf8 100644 --- a/ethcore/src/miner/banning_queue.rs +++ b/ethcore/src/miner/banning_queue.rs @@ -209,13 +209,14 @@ impl DerefMut for BanningTransactionQueue { #[cfg(test)] mod tests { use std::time::Duration; + use rustc_hex::FromHex; use super::{BanningTransactionQueue, Threshold}; use ethkey::{Random, Generator}; use transaction::{Transaction, SignedTransaction, Action}; use error::{Error, TransactionError}; use client::TransactionImportResult; use miner::{TransactionQueue, TransactionOrigin}; - use util::{U256, Address, FromHex, Hashable}; + use util::{U256, Address, Hashable}; use miner::transaction_queue::test::DummyTransactionDetailsProvider; fn queue() -> BanningTransactionQueue { diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index c772490ba..208c778bc 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -1261,10 +1261,11 @@ mod tests { use std::sync::Arc; use std::time::Duration; + use rustc_hex::FromHex; use super::super::{MinerService, PrioritizationStrategy}; use super::*; use block::IsBlock; - use util::{U256, FromHex}; + use util::U256; use ethkey::{Generator, Random}; use client::{BlockChainClient, TestBlockChainClient, EachBlockWith, TransactionImportResult}; use header::BlockNumber; diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index 4e559df2e..8da9f7150 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -1422,6 +1422,7 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option BodyView<'a> { #[cfg(test)] mod tests { - use util::*; + use rustc_hex::FromHex; use super::BodyView; use blockchain::BlockChain; From e7d3036ace1db806a247f137a1a6728dec510d9a Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 10:46:40 +0200 Subject: [PATCH 10/15] fixed missing FromHex import in rpc tests --- rpc/src/v1/tests/mocked/eth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 29dffe16f..33d46c04f 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -536,7 +536,7 @@ fn rpc_eth_transaction_count_by_number_pending() { #[test] fn rpc_eth_pending_transaction_by_hash() { - use util::{H256, FromHex}; + use util::H256; use rlp; use ethcore::transaction::SignedTransaction; From 61d8f9053045a4e75168137c74f57076dcef53dc Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 11:36:15 +0200 Subject: [PATCH 11/15] updated serde to version 1.0 --- Cargo.lock | 322 ++++++++---------- Cargo.toml | 11 +- dapps/Cargo.toml | 8 +- dapps/src/apps/fetcher/mod.rs | 2 +- dapps/src/lib.rs | 2 +- dapps/src/tests/fetch.rs | 2 +- dapps/src/tests/helpers/registrar.rs | 2 +- ethcore/Cargo.toml | 3 +- ethcore/native_contracts/Cargo.toml | 2 +- ethcore/native_contracts/generator/Cargo.toml | 2 +- ethcore/native_contracts/generator/src/lib.rs | 2 +- ethcore/src/blockchain/blockchain.rs | 2 +- ethcore/src/builtin.rs | 8 +- ethcore/src/client/test_client.rs | 1 + ethcore/src/engines/tendermint/mod.rs | 1 + ethcore/src/engines/validator_set/contract.rs | 1 + .../engines/validator_set/safe_contract.rs | 3 +- ethcore/src/env_info.rs | 2 - ethcore/src/evm/interpreter/shared_cache.rs | 2 +- ethcore/src/evm/tests.rs | 3 +- ethcore/src/executive.rs | 3 +- ethcore/src/header.rs | 2 +- ethcore/src/lib.rs | 1 + ethcore/src/miner/banning_queue.rs | 3 +- ethcore/src/miner/miner.rs | 3 +- ethcore/src/miner/transaction_queue.rs | 6 +- ethcore/src/spec/spec.rs | 1 + ethcore/src/state/mod.rs | 2 +- ethcore/src/types/receipt.rs | 4 +- ethcore/src/types/transaction.rs | 4 +- ethcore/src/views/block.rs | 2 +- ethcore/src/views/body.rs | 2 +- ethcore/src/views/header.rs | 2 +- ethcore/src/views/transaction.rs | 2 +- ethkey/Cargo.toml | 2 +- ethkey/cli/Cargo.toml | 6 +- ethkey/cli/src/main.rs | 20 +- ethkey/src/keypair.rs | 2 +- ethkey/src/lib.rs | 2 +- ethkey/src/signature.rs | 2 +- ethstore/Cargo.toml | 8 +- ethstore/cli/Cargo.toml | 6 +- ethstore/cli/src/main.rs | 60 +++- ethstore/src/json/bytes.rs | 6 +- ethstore/src/json/cipher.rs | 12 +- ethstore/src/json/crypto.rs | 32 +- ethstore/src/json/hash.rs | 10 +- ethstore/src/json/id.rs | 10 +- ethstore/src/json/kdf.rs | 20 +- ethstore/src/json/key_file.rs | 36 +- ethstore/src/json/version.rs | 8 +- ethstore/src/lib.rs | 2 +- evmbin/Cargo.toml | 6 +- evmbin/benches/mod.rs | 4 +- evmbin/src/display/json.rs | 2 +- evmbin/src/main.rs | 12 +- hash-fetch/Cargo.toml | 4 +- hash-fetch/src/lib.rs | 2 +- hash-fetch/src/urlhint.rs | 4 +- hw/Cargo.toml | 2 +- hw/src/ledger.rs | 2 +- hw/src/lib.rs | 2 +- json/Cargo.toml | 8 +- json/src/bytes.rs | 10 +- json/src/hash.rs | 10 +- json/src/lib.rs | 2 +- json/src/maybe.rs | 11 +- json/src/spec/ethash.rs | 2 + json/src/trie/input.rs | 20 +- json/src/uint.rs | 8 +- local-store/Cargo.toml | 6 +- parity/blockchain.rs | 2 +- parity/cli/mod.rs | 34 +- parity/cli/usage.rs | 46 +-- parity/main.rs | 4 +- parity/user_defaults.rs | 16 +- rpc/Cargo.toml | 8 +- rpc/src/lib.rs | 2 +- rpc/src/v1/helpers/secretstore.rs | 2 +- rpc/src/v1/tests/mocked/eth.rs | 4 +- rpc/src/v1/tests/mocked/parity_set.rs | 2 +- rpc/src/v1/types/block_number.rs | 8 +- rpc/src/v1/types/bytes.rs | 13 +- rpc/src/v1/types/call_request.rs | 2 +- rpc/src/v1/types/derivation.rs | 8 +- rpc/src/v1/types/filter.rs | 8 +- rpc/src/v1/types/hash.rs | 10 +- rpc/src/v1/types/index.rs | 8 +- rpc/src/v1/types/pubsub.rs | 4 +- rpc/src/v1/types/transaction_request.rs | 2 +- rpc/src/v1/types/uint.rs | 8 +- rpc_cli/Cargo.toml | 2 +- rpc_client/Cargo.toml | 4 +- rpc_client/src/client.rs | 4 +- secret_store/Cargo.toml | 10 +- secret_store/src/lib.rs | 2 +- secret_store/src/serialization.rs | 38 +-- updater/Cargo.toml | 2 +- util/Cargo.toml | 4 +- util/benches/bigint.rs | 111 ------ util/bigint/Cargo.toml | 7 +- util/bigint/src/hash.rs | 12 +- util/bigint/src/lib.rs | 7 +- util/fetch/Cargo.toml | 4 +- util/network/Cargo.toml | 3 +- util/network/src/connection.rs | 10 +- util/network/src/discovery.rs | 2 +- util/network/src/handshake.rs | 2 +- util/network/src/lib.rs | 1 + util/rlp/Cargo.toml | 2 +- util/rlp/src/lib.rs | 2 +- util/rlp/src/rlpin.rs | 2 +- util/rlp/src/untrusted_rlp.rs | 4 +- util/src/error.rs | 2 +- util/src/lib.rs | 2 +- util/src/standard.rs | 6 +- 116 files changed, 553 insertions(+), 662 deletions(-) delete mode 100644 util/benches/bigint.rs diff --git a/Cargo.lock b/Cargo.lock index 63597b890..6b2a7b494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,13 +69,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bigint" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -86,7 +85,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.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 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -152,12 +151,7 @@ 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 = "bytes" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -179,14 +173,6 @@ dependencies = [ "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "clippy" -version = "0.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "clippy_lints 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "clippy" version = "0.0.103" @@ -195,20 +181,6 @@ dependencies = [ "clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "clippy_lints" -version = "0.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quine-mc_cluskey 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.3.1 (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)", - "toml 0.1.28 (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 = "clippy_lints" version = "0.0.103" @@ -296,12 +268,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "docopt" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -346,13 +319,13 @@ dependencies = [ [[package]] name = "ethabi" -version = "1.0.5" +version = "2.0.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)", - "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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -377,7 +350,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.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.7.0", "ethcore-bloom-journal 0.1.0", "ethcore-devtools 1.7.0", @@ -406,6 +379,7 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (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.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", @@ -417,11 +391,11 @@ dependencies = [ name = "ethcore-bigint" version = "0.1.3" dependencies = [ - "bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -526,8 +500,8 @@ dependencies = [ "log 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)", "rlp 0.2.0", - "serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -553,7 +527,7 @@ name = "ethcore-network" version = "1.7.0" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-devtools 1.7.0", "ethcore-io 1.7.0", @@ -570,6 +544,7 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -581,7 +556,7 @@ name = "ethcore-secretstore" version = "1.0.0" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-devtools 1.7.0", "ethcore-ipc 1.7.0", @@ -597,10 +572,10 @@ dependencies = [ "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "native-contracts 0.1.0", "parking_lot 0.4.0 (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.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -653,7 +628,7 @@ dependencies = [ "rlp 0.2.0", "rocksdb 0.4.5 (git+https://github.com/paritytech/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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.1.0", "table 0.1.0", @@ -682,10 +657,10 @@ version = "0.1.0" dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", - "rustc-serialize 0.3.19 (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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -698,7 +673,7 @@ dependencies = [ "lazy_static 0.2.8 (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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -706,9 +681,11 @@ dependencies = [ name = "ethkey-cli" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.2.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -725,10 +702,10 @@ dependencies = [ "parking_lot 0.4.0 (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.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -739,9 +716,11 @@ dependencies = [ name = "ethstore-cli" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.1.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -774,10 +753,12 @@ dependencies = [ name = "evmbin" version = "0.1.0" dependencies = [ - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-util 1.7.0", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -799,13 +780,12 @@ dependencies = [ name = "fetch" version = "0.1.0" dependencies = [ - "clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -896,7 +876,7 @@ dependencies = [ "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1049,19 +1029,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-core" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-http-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1074,9 +1054,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1087,18 +1067,19 @@ dependencies = [ [[package]] name = "jsonrpc-macros" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", - "serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-minihttp-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1111,7 +1092,7 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1121,7 +1102,7 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", @@ -1133,26 +1114,26 @@ dependencies = [ [[package]] name = "jsonrpc-tcp-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-ws-server" version = "7.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d8dae528860d7fe976a8e3ec060a792e2496573b" +source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#d12476f42ee672fa9d023f66fcfa5981d9aaba3a" dependencies = [ "jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "ws 0.6.0 (git+https://github.com/tomusdrw/ws-rs)", + "ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)", ] [[package]] @@ -1189,6 +1170,14 @@ name = "libc" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libflate" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "libusb" version = "0.3.0" @@ -1391,7 +1380,7 @@ dependencies = [ name = "native-contract-generator" version = "0.1.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1400,7 +1389,7 @@ name = "native-contracts" version = "0.1.0" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "native-contract-generator 0.1.0", @@ -1585,7 +1574,7 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)", "daemonize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-devtools 1.7.0", @@ -1622,13 +1611,14 @@ dependencies = [ "rlp 0.2.0", "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-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (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 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", + "toml 0.4.2 (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)", ] @@ -1655,10 +1645,10 @@ dependencies = [ "parity-reactor 0.1.0", "parity-ui 1.7.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.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", @@ -1683,7 +1673,7 @@ dependencies = [ name = "parity-hash-fetch" version = "1.7.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "fetch 0.1.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1693,7 +1683,7 @@ dependencies = [ "native-contracts 0.1.0", "parity-reactor 0.1.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1719,9 +1709,9 @@ dependencies = [ "ethkey 0.2.0", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.0", - "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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1769,11 +1759,11 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.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)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1792,8 +1782,8 @@ dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.7.0", "rand 0.3.14 (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 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (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)", ] @@ -1803,7 +1793,7 @@ name = "parity-tokio-ipc" version = "0.1.5" source = "git+https://github.com/nikvolf/parity-tokio-ipc#d6c5b3cfcc913a1b9cf0f0562a10b083ceb9fb7c" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", @@ -1843,7 +1833,7 @@ dependencies = [ name = "parity-updater" version = "1.7.0" dependencies = [ - "ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.7.0", "ethcore-ipc 1.7.0", "ethcore-ipc-codegen 1.7.0", @@ -2101,15 +2091,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "reqwest" -version = "0.4.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2133,7 +2124,7 @@ dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2193,7 +2184,7 @@ dependencies = [ name = "rpc-cli" version = "1.4.0" dependencies = [ - "bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-util 1.7.0", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.7.0", @@ -2213,6 +2204,11 @@ dependencies = [ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustc-hex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rustc-serialize" version = "0.3.19" @@ -2310,45 +2306,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.9.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "serde" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_codegen_internals" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_derive" -version = "0.9.6" +version = "1.0.9" 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.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive" -version = "1.0.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)", - "serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive_internals" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2357,23 +2330,23 @@ dependencies = [ [[package]] name = "serde_json" -version = "0.9.5" +version = "1.0.2" 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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_urlencoded" -version = "0.4.1" +version = "0.5.1" 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.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2607,7 +2580,7 @@ name = "tokio-core" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2622,7 +2595,7 @@ name = "tokio-io" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2630,14 +2603,16 @@ dependencies = [ [[package]] name = "tokio-minihttp" version = "0.1.0" -source = "git+https://github.com/tomusdrw/tokio-minihttp#8acbafae3e77e7f7eb516b441ec84695580221dd" +source = "git+https://github.com/tomusdrw/tokio-minihttp#67a400060bd29e51beaf206c552845255b6f699f" dependencies = [ + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.0 (git+https://github.com/tomusdrw/tokio-proto)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2647,7 +2622,7 @@ name = "tokio-named-pipes" version = "0.1.0" source = "git+https://github.com/nikvolf/tokio-named-pipes#0b9b728eaeb0a6673c287ac7692be398fd651752" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.4 (git+https://github.com/alexcrichton/mio-named-pipes)", "tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2708,7 +2683,7 @@ name = "tokio-uds" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2729,10 +2704,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.2.0" +version = "0.4.2" 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)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2855,10 +2830,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ws" -version = "0.6.0" -source = "git+https://github.com/tomusdrw/ws-rs#7f8e416b7f048880228005457e117128be38bf0f" +version = "0.7.1" +source = "git+https://github.com/tomusdrw/ws-rs#f8306a798b7541d64624299a83a2c934f173beed" dependencies = [ - "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2919,7 +2895,7 @@ dependencies = [ "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" -"checksum bigint 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d493e6869ed11b135750f4a4f44d574a52bf8f67e656cdc15b4085316c2098b6" +"checksum bigint 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0673c930652d3d4d6dcd5c45b5db4fa5f8f33994d7323618c43c083b223e8c" "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" "checksum bit-set 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6e1e6fb1c9e3d6fcdec57216a74eaa03e41f52a22f13a16438251d8e88b89da" "checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" @@ -2931,14 +2907,11 @@ dependencies = [ "checksum bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f421095d2a76fc24cd3fb3f912b90df06be7689912b1bdb423caefae59c258d" "checksum bn 0.4.4 (git+https://github.com/paritytech/bn)" = "" "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" -"checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27" -"checksum bytes 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9edb851115d67d1f18680f9326901768a91d37875b87015518357c6ce22b553" +"checksum bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24f16593f445422331a5eed46b72f7f171f910fead4f2ea8f17e727e9c5c14" "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "34aa7da06f10541fbca6850719cdaa8fa03060a5d2fb33840f149cf8133a00c7" "checksum clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4fabf979ddf6419a313c1c0ada4a5b95cfd2049c56e8418d622d27b4b6ff32" -"checksum clippy 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "d19bda68c3db98e3a780342f6101b44312fef20a5f13ce756d1202a35922b01b" "checksum clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "ce96ec05bfe018a0d5d43da115e54850ea2217981ff0f2e462780ab9d594651a" -"checksum clippy_lints 0.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "3d4ed67c69b9bb35169be2538691d290a3aa0cbfd4b9f0bfb7c221fc1d399a96" "checksum cookie 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d53b80dde876f47f03cda35303e368a79b91c70b0d65ecba5fd5280944a08591" "checksum core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "20a6d0448d3a99d977ae4a2aa5a98d886a923e863e81ad9ff814645b6feb3bbd" "checksum core-foundation-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "05eed248dc504a5391c63794fe4fb64f46f071280afaa1b73308f3c0ce4574c5" @@ -2948,13 +2921,13 @@ 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 difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" -"checksum docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab32ea6e284d87987066f21a9e809a73c14720571ef34516f0890b3d355ccfd8" +"checksum docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b5b93718f8b3e5544fcc914c43de828ca6c6ace23e0332c6080a2977b49787a" "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.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258ff6a9a94f648d0379dbd79110e057edbb53eb85cc237e33eadf8e5a30df85" "checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" "checksum eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)" = "" -"checksum ethabi 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "65f71b9ac0b0f8e6230d32dbf5acf7c2c61334af1148175d0a7e72b14c3d475e" +"checksum ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3d62319ee0f35abf20afe8859dd2668195912614346447bb2dee9fb8da7c62" "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 fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" @@ -2996,6 +2969,7 @@ dependencies = [ "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" "checksum lazycell 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec38a5c22f1ef3e30d2642aa875620d60edeef36cef43c4739d86215ce816331" "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135" +"checksum libflate 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "59fa4619e0f202f63fde6046eafe0e754e829369c5e892abeca0c22a12dcfec9" "checksum libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)" = "" "checksum libusb-sys 0.2.3 (git+https://github.com/paritytech/libusb-sys)" = "" "checksum linked-hash-map 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bda158e0dabeb97ee8a401f4d17e479d6b891a14de0bba79d5cc2d4d325b5e48" @@ -3069,7 +3043,7 @@ dependencies = [ "checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" "checksum regex-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "841591b1e05609a643e3b4d0045fce04f701daba7151ddcd3ad47b080693d5a9" "checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" -"checksum reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bef9ed8fdfcc30947d6b774938dc0c3f369a474efe440df2c7f278180b2d2e6" +"checksum reqwest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1d56dbe269dbe19d716b76ec8c3efce8ef84e974f5b7e5527463e8c0507d4e17" "checksum ring 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "873ec7c2b7c9bf58024eb8f1bbc40a6499cd23c1adc59532f4af9e355f1de0f3" "checksum rocksdb 0.4.5 (git+https://github.com/paritytech/rust-rocksdb)" = "" "checksum rocksdb-sys 0.3.0 (git+https://github.com/paritytech/rust-rocksdb)" = "" @@ -3077,6 +3051,7 @@ dependencies = [ "checksum rpassword 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d3a99497c5c544e629cc8b359ae5ede321eba5fa8e5a8078f3ced727a976c3f" "checksum rpassword 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab6e42be826e215f30ff830904f8f4a0933c6e2ae890e1af8b408f5bae60081e" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" "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 rustc_version 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e114e275f7c9b5d50bb52b28f9aac1921209f02aa6077c8b255e21eefaf8ffa" @@ -3089,14 +3064,11 @@ dependencies = [ "checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0ae9a3c8b07c09dbe43022486d55a18c629a0618d2241e49829aaef9b6d862f9" -"checksum serde 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "991ef6be409a3b7a46cb9ee701d86156ce851825c65dbee7f16dbd5c4e7e2d47" -"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_derive 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd81eef9f0b4ec341b11095335b6a4b28ed85581b12dd27585dee1529df35e0" -"checksum serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "021c338d22c7e30f957a6ab7e388cb6098499dda9fd4ba1661ee074ca7a180d1" -"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 serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" +"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" +"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" +"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" +"checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480" "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" "checksum siphasher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c44e42fa187b5a8782489cf7740cc27c3125806be2bf33563cf5e02e9533fcd" @@ -3135,7 +3107,7 @@ dependencies = [ "checksum tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86f33def658c14724fc13ec6289b3875a8152ee8ae767a5b1ccbded363b03db8" "checksum tokio-uds 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bd209039933255ea77c6d7a1d18abc20b997d161acb900acca6eb74cdd049f31" "checksum toml 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "fcd27a04ca509aff336ba5eb2abc58d456f52c4ff64d9724d88acb85ead560b6" -"checksum toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a442dfc13508e603c3f763274361db7f79d7469a0e95c411cde53662ab30fc72" +"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "715254c8f0811be1a79ad3ea5e6fa3c8eddec2b03d7f5ba78cf093e56d79c24f" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" @@ -3154,7 +3126,7 @@ dependencies = [ "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 ws 0.6.0 (git+https://github.com/tomusdrw/ws-rs)" = "" +"checksum ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)" = "" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77b831a5ba77110f438f0ac5583aafeb087f70432998ba6b7dcb1d32185db453" "checksum xml-rs 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "65e74b96bd3179209dc70a980da6df843dff09e46eee103a0376c0949257e3ef" diff --git a/Cargo.toml b/Cargo.toml index d9b3734ec..429ea0dd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ build = "build.rs" [dependencies] log = "0.3" env_logger = "0.4" -rustc-serialize = "0.3" -docopt = "0.7" +rustc-hex = "1.0" +docopt = "0.8" time = "0.1" num_cpus = "1.2" number_prefix = "0.2" @@ -19,9 +19,10 @@ semver = "0.6" ansi_term = "0.9" regex = "0.2" isatty = "0.1" -toml = "0.2" -serde = "0.9" -serde_json = "0.9" +toml = "0.4" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" app_dirs = "1.1.1" futures = "0.1" fdlimit = "0.1" diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index 429ed01f5..f34335d2f 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -17,10 +17,10 @@ parity-dapps-glue = "1.7" mime = "0.2" mime_guess = "1.6.1" rand = "0.3" -rustc-serialize = "0.3" -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +rustc-hex = "1.0" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" time = "0.1.35" unicase = "1.3" url = "1.0" diff --git a/dapps/src/apps/fetcher/mod.rs b/dapps/src/apps/fetcher/mod.rs index d621042c4..ff14def7b 100644 --- a/dapps/src/apps/fetcher/mod.rs +++ b/dapps/src/apps/fetcher/mod.rs @@ -23,7 +23,7 @@ mod installers; use std::{fs, env}; use std::path::PathBuf; use std::sync::Arc; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use fetch::{Client as FetchClient, Fetch}; use hash_fetch::urlhint::{URLHintContract, URLHint, URLHintResult}; use parity_reactor::Remote; diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index 1cbc446a7..0b93f4e39 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -24,7 +24,7 @@ extern crate futures; extern crate linked_hash_map; extern crate mime_guess; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate time; diff --git a/dapps/src/tests/fetch.rs b/dapps/src/tests/fetch.rs index 51650a963..8abc86196 100644 --- a/dapps/src/tests/fetch.rs +++ b/dapps/src/tests/fetch.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use devtools::http_client; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use tests::helpers::{ serve_with_registrar, serve_with_registrar_and_sync, serve_with_fetch, serve_with_registrar_and_fetch, serve_with_registrar_and_fetch_and_threads, diff --git a/dapps/src/tests/helpers/registrar.rs b/dapps/src/tests/helpers/registrar.rs index 58aad9886..d7890675b 100644 --- a/dapps/src/tests/helpers/registrar.rs +++ b/dapps/src/tests/helpers/registrar.rs @@ -17,7 +17,7 @@ use std::str; use std::sync::Arc; use std::collections::HashMap; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use hash_fetch::urlhint::ContractClient; use util::{Bytes, Address, Mutex, H256, ToPretty}; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 168cf803c..0a2909dd2 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ byteorder = "1.0" clippy = { version = "0.0.103", optional = true} crossbeam = "0.2.9" env_logger = "0.4" -ethabi = "1.0" +ethabi = "2.0" ethash = { path = "../ethash" } ethcore-bloom-journal = { path = "../util/bloom" } ethcore-devtools = { path = "../devtools" } @@ -46,6 +46,7 @@ num_cpus = "1.2" rand = "0.3" rlp = { path = "../util/rlp" } rust-crypto = "0.2.34" +rustc-hex = "1.0" rustc-serialize = "0.3" semver = "0.6" stats = { path = "../util/stats" } diff --git a/ethcore/native_contracts/Cargo.toml b/ethcore/native_contracts/Cargo.toml index 6b225220f..5dc18c8f5 100644 --- a/ethcore/native_contracts/Cargo.toml +++ b/ethcore/native_contracts/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] build = "build.rs" [dependencies] -ethabi = "1.0" +ethabi = "2.0" futures = "0.1" byteorder = "1.0" ethcore-util = { path = "../../util" } diff --git a/ethcore/native_contracts/generator/Cargo.toml b/ethcore/native_contracts/generator/Cargo.toml index a114420f0..a599e756e 100644 --- a/ethcore/native_contracts/generator/Cargo.toml +++ b/ethcore/native_contracts/generator/Cargo.toml @@ -5,5 +5,5 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethabi = "1.0" +ethabi = "2.0" heck = "0.2" diff --git a/ethcore/native_contracts/generator/src/lib.rs b/ethcore/native_contracts/generator/src/lib.rs index 08ce1c97b..793ad6085 100644 --- a/ethcore/native_contracts/generator/src/lib.rs +++ b/ethcore/native_contracts/generator/src/lib.rs @@ -112,7 +112,7 @@ pub fn {snake_name}(&self, call: F, {params}) -> BoxFuture<{output_type}, U: IntoFuture, Error=String>, U::Future: Send + 'static {{ - let function = self.contract.function(r#"{abi_name}"#.to_string()) + let function = self.contract.function(r#"{abi_name}"#) .expect("function existence checked at compile-time; qed"); let call_addr = self.address; diff --git a/ethcore/src/blockchain/blockchain.rs b/ethcore/src/blockchain/blockchain.rs index 8f66c270d..4412df567 100644 --- a/ethcore/src/blockchain/blockchain.rs +++ b/ethcore/src/blockchain/blockchain.rs @@ -1460,7 +1460,7 @@ impl BlockChain { mod tests { #![cfg_attr(feature="dev", allow(similar_names))] use std::sync::Arc; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::kvdb::KeyValueDB; use util::hash::*; use util::sha3::Hashable; diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs index 90190ac8e..084be4666 100644 --- a/ethcore/src/builtin.rs +++ b/ethcore/src/builtin.rs @@ -500,7 +500,7 @@ mod tests { use super::{Builtin, Linear, ethereum_builtin, Pricer, Modexp}; use ethjson; use util::{U256, BytesRef}; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; #[test] fn identity() { @@ -524,7 +524,6 @@ mod tests { #[test] fn sha256() { - use rustc_serialize::hex::FromHex; let f = ethereum_builtin("sha256"); let i = [0u8; 0]; @@ -548,7 +547,6 @@ mod tests { #[test] fn ripemd160() { - use rustc_serialize::hex::FromHex; let f = ethereum_builtin("ripemd160"); let i = [0u8; 0]; @@ -568,7 +566,6 @@ mod tests { #[test] fn ecrecover() { - use rustc_serialize::hex::FromHex; /*let k = KeyPair::from_secret(b"test".sha3()).unwrap(); let a: Address = From::from(k.public().sha3()); println!("Address: {}", a); @@ -627,7 +624,6 @@ mod tests { #[test] fn modexp() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Modexp { divisor: 20 }), @@ -714,7 +710,6 @@ mod tests { #[test] fn bn128_add() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Linear { base: 0, word: 0 }), @@ -776,7 +771,6 @@ mod tests { #[test] fn bn128_mul() { - use rustc_serialize::hex::FromHex; let f = Builtin { pricer: Box::new(Linear { base: 0, word: 0 }), diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index 19fdd74c8..e656e6c42 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -17,6 +17,7 @@ //! Test client. use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrder}; +use rustc_hex::FromHex; use util::*; use rlp::*; use ethkey::{Generator, Random}; diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index 70d4e0ced..e7d0dab86 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -651,6 +651,7 @@ impl Engine for Tendermint { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use block::*; use error::{Error, BlockError}; diff --git a/ethcore/src/engines/validator_set/contract.rs b/ethcore/src/engines/validator_set/contract.rs index c2d3fd064..46f5c8512 100644 --- a/ethcore/src/engines/validator_set/contract.rs +++ b/ethcore/src/engines/validator_set/contract.rs @@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use rlp::encode; use spec::Spec; diff --git a/ethcore/src/engines/validator_set/safe_contract.rs b/ethcore/src/engines/validator_set/safe_contract.rs index de8d16ddc..45c9a6912 100644 --- a/ethcore/src/engines/validator_set/safe_contract.rs +++ b/ethcore/src/engines/validator_set/safe_contract.rs @@ -200,7 +200,7 @@ impl ValidatorSafeContract { // decode log manually until the native contract generator is // good enough to do it for us. - let &(_, _, ref validators_token) = &matched_event.params[1]; + let validators_token = &matched_event[1].value; let validators = validators_token.clone().to_array() .and_then(|a| a.into_iter() @@ -420,6 +420,7 @@ impl ValidatorSet for ValidatorSafeContract { #[cfg(test)] mod tests { + use rustc_hex::FromHex; use util::*; use types::ids::BlockId; use spec::Spec; diff --git a/ethcore/src/env_info.rs b/ethcore/src/env_info.rs index cc42008d5..4f6a330b0 100644 --- a/ethcore/src/env_info.rs +++ b/ethcore/src/env_info.rs @@ -76,8 +76,6 @@ impl From for EnvInfo { #[cfg(test)] mod tests { - extern crate rustc_serialize; - use std::str::FromStr; use super::*; use util::{U256, Address}; diff --git a/ethcore/src/evm/interpreter/shared_cache.rs b/ethcore/src/evm/interpreter/shared_cache.rs index ed3b59340..a93afa79a 100644 --- a/ethcore/src/evm/interpreter/shared_cache.rs +++ b/ethcore/src/evm/interpreter/shared_cache.rs @@ -92,7 +92,7 @@ impl Default for SharedCache { #[test] fn test_find_jump_destinations() { - use util::FromHex; + use rustc_hex::FromHex; // given let code = "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b01600055".from_hex().unwrap(); diff --git a/ethcore/src/evm/tests.rs b/ethcore/src/evm/tests.rs index 7f3cf0e1c..f7d82daa4 100644 --- a/ethcore/src/evm/tests.rs +++ b/ethcore/src/evm/tests.rs @@ -14,12 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +use std::fmt::Debug; +use rustc_hex::FromHex; use util::*; use action_params::{ActionParams, ActionValue}; use env_info::EnvInfo; use types::executed::CallType; use evm::{self, Ext, Schedule, Factory, GasLeft, VMType, ContractCreateResult, MessageCallResult, CreateContractAddress, ReturnData}; -use std::fmt::Debug; use tests::helpers::*; use types::transaction::SYSTEM_ADDRESS; use executive::Executive; diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index b486aa8d4..4038fe30d 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -578,9 +578,10 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> { #[allow(dead_code)] mod tests { use std::sync::Arc; + use rustc_hex::FromHex; use ethkey::{Generator, Random}; use super::*; - use util::{H256, U256, U512, Address, FromHex, FromStr}; + use util::{H256, U256, U512, Address, FromStr}; use util::bytes::BytesRef; use action_params::{ActionParams, ActionValue}; use env_info::EnvInfo; diff --git a/ethcore/src/header.rs b/ethcore/src/header.rs index aa114c01e..f5bf1dcfd 100644 --- a/ethcore/src/header.rs +++ b/ethcore/src/header.rs @@ -305,7 +305,7 @@ impl HeapSizeOf for Header { #[cfg(test)] mod tests { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use rlp; use super::Header; diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 7dc49fff8..746a737bf 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -99,6 +99,7 @@ extern crate num_cpus; extern crate num; extern crate rand; extern crate rlp; +extern crate rustc_hex; extern crate rustc_serialize; extern crate semver; extern crate stats; diff --git a/ethcore/src/miner/banning_queue.rs b/ethcore/src/miner/banning_queue.rs index 20b46d760..46d7e7cf8 100644 --- a/ethcore/src/miner/banning_queue.rs +++ b/ethcore/src/miner/banning_queue.rs @@ -209,13 +209,14 @@ impl DerefMut for BanningTransactionQueue { #[cfg(test)] mod tests { use std::time::Duration; + use rustc_hex::FromHex; use super::{BanningTransactionQueue, Threshold}; use ethkey::{Random, Generator}; use transaction::{Transaction, SignedTransaction, Action}; use error::{Error, TransactionError}; use client::TransactionImportResult; use miner::{TransactionQueue, TransactionOrigin}; - use util::{U256, Address, FromHex, Hashable}; + use util::{U256, Address, Hashable}; use miner::transaction_queue::test::DummyTransactionDetailsProvider; fn queue() -> BanningTransactionQueue { diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index c772490ba..208c778bc 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -1261,10 +1261,11 @@ mod tests { use std::sync::Arc; use std::time::Duration; + use rustc_hex::FromHex; use super::super::{MinerService, PrioritizationStrategy}; use super::*; use block::IsBlock; - use util::{U256, FromHex}; + use util::U256; use ethkey::{Generator, Random}; use client::{BlockChainClient, TestBlockChainClient, EachBlockWith, TransactionImportResult}; use header::BlockNumber; diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index d833f8f6a..8da9f7150 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -27,13 +27,13 @@ //! extern crate ethcore_util as util; //! extern crate ethcore; //! extern crate ethkey; -//! extern crate rustc_serialize; +//! extern crate rustc_hex; //! //! use util::{U256, Address}; //! use ethkey::{Random, Generator}; //! use ethcore::miner::{TransactionQueue, RemovalReason, TransactionQueueDetailsProvider, AccountDetails, TransactionOrigin}; //! use ethcore::transaction::*; -//! use rustc_serialize::hex::FromHex; +//! use rustc_hex::FromHex; //! //! #[derive(Default)] //! struct DummyTransactionDetailsProvider; @@ -1422,7 +1422,7 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option for PendingTransaction { #[test] fn sender_test() { - let t: UnverifiedTransaction = decode(&::rustc_serialize::hex::FromHex::from_hex("f85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804").unwrap()); + let t: UnverifiedTransaction = decode(&::rustc_hex::FromHex::from_hex("f85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804").unwrap()); assert_eq!(t.data, b""); assert_eq!(t.gas, U256::from(0x5208u64)); assert_eq!(t.gas_price, U256::from(0x01u64)); @@ -612,7 +612,7 @@ fn should_recover_from_network_specific_signing() { #[test] fn should_agree_with_vitalik() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let test_vector = |tx_data: &str, address: &'static str| { let signed = decode(&FromHex::from_hex(tx_data).unwrap()); diff --git a/ethcore/src/views/block.rs b/ethcore/src/views/block.rs index 463eb7240..f00ca548f 100644 --- a/ethcore/src/views/block.rs +++ b/ethcore/src/views/block.rs @@ -163,7 +163,7 @@ impl<'a> Hashable for BlockView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::H256; use super::BlockView; diff --git a/ethcore/src/views/body.rs b/ethcore/src/views/body.rs index c32796628..038e152b0 100644 --- a/ethcore/src/views/body.rs +++ b/ethcore/src/views/body.rs @@ -130,7 +130,7 @@ impl<'a> BodyView<'a> { #[cfg(test)] mod tests { - use util::*; + use rustc_hex::FromHex; use super::BodyView; use blockchain::BlockChain; diff --git a/ethcore/src/views/header.rs b/ethcore/src/views/header.rs index 618728525..4506d98ec 100644 --- a/ethcore/src/views/header.rs +++ b/ethcore/src/views/header.rs @@ -104,7 +104,7 @@ impl<'a> Hashable for HeaderView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::{H256, Address, H2048, U256}; use super::HeaderView; diff --git a/ethcore/src/views/transaction.rs b/ethcore/src/views/transaction.rs index 0b5b2e1ff..11c7fc2f1 100644 --- a/ethcore/src/views/transaction.rs +++ b/ethcore/src/views/transaction.rs @@ -77,7 +77,7 @@ impl<'a> Hashable for TransactionView<'a> { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use util::U256; use super::TransactionView; diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 7d038a7f7..342410adc 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -8,7 +8,7 @@ rand = "0.3.14" lazy_static = "0.2" tiny-keccak = "1.2" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -rustc-serialize = "0.3" +rustc-hex = "1.0" ethcore-bigint = { path = "../util/bigint" } rust-crypto = "0.2" byteorder = "1.0" diff --git a/ethkey/cli/Cargo.toml b/ethkey/cli/Cargo.toml index 01cc9849f..3ea931e25 100644 --- a/ethkey/cli/Cargo.toml +++ b/ethkey/cli/Cargo.toml @@ -5,8 +5,10 @@ authors = ["Parity Technologies "] [dependencies] ethkey = { path = "../" } -rustc-serialize = "0.3" -docopt = "0.7" +serde = "1.0" +serde_derive = "1.0" +rustc-hex = "1.0" +docopt = "0.8" [[bin]] name = "ethkey" diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index 757c8198f..0d96c2a89 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -15,13 +15,16 @@ // along with Parity. If not, see . extern crate docopt; -extern crate rustc_serialize; +extern crate rustc_hex; +extern crate serde; +#[macro_use] +extern crate serde_derive; extern crate ethkey; use std::{env, fmt, process}; use std::num::ParseIntError; use docopt::Docopt; -use rustc_serialize::hex::{FromHex, FromHexError}; +use rustc_hex::{FromHex, FromHexError}; use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; pub const USAGE: &'static str = r#" @@ -54,7 +57,7 @@ Commands: verify Verify signer of the signature. "#; -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_info: bool, cmd_generate: bool, @@ -83,6 +86,7 @@ enum Error { Ethkey(EthkeyError), FromHex(FromHexError), ParseInt(ParseIntError), + Docopt(docopt::Error), } impl From for Error { @@ -103,12 +107,19 @@ impl From for Error { } } +impl From for Error { + fn from(err: docopt::Error) -> Self { + Error::Docopt(err) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { Error::Ethkey(ref e) => write!(f, "{}", e), Error::FromHex(ref e) => write!(f, "{}", e), Error::ParseInt(ref e) => write!(f, "{}", e), + Error::Docopt(ref e) => write!(f, "{}", e), } } } @@ -155,8 +166,7 @@ fn display(keypair: KeyPair, mode: DisplayMode) -> String { fn execute(command: I) -> Result where I: IntoIterator, S: AsRef { let args: Args = Docopt::new(USAGE) - .and_then(|d| d.argv(command).decode()) - .unwrap_or_else(|e| e.exit()); + .and_then(|d| d.argv(command).deserialize())?; return if args.cmd_info { let display_mode = DisplayMode::new(&args); diff --git a/ethkey/src/keypair.rs b/ethkey/src/keypair.rs index 8975063d5..5a13d476b 100644 --- a/ethkey/src/keypair.rs +++ b/ethkey/src/keypair.rs @@ -16,7 +16,7 @@ use std::fmt; use secp256k1::key; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use keccak::Keccak256; use super::{Secret, Public, Address, SECP256K1, Error}; diff --git a/ethkey/src/lib.rs b/ethkey/src/lib.rs index 60039b671..e87e198df 100644 --- a/ethkey/src/lib.rs +++ b/ethkey/src/lib.rs @@ -19,7 +19,7 @@ extern crate rand; extern crate lazy_static; extern crate tiny_keccak; extern crate secp256k1; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate ethcore_bigint as bigint; extern crate crypto as rcrypto; extern crate byteorder; diff --git a/ethkey/src/signature.rs b/ethkey/src/signature.rs index 91fe3e2a3..67115c98b 100644 --- a/ethkey/src/signature.rs +++ b/ethkey/src/signature.rs @@ -21,7 +21,7 @@ use std::str::FromStr; use std::hash::{Hash, Hasher}; use secp256k1::{Message as SecpMessage, RecoverableSignature, RecoveryId, Error as SecpError}; use secp256k1::key::{SecretKey, PublicKey}; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use bigint::hash::{H520, H256}; use {Secret, Public, SECP256K1, Error, Message, public_to_address, Address}; diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index a2efaf286..117332022 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -8,10 +8,10 @@ log = "0.3" libc = "0.2" rand = "0.3" ethkey = { path = "../ethkey" } -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" -rustc-serialize = "0.3" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" +rustc-hex = "1.0" rust-crypto = "0.2.36" tiny-keccak = "1.0" time = "0.1.34" diff --git a/ethstore/cli/Cargo.toml b/ethstore/cli/Cargo.toml index 28e210cec..80d20f792 100644 --- a/ethstore/cli/Cargo.toml +++ b/ethstore/cli/Cargo.toml @@ -4,8 +4,10 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -rustc-serialize = "0.3" -docopt = "0.7" +rustc-hex = "1.0" +serde = "1.0" +serde_derive = "1.0" +docopt = "0.8" ethstore = { path = "../" } [[bin]] diff --git a/ethstore/cli/src/main.rs b/ethstore/cli/src/main.rs index 3e8df3a35..06ebfcd20 100644 --- a/ethstore/cli/src/main.rs +++ b/ethstore/cli/src/main.rs @@ -14,16 +14,19 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate rustc_serialize; +extern crate rustc_hex; extern crate docopt; +extern crate serde; +#[macro_use] +extern crate serde_derive; extern crate ethstore; -use std::{env, process, fs}; +use std::{env, process, fs, fmt}; use std::io::Read; use docopt::Docopt; use ethstore::ethkey::Address; use ethstore::dir::{paths, KeyDirectory, RootDiskDirectory}; -use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, Error, PresaleWallet, +use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, SecretVaultRef, StoreAccountRef}; pub const USAGE: &'static str = r#" @@ -75,7 +78,7 @@ Commands: move-from-vault Move account to root directory from given vault. "#; -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_insert: bool, cmd_change_pwd: bool, @@ -104,6 +107,32 @@ struct Args { flag_vault_pwd: String, } +enum Error { + Ethstore(ethstore::Error), + Docopt(docopt::Error), +} + +impl From for Error { + fn from(err: ethstore::Error) -> Self { + Error::Ethstore(err) + } +} + +impl From for Error { + fn from(err: docopt::Error) -> Self { + Error::Docopt(err) + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Error::Ethstore(ref err) => fmt::Display::fmt(err, f), + Error::Docopt(ref err) => fmt::Display::fmt(err, f), + } + } +} + fn main() { match execute(env::args()) { Ok(result) => println!("{}", result), @@ -159,9 +188,9 @@ fn format_vaults(vaults: &[String]) -> String { } fn load_password(path: &str) -> Result { - let mut file = fs::File::open(path).map_err(|e| Error::Custom(format!("Error opening password file {}: {}", path, e)))?; + let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file {}: {}", path, e)))?; let mut password = String::new(); - file.read_to_string(&mut password).map_err(|e| Error::Custom(format!("Error reading password file {}: {}", path, e)))?; + file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file {}: {}", path, e)))?; // drop EOF let _ = password.pop(); Ok(password) @@ -169,19 +198,18 @@ fn load_password(path: &str) -> Result { fn execute(command: I) -> Result where I: IntoIterator, S: AsRef { let args: Args = Docopt::new(USAGE) - .and_then(|d| d.argv(command).decode()) - .unwrap_or_else(|e| e.exit()); + .and_then(|d| d.argv(command).deserialize())?; let store = EthStore::open(key_dir(&args.flag_dir)?)?; return if args.cmd_insert { - let secret = args.arg_secret.parse().map_err(|_| Error::InvalidSecret)?; + let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?; let password = load_password(&args.arg_password)?; let vault_ref = open_args_vault(&store, &args)?; let address = store.insert_account(vault_ref, secret, &password)?; Ok(format!("0x{:?}", address)) } else if args.cmd_change_pwd { - let address = args.arg_address.parse().map_err(|_| Error::InvalidAccount)?; + let address = args.arg_address.parse().map_err(|_| ethstore::Error::InvalidAccount)?; let old_pwd = load_password(&args.arg_old_pwd)?; let new_pwd = load_password(&args.arg_new_pwd)?; let account_ref = open_args_vault_account(&store, address, &args)?; @@ -209,20 +237,20 @@ fn execute(command: I) -> Result where I: IntoIterator(command: I) -> Result where I: IntoIterator); @@ -30,9 +30,9 @@ impl ops::Deref for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { let s = String::deserialize(deserializer)?; let data = s.from_hex().map_err(|e| Error::custom(format!("Invalid hex value {}", e)))?; diff --git a/ethstore/src/json/cipher.rs b/ethstore/src/json/cipher.rs index 3505a3e81..33f4ec572 100644 --- a/ethstore/src/json/cipher.rs +++ b/ethstore/src/json/cipher.rs @@ -33,16 +33,16 @@ impl Serialize for CipherSer { } } -impl Deserialize for CipherSer { +impl<'a> Deserialize<'a> for CipherSer { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(CipherSerVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(CipherSerVisitor) } } struct CipherSerVisitor; -impl Visitor for CipherSerVisitor { +impl<'a> Visitor<'a> for CipherSerVisitor { type Value = CipherSer; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -80,9 +80,9 @@ impl Serialize for CipherSerParams { } } -impl Deserialize for CipherSerParams { +impl<'a> Deserialize<'a> for CipherSerParams { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { Aes128Ctr::deserialize(deserializer) .map(CipherSerParams::Aes128Ctr) .map_err(|_| Error::InvalidCipherParams) diff --git a/ethstore/src/json/crypto.rs b/ethstore/src/json/crypto.rs index ee1f08502..03f72e576 100644 --- a/ethstore/src/json/crypto.rs +++ b/ethstore/src/json/crypto.rs @@ -17,7 +17,7 @@ use std::{fmt, str}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::ser::SerializeStruct; -use serde::de::{Visitor, MapVisitor, Error}; +use serde::de::{Visitor, MapAccess, Error}; use serde_json; use super::{Cipher, CipherSer, CipherSerParams, Kdf, KdfSer, KdfSerParams, H256, Bytes}; @@ -54,17 +54,17 @@ enum CryptoField { Mac, } -impl Deserialize for CryptoField { +impl<'a> Deserialize<'a> for CryptoField { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(CryptoFieldVisitor) + deserializer.deserialize_any(CryptoFieldVisitor) } } struct CryptoFieldVisitor; -impl Visitor for CryptoFieldVisitor { +impl<'a> Visitor<'a> for CryptoFieldVisitor { type Value = CryptoField; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -86,9 +86,9 @@ impl Visitor for CryptoFieldVisitor { } } -impl Deserialize for Crypto { +impl<'a> Deserialize<'a> for Crypto { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; deserializer.deserialize_struct("Crypto", FIELDS, CryptoVisitor) @@ -97,7 +97,7 @@ impl Deserialize for Crypto { struct CryptoVisitor; -impl Visitor for CryptoVisitor { +impl<'a> Visitor<'a> for CryptoVisitor { type Value = Crypto; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -105,7 +105,7 @@ impl Visitor for CryptoVisitor { } fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor + where V: MapAccess<'a> { let mut cipher = None; let mut cipherparams = None; @@ -115,13 +115,13 @@ impl Visitor for CryptoVisitor { let mut mac = None; loop { - match visitor.visit_key()? { - Some(CryptoField::Cipher) => { cipher = Some(visitor.visit_value()?); } - Some(CryptoField::CipherParams) => { cipherparams = Some(visitor.visit_value()?); } - Some(CryptoField::CipherText) => { ciphertext = Some(visitor.visit_value()?); } - Some(CryptoField::Kdf) => { kdf = Some(visitor.visit_value()?); } - Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.visit_value()?); } - Some(CryptoField::Mac) => { mac = Some(visitor.visit_value()?); } + match visitor.next_key()? { + Some(CryptoField::Cipher) => { cipher = Some(visitor.next_value()?); } + Some(CryptoField::CipherParams) => { cipherparams = Some(visitor.next_value()?); } + Some(CryptoField::CipherText) => { ciphertext = Some(visitor.next_value()?); } + Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); } + Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); } + Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); } None => { break; } } } diff --git a/ethstore/src/json/hash.rs b/ethstore/src/json/hash.rs index 328f155c2..13564c95d 100644 --- a/ethstore/src/json/hash.rs +++ b/ethstore/src/json/hash.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use std::{ops, fmt, str}; -use rustc_serialize::hex::{FromHex, ToHex}; +use rustc_hex::{FromHex, ToHex}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use super::Error; @@ -54,12 +54,12 @@ macro_rules! impl_hash { } } - impl Deserialize for $name { + impl<'a> Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -75,7 +75,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/ethstore/src/json/id.rs b/ethstore/src/json/id.rs index 8dfcc3028..aa90a4d7a 100644 --- a/ethstore/src/json/id.rs +++ b/ethstore/src/json/id.rs @@ -16,7 +16,7 @@ //! Universaly unique identifier. use std::{fmt, str}; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use serde::{Deserialize, Serialize, Deserializer, Serializer}; use serde::de::{Visitor, Error as SerdeError}; use super::Error; @@ -108,16 +108,16 @@ impl Serialize for Uuid { } } -impl Deserialize for Uuid { +impl<'a> Deserialize<'a> for Uuid { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UuidVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UuidVisitor) } } struct UuidVisitor; -impl Visitor for UuidVisitor { +impl<'a> Visitor<'a> for UuidVisitor { type Value = Uuid; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/ethstore/src/json/kdf.rs b/ethstore/src/json/kdf.rs index 9130fe507..6498323be 100644 --- a/ethstore/src/json/kdf.rs +++ b/ethstore/src/json/kdf.rs @@ -35,16 +35,16 @@ impl Serialize for KdfSer { } } -impl Deserialize for KdfSer { +impl<'a> Deserialize<'a> for KdfSer { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(KdfSerVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(KdfSerVisitor) } } struct KdfSerVisitor; -impl Visitor for KdfSerVisitor { +impl<'a> Visitor<'a> for KdfSerVisitor { type Value = KdfSer; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -78,16 +78,16 @@ impl Serialize for Prf { } } -impl Deserialize for Prf { +impl<'a> Deserialize<'a> for Prf { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(PrfVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(PrfVisitor) } } struct PrfVisitor; -impl Visitor for PrfVisitor { +impl<'a> Visitor<'a> for PrfVisitor { type Value = Prf; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -139,9 +139,9 @@ impl Serialize for KdfSerParams { } } -impl Deserialize for KdfSerParams { +impl<'a> Deserialize<'a> for KdfSerParams { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { use serde_json::{Value, from_value}; let v: Value = Deserialize::deserialize(deserializer)?; diff --git a/ethstore/src/json/key_file.rs b/ethstore/src/json/key_file.rs index a1c20acf2..60b34681e 100644 --- a/ethstore/src/json/key_file.rs +++ b/ethstore/src/json/key_file.rs @@ -17,7 +17,7 @@ use std::fmt; use std::io::{Read, Write}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; -use serde::de::{Error, Visitor, MapVisitor}; +use serde::de::{Error, Visitor, MapAccess, DeserializeOwned}; use serde_json; use super::{Uuid, Version, Crypto, H160}; @@ -60,17 +60,17 @@ enum KeyFileField { Meta, } -impl Deserialize for KeyFileField { +impl<'a> Deserialize<'a> for KeyFileField { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(KeyFileFieldVisitor) + deserializer.deserialize_any(KeyFileFieldVisitor) } } struct KeyFileFieldVisitor; -impl Visitor for KeyFileFieldVisitor { +impl<'a> Visitor<'a> for KeyFileFieldVisitor { type Value = KeyFileField; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -93,9 +93,9 @@ impl Visitor for KeyFileFieldVisitor { } } -impl Deserialize for KeyFile { +impl<'a> Deserialize<'a> for KeyFile { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { static FIELDS: &'static [&'static str] = &["id", "version", "crypto", "Crypto", "address"]; deserializer.deserialize_struct("KeyFile", FIELDS, KeyFileVisitor) @@ -103,8 +103,8 @@ impl Deserialize for KeyFile { } -fn none_if_empty(v: Option) -> Option where - T: Deserialize, +fn none_if_empty<'a, T>(v: Option) -> Option where + T: DeserializeOwned { v.and_then(|v| if v.is_null() { None @@ -115,7 +115,7 @@ fn none_if_empty(v: Option) -> Option where } struct KeyFileVisitor; -impl Visitor for KeyFileVisitor { +impl<'a> Visitor<'a> for KeyFileVisitor { type Value = KeyFile; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -123,7 +123,7 @@ impl Visitor for KeyFileVisitor { } fn visit_map(self, mut visitor: V) -> Result - where V: MapVisitor + where V: MapAccess<'a> { let mut id = None; let mut version = None; @@ -133,13 +133,13 @@ impl Visitor for KeyFileVisitor { let mut meta = None; loop { - match visitor.visit_key()? { - Some(KeyFileField::Id) => { id = Some(visitor.visit_value()?); } - 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 = none_if_empty(visitor.visit_value().ok()) } - Some(KeyFileField::Meta) => { meta = none_if_empty(visitor.visit_value().ok()) } + match visitor.next_key()? { + Some(KeyFileField::Id) => { id = Some(visitor.next_value()?); } + Some(KeyFileField::Version) => { version = Some(visitor.next_value()?); } + Some(KeyFileField::Crypto) => { crypto = Some(visitor.next_value()?); } + Some(KeyFileField::Address) => { address = Some(visitor.next_value()?); } + Some(KeyFileField::Name) => { name = none_if_empty(visitor.next_value().ok()) } + Some(KeyFileField::Meta) => { meta = none_if_empty(visitor.next_value().ok()) } None => { break; } } } diff --git a/ethstore/src/json/version.rs b/ethstore/src/json/version.rs index 68f0834a9..0eb8450f1 100644 --- a/ethstore/src/json/version.rs +++ b/ethstore/src/json/version.rs @@ -33,16 +33,16 @@ impl Serialize for Version { } } -impl Deserialize for Version { +impl<'a> Deserialize<'a> for Version { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(VersionVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(VersionVisitor) } } struct VersionVisitor; -impl Visitor for VersionVisitor { +impl<'a> Visitor<'a> for VersionVisitor { type Value = Version; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/ethstore/src/lib.rs b/ethstore/src/lib.rs index 06a8259de..65935f89c 100755 --- a/ethstore/src/lib.rs +++ b/ethstore/src/lib.rs @@ -23,7 +23,7 @@ extern crate itertools; extern crate libc; extern crate parking_lot; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate smallvec; diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index 55defab7b..43f3ee38f 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -9,8 +9,10 @@ name = "parity-evm" path = "./src/main.rs" [dependencies] -rustc-serialize = "0.3" -docopt = { version = "0.7" } +rustc-hex = "1.0" +docopt = "0.8" +serde = "1.0" +serde_derive = "1.0" ethcore = { path = "../ethcore" } ethcore-util = { path = "../util" } diff --git a/evmbin/benches/mod.rs b/evmbin/benches/mod.rs index 7ddc50681..a3017c37e 100644 --- a/evmbin/benches/mod.rs +++ b/evmbin/benches/mod.rs @@ -26,14 +26,14 @@ extern crate test; extern crate ethcore; extern crate evm; extern crate ethcore_util; -extern crate rustc_serialize; +extern crate rustc_hex; use self::test::{Bencher, black_box}; use evm::run_vm; use ethcore::action_params::ActionParams; use ethcore_util::U256; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; #[bench] fn simple_loop_usize(b: &mut Bencher) { diff --git a/evmbin/src/display/json.rs b/evmbin/src/display/json.rs index 38265c14c..1791640d6 100644 --- a/evmbin/src/display/json.rs +++ b/evmbin/src/display/json.rs @@ -122,7 +122,7 @@ impl trace::VMTracer for Informant { fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized { let mut vm = Informant::default(); vm.depth = self.depth + 1; - vm.code = code.into_vec(); + vm.code = code.to_vec(); vm.gas_used = self.gas_used; vm } diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index a7d90b90b..305b2cbd4 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -19,14 +19,18 @@ #![warn(missing_docs)] #![allow(dead_code)] extern crate ethcore; -extern crate rustc_serialize; +extern crate rustc_hex; +extern crate serde; +#[macro_use] +extern crate serde_derive; extern crate docopt; extern crate ethcore_util as util; use std::sync::Arc; use std::{fmt, fs}; use docopt::Docopt; -use util::{U256, FromHex, Bytes, Address}; +use rustc_hex::FromHex; +use util::{U256, Bytes, Address}; use ethcore::spec; use ethcore::action_params::ActionParams; @@ -58,7 +62,7 @@ General options: fn main() { - let args: Args = Docopt::new(USAGE).and_then(|d| d.decode()).unwrap_or_else(|e| e.exit()); + let args: Args = Docopt::new(USAGE).and_then(|d| d.deserialize()).unwrap_or_else(|e| e.exit()); if args.flag_json { run(args, display::json::Informant::default()) @@ -86,7 +90,7 @@ fn run(args: Args, mut informant: T) { informant.finish(result); } -#[derive(Debug, RustcDecodable)] +#[derive(Debug, Deserialize)] struct Args { cmd_stats: bool, flag_from: Option, diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 600402559..17da00215 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -7,13 +7,13 @@ version = "1.7.0" authors = ["Parity Technologies "] [dependencies] -ethabi = "1.0" +ethabi = "2.0" futures = "0.1" log = "0.3" mime = "0.2" mime_guess = "1.6.1" rand = "0.3" -rustc-serialize = "0.3" +rustc-hex = "1.0" fetch = { path = "../util/fetch" } ethcore-util = { path = "../util" } parity-reactor = { path = "../util/reactor" } diff --git a/hash-fetch/src/lib.rs b/hash-fetch/src/lib.rs index 9019f744d..4952ecea2 100644 --- a/hash-fetch/src/lib.rs +++ b/hash-fetch/src/lib.rs @@ -30,7 +30,7 @@ extern crate mime_guess; extern crate native_contracts; extern crate parity_reactor; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; pub extern crate fetch; diff --git a/hash-fetch/src/urlhint.rs b/hash-fetch/src/urlhint.rs index cd7d2a2c5..bc4b63cf2 100644 --- a/hash-fetch/src/urlhint.rs +++ b/hash-fetch/src/urlhint.rs @@ -17,7 +17,7 @@ //! URLHint Contract use std::sync::Arc; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use mime::Mime; use mime_guess; @@ -209,7 +209,7 @@ fn guess_mime_type(url: &str) -> Option { pub mod tests { use std::sync::Arc; use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use futures::{BoxFuture, Future, IntoFuture}; diff --git a/hw/Cargo.toml b/hw/Cargo.toml index ca236d130..261721470 100644 --- a/hw/Cargo.toml +++ b/hw/Cargo.toml @@ -15,4 +15,4 @@ ethkey = { path = "../ethkey" } ethcore-bigint = { path = "../util/bigint" } [dev-dependencies] -rustc-serialize = "0.3" +rustc-hex = "1.0" diff --git a/hw/src/ledger.rs b/hw/src/ledger.rs index 2f209afa5..0d787588d 100644 --- a/hw/src/ledger.rs +++ b/hw/src/ledger.rs @@ -340,7 +340,7 @@ impl Manager { #[test] fn smoke() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let mut manager = Manager::new().unwrap(); manager.update_devices().unwrap(); for d in &manager.devices { diff --git a/hw/src/lib.rs b/hw/src/lib.rs index a35607305..cda6c2241 100644 --- a/hw/src/lib.rs +++ b/hw/src/lib.rs @@ -22,7 +22,7 @@ extern crate libusb; extern crate ethkey; extern crate ethcore_bigint as bigint; #[macro_use] extern crate log; -#[cfg(test)] extern crate rustc_serialize; +#[cfg(test)] extern crate rustc_hex; mod ledger; diff --git a/json/Cargo.toml b/json/Cargo.toml index 577d0d9e8..81af58ac7 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Parity Technologies "] [dependencies] ethcore-util = { path = "../util" } -rustc-serialize = "0.3" -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" +rustc-hex = "1.0" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" clippy = { version = "0.0.103", optional = true} diff --git a/json/src/bytes.rs b/json/src/bytes.rs index 0900ec999..79ba4f896 100644 --- a/json/src/bytes.rs +++ b/json/src/bytes.rs @@ -19,7 +19,7 @@ use std::fmt; use std::str::FromStr; use std::ops::Deref; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use serde::{Deserialize, Deserializer}; use serde::de::{Error, Visitor}; @@ -67,16 +67,16 @@ impl FromStr for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(BytesVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(BytesVisitor) } } struct BytesVisitor; -impl Visitor for BytesVisitor { +impl<'a> Visitor<'a> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/json/src/hash.rs b/json/src/hash.rs index 78fa77bd9..64da93e1c 100644 --- a/json/src/hash.rs +++ b/json/src/hash.rs @@ -20,7 +20,7 @@ use std::str::FromStr; use std::fmt; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::de::{Error, Visitor}; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use util::hash::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048}; @@ -42,13 +42,13 @@ macro_rules! impl_hash { } } - impl Deserialize for $name { + impl<'a> Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result - where D: Deserializer { + where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -75,7 +75,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/json/src/lib.rs b/json/src/lib.rs index b65b18cab..c03b9f439 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; extern crate ethcore_util as util; diff --git a/json/src/maybe.rs b/json/src/maybe.rs index 16a01dc44..075aaefbd 100644 --- a/json/src/maybe.rs +++ b/json/src/maybe.rs @@ -4,8 +4,7 @@ use std::fmt; use std::marker::PhantomData; use serde::{Deserialize, Deserializer}; -use serde::de::{Error, Visitor}; -use serde::de::value::ValueDeserializer; +use serde::de::{Error, Visitor, IntoDeserializer}; /// Deserializer of empty string values into optionals. #[derive(Debug, PartialEq, Clone)] @@ -16,10 +15,10 @@ pub enum MaybeEmpty { None, } -impl Deserialize for MaybeEmpty where T: Deserialize { +impl<'a, T> Deserialize<'a> for MaybeEmpty where T: Deserialize<'a> { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(MaybeEmptyVisitor::new()) + where D: Deserializer<'a> { + deserializer.deserialize_any(MaybeEmptyVisitor::new()) } } @@ -35,7 +34,7 @@ impl MaybeEmptyVisitor { } } -impl Visitor for MaybeEmptyVisitor where T: Deserialize { +impl<'a, T> Visitor<'a> for MaybeEmptyVisitor where T: Deserialize<'a> { type Value = MaybeEmpty; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index 44edb5288..f3391e067 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -236,6 +236,7 @@ mod tests { eip161d_transition: Some(Uint(U256::from(0x47))), ecip1010_pause_transition: None, ecip1010_continue_transition: None, + ecip1017_era_rounds: None, max_code_size: None, max_gas_limit_transition: None, max_gas_limit: None, @@ -282,6 +283,7 @@ mod tests { eip161d_transition: None, ecip1010_pause_transition: None, ecip1010_continue_transition: None, + ecip1017_era_rounds: None, max_code_size: None, max_gas_limit_transition: None, max_gas_limit: None, diff --git a/json/src/trie/input.rs b/json/src/trie/input.rs index 86614294e..c84f1aa1e 100644 --- a/json/src/trie/input.rs +++ b/json/src/trie/input.rs @@ -21,7 +21,7 @@ use std::collections::BTreeMap; use std::str::FromStr; use bytes::Bytes; use serde::{Deserialize, Deserializer}; -use serde::de::{Error as ErrorTrait, Visitor, MapVisitor, SeqVisitor}; +use serde::de::{Error as ErrorTrait, Visitor, MapAccess, SeqAccess}; /// Trie test input. #[derive(Debug, PartialEq)] @@ -30,35 +30,35 @@ pub struct Input { pub data: BTreeMap>, } -impl Deserialize for Input { +impl<'a> Deserialize<'a> for Input { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { - deserializer.deserialize(InputVisitor) + deserializer.deserialize_any(InputVisitor) } } struct InputVisitor; -impl Visitor for InputVisitor { +impl<'a> Visitor<'a> for InputVisitor { type Value = Input; 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 { + fn visit_map(self, mut visitor: V) -> Result where V: MapAccess<'a> { let mut result = BTreeMap::new(); loop { - let key_str: Option = visitor.visit_key()?; + let key_str: Option = visitor.next_key()?; let key = match key_str { 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_str: Option = visitor.next_value()?; let val = match val_str { 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())), @@ -75,11 +75,11 @@ impl Visitor for InputVisitor { Ok(input) } - fn visit_seq(self, mut visitor: V) -> Result where V: SeqVisitor { + fn visit_seq(self, mut visitor: V) -> Result where V: SeqAccess<'a> { let mut result = BTreeMap::new(); loop { - let keyval: Option>> = visitor.visit()?; + let keyval: Option>> = visitor.next_element()?; let keyval = match keyval { Some(k) => k, _ => { break; }, diff --git a/json/src/uint.rs b/json/src/uint.rs index d408b76dc..5e98a9dca 100644 --- a/json/src/uint.rs +++ b/json/src/uint.rs @@ -50,16 +50,16 @@ impl Into for Uint { } } -impl Deserialize for Uint { +impl<'a> Deserialize<'a> for Uint { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UintVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UintVisitor) } } struct UintVisitor; -impl Visitor for UintVisitor { +impl<'a> Visitor<'a> for UintVisitor { type Value = Uint; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/local-store/Cargo.toml b/local-store/Cargo.toml index aa71ab9a2..d7b957fd7 100644 --- a/local-store/Cargo.toml +++ b/local-store/Cargo.toml @@ -9,8 +9,8 @@ ethcore-util = { path = "../util" } ethcore-io = { path = "../util/io" } ethcore = { path = "../ethcore" } rlp = {path = "../util/rlp" } -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" log = "0.3" ethkey = { path = "../ethkey" } diff --git a/parity/blockchain.rs b/parity/blockchain.rs index 17e486b5b..26de04f95 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -20,7 +20,7 @@ use std::io::{BufReader, BufRead}; use std::time::{Instant, Duration}; use std::thread::sleep; use std::sync::Arc; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use util::{ToPretty, U256, H256, Address, Hashable}; use rlp::PayloadInfo; use ethcore::service::ClientService; diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 5aea26000..2b678659c 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -381,7 +381,7 @@ usage! { } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Config { parity: Option, account: Option, @@ -401,7 +401,7 @@ struct Config { stratum: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Operating { mode: Option, mode_timeout: Option, @@ -420,7 +420,7 @@ struct Operating { no_persistent_txqueue: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Account { unlock: Option>, password: Option>, @@ -429,7 +429,7 @@ struct Account { fast_unlock: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ui { force: Option, disable: Option, @@ -439,7 +439,7 @@ struct Ui { path: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Network { warp: Option, port: Option, @@ -458,7 +458,7 @@ struct Network { no_serve_light: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Rpc { disable: Option, port: Option, @@ -469,7 +469,7 @@ struct Rpc { threads: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ws { disable: Option, port: Option, @@ -479,14 +479,14 @@ struct Ws { hosts: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ipc { disable: Option, path: Option, apis: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Dapps { disable: Option, port: Option, @@ -498,7 +498,7 @@ struct Dapps { pass: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct SecretStore { disable: Option, self_secret: Option, @@ -510,7 +510,7 @@ struct SecretStore { path: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Ipfs { enable: Option, port: Option, @@ -519,7 +519,7 @@ struct Ipfs { hosts: Option>, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Mining { author: Option, engine_signer: Option, @@ -547,14 +547,14 @@ struct Mining { refuse_service_transactions: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Stratum { interface: Option, port: Option, secret: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Footprint { tracing: Option, pruning: Option, @@ -572,17 +572,17 @@ struct Footprint { num_verifiers: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Snapshots { disable_periodic: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct VM { jit: Option, } -#[derive(Default, Debug, PartialEq, RustcDecodable)] +#[derive(Default, Debug, PartialEq, Deserialize)] struct Misc { logging: Option, log_file: Option, diff --git a/parity/cli/usage.rs b/parity/cli/usage.rs index 949106ae7..26f697ed8 100644 --- a/parity/cli/usage.rs +++ b/parity/cli/usage.rs @@ -55,28 +55,18 @@ macro_rules! usage { use util::version; use docopt::{Docopt, Error as DocoptError}; use helpers::replace_home; - use rustc_serialize; #[derive(Debug)] pub enum ArgsError { Docopt(DocoptError), - Parsing(Vec), - Decode(toml::DecodeError), + Decode(toml::de::Error), Config(String, io::Error), - UnknownFields(String), } impl ArgsError { pub fn exit(self) -> ! { match self { ArgsError::Docopt(e) => e.exit(), - ArgsError::Parsing(errors) => { - println_stderr!("There is an error in config file."); - for e in &errors { - println_stderr!("{}", e); - } - process::exit(2) - }, ArgsError::Decode(e) => { println_stderr!("You might have supplied invalid parameters in config file."); println_stderr!("{}", e); @@ -87,21 +77,20 @@ macro_rules! usage { println_stderr!("{}", e); process::exit(2) }, - ArgsError::UnknownFields(fields) => { - println_stderr!("You have some extra fields in your config file:"); - println_stderr!("{}", fields); - process::exit(2) - } } } } impl From for ArgsError { - fn from(e: DocoptError) -> Self { ArgsError::Docopt(e) } + fn from(e: DocoptError) -> Self { + ArgsError::Docopt(e) + } } - impl From for ArgsError { - fn from(e: toml::DecodeError) -> Self { ArgsError::Decode(e) } + impl From for ArgsError { + fn from(e: toml::de::Error) -> Self { + ArgsError::Decode(e) + } } #[derive(Debug, PartialEq)] @@ -137,7 +126,7 @@ macro_rules! usage { } } - #[derive(Default, Debug, PartialEq, Clone, RustcDecodable)] + #[derive(Default, Debug, PartialEq, Clone, Deserialize)] struct RawArgs { $( $field_a: $typ_a, @@ -192,20 +181,7 @@ macro_rules! usage { } fn parse_config(config: &str) -> Result { - let mut value_parser = toml::Parser::new(&config); - match value_parser.parse() { - Some(value) => { - let mut decoder = toml::Decoder::new(toml::Value::Table(value)); - let result = rustc_serialize::Decodable::decode(&mut decoder); - - match (result, decoder.toml) { - (Err(e), _) => Err(e.into()), - (_, Some(toml)) => Err(ArgsError::UnknownFields(toml::encode_str(&toml))), - (Ok(config), None) => Ok(config), - } - }, - None => Err(ArgsError::Parsing(value_parser.errors)), - } + Ok(toml::from_str(config)?) } pub fn print_version() -> String { @@ -229,7 +205,7 @@ macro_rules! usage { } pub fn parse>(command: &[S]) -> Result { - Docopt::new(Self::usage()).and_then(|d| d.argv(command).decode()) + Docopt::new(Self::usage()).and_then(|d| d.argv(command).deserialize()) } fn usage() -> String { diff --git a/parity/main.rs b/parity/main.rs index 65a621adf..dc009ff62 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -36,10 +36,12 @@ extern crate number_prefix; extern crate regex; extern crate rlp; extern crate rpassword; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate semver; extern crate serde; extern crate serde_json; +#[macro_use] +extern crate serde_derive; extern crate time; extern crate toml; diff --git a/parity/user_defaults.rs b/parity/user_defaults.rs index cc1d8197b..12bb9937f 100644 --- a/parity/user_defaults.rs +++ b/parity/user_defaults.rs @@ -21,8 +21,8 @@ use std::path::Path; use std::collections::BTreeMap; use std::time::Duration; use serde::{Serialize, Serializer, Deserialize, Deserializer}; -use serde::de::{Error, Visitor, MapVisitor}; -use serde::de::impls::BTreeMapVisitor; +use serde::de::{Error, Visitor, MapAccess}; +use serde::de::value::MapAccessDeserializer; use serde_json::Value; use serde_json::de::from_reader; use serde_json::ser::to_string; @@ -65,22 +65,22 @@ impl Serialize for UserDefaults { struct UserDefaultsVisitor; -impl Deserialize for UserDefaults { +impl<'a> Deserialize<'a> for UserDefaults { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(UserDefaultsVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(UserDefaultsVisitor) } } -impl Visitor for UserDefaultsVisitor { +impl<'a> Visitor<'a> for UserDefaultsVisitor { type Value = UserDefaults; 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)?; + fn visit_map(self, visitor: V) -> Result where V: MapAccess<'a> { + let mut map: BTreeMap = Deserialize::deserialize(MapAccessDeserializer::new(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"))?; let pruning = pruning.parse().map_err(|_| Error::custom("invalid pruning method"))?; diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index c2fe7fb8a..3d0b1e7d3 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -15,11 +15,11 @@ multihash ="0.6" order-stat = "0.1" rand = "0.3" rust-crypto = "0.2" -rustc-serialize = "0.3" +rustc-hex = "1.0" semver = "0.6" -serde = "0.9" -serde_derive = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" time = "0.1" tokio-timer = "0.1" transient-hashmap = "0.4" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 7b8e207b8..38dafc0a4 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -26,7 +26,7 @@ extern crate futures; extern crate multihash; extern crate order_stat; extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate semver; extern crate serde; extern crate serde_json; diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index 43c2c8943..d8d63b5fa 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -99,7 +99,7 @@ fn decrypt_with_shadow_coefficients(mut decrypted_shadow: Public, mut common_sha #[cfg(test)] mod tests { use util::Bytes; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use super::{encrypt_document, decrypt_document, decrypt_document_with_shadow}; #[test] diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 3f158f1c5..33d46c04f 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -18,7 +18,7 @@ use std::str::FromStr; use std::collections::HashMap; use std::sync::Arc; use std::time::{Instant, Duration}; -use rustc_serialize::hex::{FromHex, ToHex}; +use rustc_hex::{FromHex, ToHex}; use time::get_time; use rlp; @@ -536,7 +536,7 @@ fn rpc_eth_transaction_count_by_number_pending() { #[test] fn rpc_eth_pending_transaction_by_hash() { - use util::{H256, FromHex}; + use util::H256; use rlp; use ethcore::transaction::SignedTransaction; diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index cff9e710d..443379b4f 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -16,7 +16,7 @@ use std::sync::Arc; use std::str::FromStr; -use rustc_serialize::hex::FromHex; +use rustc_hex::FromHex; use util::{U256, Address}; use ethcore::miner::MinerService; diff --git a/rpc/src/v1/types/block_number.rs b/rpc/src/v1/types/block_number.rs index 65a46879e..8f3f09f51 100644 --- a/rpc/src/v1/types/block_number.rs +++ b/rpc/src/v1/types/block_number.rs @@ -38,9 +38,9 @@ impl Default for BlockNumber { } } -impl Deserialize for BlockNumber { - fn deserialize(deserializer: D) -> Result where D: Deserializer { - deserializer.deserialize(BlockNumberVisitor) +impl<'a> Deserialize<'a> for BlockNumber { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { + deserializer.deserialize_any(BlockNumberVisitor) } } @@ -67,7 +67,7 @@ impl Serialize for BlockNumber { struct BlockNumberVisitor; -impl Visitor for BlockNumberVisitor { +impl<'a> Visitor<'a> for BlockNumberVisitor { type Value = BlockNumber; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/bytes.rs b/rpc/src/v1/types/bytes.rs index b290dd5ac..deaa234fc 100644 --- a/rpc/src/v1/types/bytes.rs +++ b/rpc/src/v1/types/bytes.rs @@ -17,10 +17,9 @@ //! Serializable wrapper around vector of bytes use std::fmt; -use rustc_serialize::hex::ToHex; +use rustc_hex::{ToHex, FromHex}; use serde::{Serialize, Serializer, Deserialize, Deserializer}; use serde::de::{Error, Visitor}; -use util::common::FromHex; /// Wrapper structure around vector of bytes. #[derive(Debug, PartialEq, Eq, Default, Hash, Clone)] @@ -58,16 +57,16 @@ impl Serialize for Bytes { } } -impl Deserialize for Bytes { +impl<'a> Deserialize<'a> for Bytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(BytesVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(BytesVisitor) } } struct BytesVisitor; -impl Visitor for BytesVisitor { +impl<'a> Visitor<'a> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -98,7 +97,7 @@ impl Visitor for BytesVisitor { mod tests { use super::*; use serde_json; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; #[test] fn test_bytes_serialize() { diff --git a/rpc/src/v1/types/call_request.rs b/rpc/src/v1/types/call_request.rs index 04c9efcaf..71b562e45 100644 --- a/rpc/src/v1/types/call_request.rs +++ b/rpc/src/v1/types/call_request.rs @@ -55,7 +55,7 @@ impl Into for CallRequest { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use serde_json; use v1::types::{U256, H160}; use super::CallRequest; diff --git a/rpc/src/v1/types/derivation.rs b/rpc/src/v1/types/derivation.rs index decf48171..cf0f03c85 100644 --- a/rpc/src/v1/types/derivation.rs +++ b/rpc/src/v1/types/derivation.rs @@ -102,15 +102,15 @@ impl Derive { } } -impl Deserialize for DerivationType { - fn deserialize(deserializer: D) -> Result where D: Deserializer { - deserializer.deserialize(DerivationTypeVisitor) +impl<'a> Deserialize<'a> for DerivationType { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { + deserializer.deserialize_any(DerivationTypeVisitor) } } struct DerivationTypeVisitor; -impl Visitor for DerivationTypeVisitor { +impl<'a> Visitor<'a> for DerivationTypeVisitor { type Value = DerivationType; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/filter.rs b/rpc/src/v1/types/filter.rs index cd1d43fcb..8a1181eb8 100644 --- a/rpc/src/v1/types/filter.rs +++ b/rpc/src/v1/types/filter.rs @@ -15,7 +15,7 @@ // along with Parity. If not, see . use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use serde::de::Error; +use serde::de::{Error, DeserializeOwned}; use serde_json::{Value, from_value}; use ethcore::filter::Filter as EthFilter; use ethcore::client::BlockId; @@ -23,7 +23,7 @@ use v1::types::{BlockNumber, H160, H256, Log}; /// Variadic value #[derive(Debug, PartialEq, Eq, Clone, Hash)] -pub enum VariadicValue where T: Deserialize { +pub enum VariadicValue where T: DeserializeOwned { /// Single Single(T), /// List @@ -32,9 +32,9 @@ pub enum VariadicValue where T: Deserialize { Null, } -impl Deserialize for VariadicValue where T: Deserialize { +impl<'a, T> Deserialize<'a> for VariadicValue where T: DeserializeOwned { fn deserialize(deserializer: D) -> Result, D::Error> - where D: Deserializer { + where D: Deserializer<'a> { let v: Value = Deserialize::deserialize(deserializer)?; if v.is_null() { diff --git a/rpc/src/v1/types/hash.rs b/rpc/src/v1/types/hash.rs index 2f230510d..1816c96d5 100644 --- a/rpc/src/v1/types/hash.rs +++ b/rpc/src/v1/types/hash.rs @@ -19,7 +19,7 @@ use std::str::FromStr; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use serde; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use util::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, H2048 as Eth2048}; macro_rules! impl_hash { @@ -116,11 +116,11 @@ macro_rules! impl_hash { } } - impl serde::Deserialize for $name { - fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer { + impl<'a> serde::Deserialize<'a> for $name { + fn deserialize(deserializer: D) -> Result<$name, D::Error> where D: serde::Deserializer<'a> { struct HashVisitor; - impl serde::de::Visitor for HashVisitor { + impl<'b> serde::de::Visitor<'b> for HashVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -151,7 +151,7 @@ macro_rules! impl_hash { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } } diff --git a/rpc/src/v1/types/index.rs b/rpc/src/v1/types/index.rs index ab8784f49..3c9d56f6e 100644 --- a/rpc/src/v1/types/index.rs +++ b/rpc/src/v1/types/index.rs @@ -29,16 +29,16 @@ impl Index { } } -impl Deserialize for Index { +impl<'a> Deserialize<'a> for Index { fn deserialize(deserializer: D) -> Result - where D: Deserializer { - deserializer.deserialize(IndexVisitor) + where D: Deserializer<'a> { + deserializer.deserialize_any(IndexVisitor) } } struct IndexVisitor; -impl Visitor for IndexVisitor { +impl<'a> Visitor<'a> for IndexVisitor { type Value = Index; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/rpc/src/v1/types/pubsub.rs b/rpc/src/v1/types/pubsub.rs index 1be0d19e3..ce9d6d38d 100644 --- a/rpc/src/v1/types/pubsub.rs +++ b/rpc/src/v1/types/pubsub.rs @@ -74,9 +74,9 @@ impl Default for Params { } } -impl Deserialize for Params { +impl<'a> Deserialize<'a> for Params { fn deserialize(deserializer: D) -> ::std::result::Result - where D: Deserializer { + where D: Deserializer<'a> { let v: Value = Deserialize::deserialize(deserializer)?; if v.is_null() { diff --git a/rpc/src/v1/types/transaction_request.rs b/rpc/src/v1/types/transaction_request.rs index 242c02360..cb74e071b 100644 --- a/rpc/src/v1/types/transaction_request.rs +++ b/rpc/src/v1/types/transaction_request.rs @@ -131,7 +131,7 @@ impl Into for TransactionRequest { #[cfg(test)] mod tests { use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use serde_json; use v1::types::{U256, H160, TransactionCondition}; use super::*; diff --git a/rpc/src/v1/types/uint.rs b/rpc/src/v1/types/uint.rs index 58e2bad4f..e783aac1f 100644 --- a/rpc/src/v1/types/uint.rs +++ b/rpc/src/v1/types/uint.rs @@ -65,12 +65,12 @@ macro_rules! impl_uint { } } - impl serde::Deserialize for $name { + impl<'a> serde::Deserialize<'a> for $name { fn deserialize(deserializer: D) -> Result<$name, D::Error> - where D: serde::Deserializer { + where D: serde::Deserializer<'a> { struct UintVisitor; - impl serde::de::Visitor for UintVisitor { + impl<'b> serde::de::Visitor<'b> for UintVisitor { type Value = $name; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -95,7 +95,7 @@ macro_rules! impl_uint { } } - deserializer.deserialize(UintVisitor) + deserializer.deserialize_any(UintVisitor) } } diff --git a/rpc_cli/Cargo.toml b/rpc_cli/Cargo.toml index 2a473a6ab..52fc58fe4 100644 --- a/rpc_cli/Cargo.toml +++ b/rpc_cli/Cargo.toml @@ -9,7 +9,7 @@ version = "1.4.0" [dependencies] futures = "0.1" rpassword = "0.3.0" -bigint = "2.0" +bigint = "3.0" parity-rpc = { path = "../rpc" } parity-rpc-client = { path = "../rpc_client" } ethcore-util = { path = "../util" } diff --git a/rpc_client/Cargo.toml b/rpc_client/Cargo.toml index c6df530be..5cc688fb5 100644 --- a/rpc_client/Cargo.toml +++ b/rpc_client/Cargo.toml @@ -10,8 +10,8 @@ version = "1.4.0" futures = "0.1" log = "0.3.6" rand = "0.3.14" -serde = "0.9" -serde_json = "0.9" +serde = "1.0" +serde_json = "1.0" tempdir = "0.3.5" url = "1.2.0" matches = "0.1" diff --git a/rpc_client/src/client.rs b/rpc_client/src/client.rs index f31570c7a..3f55fbe73 100644 --- a/rpc_client/src/client.rs +++ b/rpc_client/src/client.rs @@ -25,7 +25,7 @@ use ws::ws::{ Result as WsResult, }; -use serde::Deserialize; +use serde::de::DeserializeOwned; use serde_json::{ self as json, Value as JsonValue, @@ -247,7 +247,7 @@ impl Rpc { pub fn request( &mut self, method: &'static str, params: Vec ) -> BoxFuture, Canceled> - where T: Deserialize + Send + Sized { + where T: DeserializeOwned + Send + Sized { let (c, p) = oneshot::>(); diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index d31ebe11d..eea49978d 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -14,18 +14,18 @@ byteorder = "1.0" log = "0.3" parking_lot = "0.4" hyper = { version = "0.10", default-features = false } -serde = "0.9" -serde_json = "0.9" -serde_derive = "0.9" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" futures = "0.1" futures-cpupool = "0.1" -rustc-serialize = "0.3" +rustc-hex = "1.0" tokio-core = "0.1.6" tokio-io = "0.1.0" tokio-service = "0.1" tokio-proto = "0.1" url = "1.0" -ethabi = "1.0" +ethabi = "2.0" ethcore = { path = "../ethcore" } ethcore-devtools = { path = "../devtools" } ethcore-util = { path = "../util" } diff --git a/secret_store/src/lib.rs b/secret_store/src/lib.rs index 209a32cc2..4176bd322 100644 --- a/secret_store/src/lib.rs +++ b/secret_store/src/lib.rs @@ -22,7 +22,7 @@ extern crate futures; extern crate futures_cpupool; extern crate hyper; extern crate parking_lot; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate serde; extern crate serde_json; #[macro_use] diff --git a/secret_store/src/serialization.rs b/secret_store/src/serialization.rs index c88e9edf7..edece1dac 100644 --- a/secret_store/src/serialization.rs +++ b/secret_store/src/serialization.rs @@ -17,7 +17,7 @@ use std::fmt; use std::cmp::{Ord, PartialOrd, Ordering}; use std::ops::Deref; -use rustc_serialize::hex::{ToHex, FromHex}; +use rustc_hex::{ToHex, FromHex}; use serde::{Serialize, Deserialize, Serializer, Deserializer}; use serde::de::{Visitor, Error as SerdeError}; use ethkey::{Public, Secret, Signature}; @@ -66,9 +66,9 @@ impl Serialize for SerializableBytes { } } -impl Deserialize for SerializableBytes { +impl<'a> Deserialize<'a> for SerializableBytes { fn deserialize(deserializer: D) -> Result - where D: Deserializer + where D: Deserializer<'a> { let s = String::deserialize(deserializer)?; if s.len() >= 2 && &s[0..2] == "0x" && s.len() & 1 == 0 { @@ -112,11 +112,11 @@ impl Serialize for SerializableSignature { } } -impl Deserialize for SerializableSignature { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableSignature { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableSignature; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -136,7 +136,7 @@ impl Deserialize for SerializableSignature { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -172,11 +172,11 @@ impl Serialize for SerializableH256 { } } -impl Deserialize for SerializableH256 { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableH256 { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableH256; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -196,7 +196,7 @@ impl Deserialize for SerializableH256 { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -232,11 +232,11 @@ impl Serialize for SerializableSecret { } } -impl Deserialize for SerializableSecret { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializableSecret { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializableSecret; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -256,7 +256,7 @@ impl Deserialize for SerializableSecret { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } @@ -312,11 +312,11 @@ impl Serialize for SerializablePublic { } } -impl Deserialize for SerializablePublic { - fn deserialize(deserializer: D) -> Result where D: Deserializer { +impl<'a> Deserialize<'a> for SerializablePublic { + fn deserialize(deserializer: D) -> Result where D: Deserializer<'a> { struct HashVisitor; - impl Visitor for HashVisitor { + impl<'b> Visitor<'b> for HashVisitor { type Value = SerializablePublic; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -336,7 +336,7 @@ impl Deserialize for SerializablePublic { } } - deserializer.deserialize(HashVisitor) + deserializer.deserialize_any(HashVisitor) } } diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 49083cee9..8c85d5daf 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -11,7 +11,7 @@ ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] log = "0.3" -ethabi = "1.0" +ethabi = "2.0" target_info = "0.1" ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } diff --git a/util/Cargo.toml b/util/Cargo.toml index 0af5635ab..8a0928ff5 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -10,7 +10,7 @@ build = "build.rs" [dependencies] log = "0.3" env_logger = "0.4" -rustc-serialize = "0.3" +rustc-hex = "1.0" rand = "0.3.12" time = "0.1.34" rocksdb = { git = "https://github.com/paritytech/rust-rocksdb" } @@ -26,7 +26,7 @@ ethcore-devtools = { path = "../devtools" } libc = "0.2.7" vergen = "0.1" target_info = "0.1" -ethcore-bigint = { path = "bigint" } +ethcore-bigint = { path = "bigint", features = ["heapsizeof"] } parking_lot = "0.4" using_queue = { path = "using_queue" } table = { path = "table" } diff --git a/util/benches/bigint.rs b/util/benches/bigint.rs deleted file mode 100644 index 59377c511..000000000 --- a/util/benches/bigint.rs +++ /dev/null @@ -1,111 +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 . - -//! benchmarking for bigint -//! should be started with: -//! ```bash -//! multirust run nightly cargo bench -//! ``` - -#![feature(test)] -#![feature(asm)] - -extern crate test; -extern crate ethcore_util; - -use test::{Bencher, black_box}; -use ethcore_util::{U256, U512, U128}; - -#[bench] -fn u256_add(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let zero = black_box(U256::zero()); - (0..n).fold(zero, |old, new| { old.overflowing_add(U256::from(black_box(new))).0 }) - }); -} - -#[bench] -fn u256_sub(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let max = black_box(U256::max_value()); - (0..n).fold(max, |old, new| { old.overflowing_sub(U256::from(black_box(new))).0 }) - }); -} - -#[bench] -fn u512_sub(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let max = black_box(U512::max_value()); - (0..n).fold( - max, - |old, new| { - let new = black_box(new); - let p = new % 2; - old.overflowing_sub(U512([p, p, p, p, p, p, p, new])).0 - } - ) - }); -} - -#[bench] -fn u512_add(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let zero = black_box(U512::zero()); - (0..n).fold(zero, - |old, new| { - let new = black_box(new); - old.overflowing_add(U512([new, new, new, new, new, new, new, new])).0 - }) - }); -} - -#[bench] -fn u256_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let one = black_box(U256::one()); - (0..n).fold(one, |old, new| { old.overflowing_mul(U256::from(black_box(new))).0 }) - }); -} - - -#[bench] -fn u256_full_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - let one = black_box(U256::one()); - (0..n).fold(one, - |old, new| { - let new = black_box(new); - let U512(ref u512words) = old.full_mul(U256([new, new, new, new])); - U256([u512words[0], u512words[2], u512words[2], u512words[3]]) - }) - }); -} - - -#[bench] -fn u128_mul(b: &mut Bencher) { - b.iter(|| { - let n = black_box(10000); - (0..n).fold(U128([12345u64, 0u64]), |old, new| { old.overflowing_mul(U128::from(new)).0 }) - }); -} - diff --git a/util/bigint/Cargo.toml b/util/bigint/Cargo.toml index c1225f72c..477925334 100644 --- a/util/bigint/Cargo.toml +++ b/util/bigint/Cargo.toml @@ -8,12 +8,13 @@ version = "0.1.3" authors = ["Parity Technologies "] [dependencies] -bigint = "2.0" -rustc-serialize = "0.3" -heapsize = "0.4" +bigint = "3.0" +rustc-hex = "1.0" rand = "0.3.12" libc = "0.2" +heapsize = { version = "0.4", optional = true } [features] x64asm_arithmetic=[] rust_arithmetic=[] +heapsizeof = ["heapsize", "bigint/heapsizeof"] diff --git a/util/bigint/src/hash.rs b/util/bigint/src/hash.rs index 942ffc6fb..748236285 100644 --- a/util/bigint/src/hash.rs +++ b/util/bigint/src/hash.rs @@ -8,15 +8,14 @@ //! General hash types, a fixed-size raw-data type used as the output of hash functions. -use std::{ops, fmt, cmp}; +use std::{ops, fmt, cmp, str}; use std::cmp::{min, Ordering}; use std::ops::{Deref, DerefMut, BitXor, BitAnd, BitOr, IndexMut, Index}; use std::hash::{Hash, Hasher, BuildHasherDefault}; use std::collections::{HashMap, HashSet}; -use std::str::FromStr; use rand::Rng; use rand::os::OsRng; -use rustc_serialize::hex::{FromHex, FromHexError}; +use rustc_hex::{FromHex, FromHexError}; use bigint::U256; use libc::{c_void, memcmp}; @@ -141,7 +140,7 @@ macro_rules! impl_hash { } } - impl FromStr for $from { + impl str::FromStr for $from { type Err = FromHexError; fn from_str(s: &str) -> Result<$from, FromHexError> { @@ -349,9 +348,9 @@ macro_rules! impl_hash { fn from(s: &'static str) -> $from { let s = clean_0x(s); if s.len() % 2 == 1 { - $from::from_str(&("0".to_owned() + s)).unwrap() + ("0".to_owned() + s).parse().unwrap() } else { - $from::from_str(s).unwrap() + s.parse().unwrap() } } } @@ -435,6 +434,7 @@ impl_hash!(H520, 65); impl_hash!(H1024, 128); impl_hash!(H2048, 256); +#[cfg(feature="heapsizeof")] known_heap_size!(0, H32, H64, H128, H160, H256, H264, H512, H520, H1024, H2048); // Specialized HashMap and HashSet diff --git a/util/bigint/src/lib.rs b/util/bigint/src/lib.rs index ed22bfcfb..7a85de6a1 100644 --- a/util/bigint/src/lib.rs +++ b/util/bigint/src/lib.rs @@ -11,10 +11,13 @@ #![cfg_attr(asm_available, feature(asm))] extern crate rand; -extern crate rustc_serialize; +extern crate rustc_hex; extern crate bigint; extern crate libc; -#[macro_use] extern crate heapsize; + +#[cfg(feature="heapsizeof")] +#[macro_use] +extern crate heapsize; pub mod hash; diff --git a/util/fetch/Cargo.toml b/util/fetch/Cargo.toml index 84cf15b6d..f88bdb551 100644 --- a/util/fetch/Cargo.toml +++ b/util/fetch/Cargo.toml @@ -11,10 +11,8 @@ futures = "0.1" futures-cpupool = "0.1" parking_lot = "0.4" log = "0.3" -reqwest = "0.4" +reqwest = "0.6" mime = "0.2" -clippy = { version = "0.0.90", optional = true} [features] default = [] -dev = ["clippy"] diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index edbbefd17..0d1c3719f 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Parity Technologies "] [dependencies] log = "0.3" mio = "0.6.8" -bytes = "0.3.0" +bytes = "0.4" rand = "0.3.12" time = "0.1.34" tiny-keccak = "1.0" @@ -20,6 +20,7 @@ igd = "0.6" libc = "0.2.7" parking_lot = "0.4" ansi_term = "0.9" +rustc-hex = "1.0" rustc-serialize = "0.3" ethcore-io = { path = "../io" } ethcore-util = { path = ".." } diff --git a/util/network/src/connection.rs b/util/network/src/connection.rs index c54c951fa..a9cb05c00 100644 --- a/util/network/src/connection.rs +++ b/util/network/src/connection.rs @@ -35,7 +35,7 @@ use rcrypto::aessafe::*; use rcrypto::symmetriccipher::*; use rcrypto::buffer::*; use tiny_keccak::Keccak; -use bytes::{Buf, MutBuf}; +use bytes::{Buf, BufMut}; use crypto; const ENCRYPTED_HEADER_LEN: usize = 32; @@ -83,9 +83,9 @@ impl GenericConnection { let sock_ref = ::by_ref(&mut self.socket); loop { let max = self.rec_size - self.rec_buf.len(); - match sock_ref.take(max as u64).try_read(unsafe { self.rec_buf.mut_bytes() }) { + match sock_ref.take(max as u64).try_read(unsafe { self.rec_buf.bytes_mut() }) { Ok(Some(size)) if size != 0 => { - unsafe { self.rec_buf.advance(size); } + unsafe { self.rec_buf.advance_mut(size); } self.stats.inc_recv(size); trace!(target:"network", "{}: Read {} of {} bytes", self.token, self.rec_buf.len(), self.rec_size); if self.rec_size != 0 && self.rec_buf.len() == self.rec_size { @@ -136,8 +136,8 @@ impl GenericConnection { warn!(target:"net", "Unexpected connection data"); return Ok(WriteStatus::Complete) } - let buf = buf as &mut Buf; - match self.socket.try_write(buf.bytes()) { + + match self.socket.try_write(Buf::bytes(&buf)) { Ok(Some(size)) if (pos + size) < send_size => { buf.advance(size); self.stats.inc_send(size); diff --git a/util/network/src/discovery.rs b/util/network/src/discovery.rs index ad995188d..138ba23ba 100644 --- a/util/network/src/discovery.rs +++ b/util/network/src/discovery.rs @@ -559,7 +559,7 @@ mod tests { use node_table::{Node, NodeId, NodeEndpoint}; use std::str::FromStr; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use ethkey::{Random, Generator}; use AllowIP; diff --git a/util/network/src/handshake.rs b/util/network/src/handshake.rs index 9f6474c39..f5c4e118a 100644 --- a/util/network/src/handshake.rs +++ b/util/network/src/handshake.rs @@ -331,7 +331,7 @@ impl Handshake { #[cfg(test)] mod test { use std::sync::Arc; - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use super::*; use util::hash::H256; use io::*; diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index 8fae474ff..80654d503 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -66,6 +66,7 @@ extern crate crypto as rcrypto; extern crate rand; extern crate time; extern crate ansi_term; //TODO: remove this +extern crate rustc_hex; extern crate rustc_serialize; extern crate igd; extern crate libc; diff --git a/util/rlp/Cargo.toml b/util/rlp/Cargo.toml index b6ca67984..aa682e469 100644 --- a/util/rlp/Cargo.toml +++ b/util/rlp/Cargo.toml @@ -10,5 +10,5 @@ authors = ["Parity Technologies "] elastic-array = "0.9" ethcore-bigint = { path = "../bigint" } lazy_static = "0.2" -rustc-serialize = "0.3" +rustc-hex = "1.0" byteorder = "1.0" diff --git a/util/rlp/src/lib.rs b/util/rlp/src/lib.rs index e7e20b17d..f7596b2bc 100644 --- a/util/rlp/src/lib.rs +++ b/util/rlp/src/lib.rs @@ -41,7 +41,7 @@ extern crate byteorder; extern crate ethcore_bigint as bigint; extern crate elastic_array; -extern crate rustc_serialize; +extern crate rustc_hex; #[macro_use] extern crate lazy_static; diff --git a/util/rlp/src/rlpin.rs b/util/rlp/src/rlpin.rs index 918db4d0c..f4f3d3d58 100644 --- a/util/rlp/src/rlpin.rs +++ b/util/rlp/src/rlpin.rs @@ -273,7 +273,7 @@ impl<'a, 'view> Iterator for RlpIterator<'a, 'view> { #[test] fn break_it() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; use bigint::prelude::U256; let h: Vec = FromHex::from_hex("f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470").unwrap(); diff --git a/util/rlp/src/untrusted_rlp.rs b/util/rlp/src/untrusted_rlp.rs index bc47dee0f..c027438b0 100644 --- a/util/rlp/src/untrusted_rlp.rs +++ b/util/rlp/src/untrusted_rlp.rs @@ -8,7 +8,7 @@ use std::cell::Cell; use std::fmt; -use rustc_serialize::hex::ToHex; +use rustc_hex::ToHex; use impls::decode_usize; use {Decodable, DecoderError}; @@ -389,7 +389,7 @@ mod tests { #[test] fn test_rlp_display() { - use rustc_serialize::hex::FromHex; + use rustc_hex::FromHex; let data = "f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470".from_hex().unwrap(); let rlp = UntrustedRlp::new(&data); assert_eq!(format!("{}", rlp), "[\"0x05\", \"0x010efbef67941f79b2\", \"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\", \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\"]"); diff --git a/util/src/error.rs b/util/src/error.rs index 5fcc6fd8f..4ed2fc9bd 100644 --- a/util/src/error.rs +++ b/util/src/error.rs @@ -16,7 +16,7 @@ //! General error types for use in ethcore. -use rustc_serialize::hex::FromHexError; +use rustc_hex::FromHexError; use rlp::DecoderError; use std::fmt; use hash::H256; diff --git a/util/src/lib.rs b/util/src/lib.rs index 5c988bbbc..c6a50f58b 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -87,7 +87,7 @@ //! cargo build --release //! ``` -extern crate rustc_serialize; +extern crate rustc_hex; extern crate rand; extern crate rocksdb; extern crate env_logger; diff --git a/util/src/standard.rs b/util/src/standard.rs index 6363eecd8..19521a5d5 100644 --- a/util/src/standard.rs +++ b/util/src/standard.rs @@ -39,11 +39,7 @@ pub use std::cmp::*; pub use std::sync::Arc; pub use std::collections::*; -pub use rustc_serialize::json::Json; -pub use rustc_serialize::base64::FromBase64; -pub use rustc_serialize::hex::{FromHex, FromHexError}; - pub use heapsize::HeapSizeOf; pub use itertools::Itertools; -pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; \ No newline at end of file +pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; From f4f8b411f511144d81c7f691ce490adcb62446f6 Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 14:10:41 +0200 Subject: [PATCH 12/15] fixed parity tests with new serde and toml --- parity/cli/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 2b678659c..0b4e4b1d0 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -382,6 +382,7 @@ usage! { #[derive(Default, Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] struct Config { parity: Option, account: Option, @@ -647,7 +648,7 @@ mod tests { #[test] fn should_parse_full_config() { // given - let config = toml::decode_str(include_str!("./config.full.toml")).unwrap(); + let config = toml::from_str(include_str!("./config.full.toml")).unwrap(); // when let args = Args::parse_with_config(&["parity", "--chain", "xyz"], config).unwrap(); @@ -897,7 +898,7 @@ mod tests { let config3 = Args::parse_config(include_str!("./config.invalid3.toml")); match (config1, config2, config3) { - (Err(ArgsError::Parsing(_)), Err(ArgsError::Decode(_)), Err(ArgsError::UnknownFields(_))) => {}, + (Err(ArgsError::Decode(_)), Err(ArgsError::Decode(_)), Err(ArgsError::Decode(_))) => {}, (a, b, c) => { assert!(false, "Got invalid error types: {:?}, {:?}, {:?}", a, b, c); } @@ -906,7 +907,7 @@ mod tests { #[test] fn should_deserialize_toml_file() { - let config: Config = toml::decode_str(include_str!("./config.toml")).unwrap(); + let config: Config = toml::from_str(include_str!("./config.toml")).unwrap(); assert_eq!(config, Config { parity: Some(Operating { From 9e185030e68e7fe54c071a93b9a00c6e8bb6d2c3 Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 14:49:10 +0200 Subject: [PATCH 13/15] push CI --- parity/cli/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 0b4e4b1d0..198622966 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -380,7 +380,6 @@ usage! { } } - #[derive(Default, Debug, PartialEq, Deserialize)] #[serde(deny_unknown_fields)] struct Config { From 8118444442cf030212021e01c370ed4c7376d32e Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 15:25:51 +0200 Subject: [PATCH 14/15] fixed rpc tests --- rpc/src/v1/tests/mocked/eth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index 33d46c04f..eb5a7d4e9 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -1130,7 +1130,7 @@ fn rpc_get_work_should_timeout() { assert_eq!(eth_tester.io.handle_request_sync(request), Some(work_response.to_owned())); // Request with timeout of 0 seconds. This should work since we're disabling timeout. - let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": ["0"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": [0], "id": 1}"#; let work_response = format!( r#"{{"jsonrpc":"2.0","result":["0x{:?}","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000800000000000000000000000000000000000000000000000000000000000","0x1"],"id":1}}"#, hash, @@ -1138,11 +1138,11 @@ fn rpc_get_work_should_timeout() { assert_eq!(eth_tester.io.handle_request_sync(request), Some(work_response.to_owned())); // Request with timeout of 10K seconds. This should work. - let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": ["10000"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": [10000], "id": 1}"#; assert_eq!(eth_tester.io.handle_request_sync(request), Some(work_response.to_owned())); // Request with timeout of 10 seconds. This should fail. - let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": ["10"], "id": 1}"#; + let request = r#"{"jsonrpc": "2.0", "method": "eth_getWork", "params": [10], "id": 1}"#; let err_response = r#"{"jsonrpc":"2.0","error":{"code":-32003,"message":"Work has not changed."},"id":1}"#; assert_eq!(eth_tester.io.handle_request_sync(request), Some(err_response.to_owned())); } From 5f2cb5e52fd0b7177ddbff39f7cc83a9f17a5bbe Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 6 Jul 2017 16:48:58 +0200 Subject: [PATCH 15/15] push CI --- parity/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/parity/main.rs b/parity/main.rs index dc009ff62..0287e4bdd 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -363,3 +363,4 @@ fn main() { process::exit(main_direct(can_restart)); } } +