Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
updated serde to version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Jul 6, 2017
1 parent cc718bb commit 61d8f90
Show file tree
Hide file tree
Showing 116 changed files with 553 additions and 662 deletions.
322 changes: 147 additions & 175 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions dapps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dapps/src/apps/fetcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dapps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dapps/src/tests/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

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,
Expand Down
2 changes: 1 addition & 1 deletion dapps/src/tests/helpers/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
3 changes: 2 additions & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/native_contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Parity Technologies <[email protected]>"]
build = "build.rs"

[dependencies]
ethabi = "1.0"
ethabi = "2.0"
futures = "0.1"
byteorder = "1.0"
ethcore-util = { path = "../../util" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/native_contracts/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
ethabi = "1.0"
ethabi = "2.0"
heck = "0.2"
2 changes: 1 addition & 1 deletion ethcore/native_contracts/generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub fn {snake_name}<F, U>(&self, call: F, {params}) -> BoxFuture<{output_type},
U: IntoFuture<Item=Vec<u8>, 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;
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/blockchain/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 1 addition & 7 deletions ethcore/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -524,7 +524,6 @@ mod tests {

#[test]
fn sha256() {
use rustc_serialize::hex::FromHex;
let f = ethereum_builtin("sha256");

let i = [0u8; 0];
Expand All @@ -548,7 +547,6 @@ mod tests {

#[test]
fn ripemd160() {
use rustc_serialize::hex::FromHex;
let f = ethereum_builtin("ripemd160");

let i = [0u8; 0];
Expand All @@ -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);
Expand Down Expand Up @@ -627,7 +624,6 @@ mod tests {

#[test]
fn modexp() {
use rustc_serialize::hex::FromHex;

let f = Builtin {
pricer: Box::new(Modexp { divisor: 20 }),
Expand Down Expand Up @@ -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 }),
Expand Down Expand Up @@ -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 }),
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/client/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/engines/tendermint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ impl Engine for Tendermint {

#[cfg(test)]
mod tests {
use rustc_hex::FromHex;
use util::*;
use block::*;
use error::{Error, BlockError};
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/engines/validator_set/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract {

#[cfg(test)]
mod tests {
use rustc_hex::FromHex;
use util::*;
use rlp::encode;
use spec::Spec;
Expand Down
3 changes: 2 additions & 1 deletion ethcore/src/engines/validator_set/safe_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions ethcore/src/env_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ impl From<ethjson::vm::Env> for EnvInfo {

#[cfg(test)]
mod tests {
extern crate rustc_serialize;

use std::str::FromStr;
use super::*;
use util::{U256, Address};
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/evm/interpreter/shared_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion ethcore/src/evm/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

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;
Expand Down
3 changes: 2 additions & 1 deletion ethcore/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions ethcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion ethcore/src/miner/banning_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion ethcore/src/miner/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions ethcore/src/miner/transaction_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1422,7 +1422,7 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option<HashMap<Addr

#[cfg(test)]
pub mod test {
extern crate rustc_serialize;
use rustc_hex::FromHex;
use util::table::*;
use util::*;
use ethkey::{Random, Generator};
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/spec/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! Parameters for a block chain.
use rustc_hex::FromHex;
use super::genesis::Genesis;
use super::seal::Generic as GenericSeal;

Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ mod tests {

use std::sync::Arc;
use std::str::FromStr;
use rustc_serialize::hex::FromHex;
use rustc_hex::FromHex;
use super::*;
use ethkey::Secret;
use util::{U256, H256, Address, Hashable};
Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/types/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub struct LocalizedReceipt {

#[test]
fn test_no_state_root() {
let expected = ::rustc_serialize::hex::FromHex::from_hex("f9014183040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap();
let expected = ::rustc_hex::FromHex::from_hex("f9014183040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap();
let r = Receipt::new(
None,
0x40cae.into(),
Expand All @@ -155,7 +155,7 @@ fn test_no_state_root() {

#[test]
fn test_basic() {
let expected = ::rustc_serialize::hex::FromHex::from_hex("f90162a02f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee83040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap();
let expected = ::rustc_hex::FromHex::from_hex("f90162a02f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee83040caeb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000f838f794dcf421d093428b096ca501a7cd1a740855a7976fc0a00000000000000000000000000000000000000000000000000000000000000000").unwrap();
let r = Receipt::new(
Some("2f697d671e9ae4ee24a43c4b0d7e15f1cb4ba6de1561120d43b9a4e8c4a8a6ee".into()),
0x40cae.into(),
Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ impl From<SignedTransaction> 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));
Expand Down Expand Up @@ -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());
Expand Down
Loading

0 comments on commit 61d8f90

Please sign in to comment.