From 972d30c288ff331b5ced82c8b330f48a704b05ef Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 4 Jul 2017 17:23:06 +0200 Subject: [PATCH] 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" }