updated serde to version 1.0

This commit is contained in:
debris
2017-07-06 11:36:15 +02:00
parent cc718bb108
commit 61d8f90530
116 changed files with 553 additions and 662 deletions

View File

@@ -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" }

View File

@@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[dependencies]
ethabi = "1.0"
ethabi = "2.0"
futures = "0.1"
byteorder = "1.0"
ethcore-util = { path = "../../util" }

View File

@@ -5,5 +5,5 @@ version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethabi = "1.0"
ethabi = "2.0"
heck = "0.2"

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 }),

View File

@@ -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};

View File

@@ -651,6 +651,7 @@ impl Engine for Tendermint {
#[cfg(test)]
mod tests {
use rustc_hex::FromHex;
use util::*;
use block::*;
use error::{Error, BlockError};

View File

@@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract {
#[cfg(test)]
mod tests {
use rustc_hex::FromHex;
use util::*;
use rlp::encode;
use spec::Spec;

View File

@@ -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;

View File

@@ -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};

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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<HashMap<Addr
#[cfg(test)]
pub mod test {
extern crate rustc_serialize;
use rustc_hex::FromHex;
use util::table::*;
use util::*;
use ethkey::{Random, Generator};

View File

@@ -16,6 +16,7 @@
//! Parameters for a block chain.
use rustc_hex::FromHex;
use super::genesis::Genesis;
use super::seal::Generic as GenericSeal;

View File

@@ -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};

View File

@@ -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(),
@@ -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(),

View File

@@ -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));
@@ -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());

View File

@@ -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;

View File

@@ -130,7 +130,7 @@ impl<'a> BodyView<'a> {
#[cfg(test)]
mod tests {
use util::*;
use rustc_hex::FromHex;
use super::BodyView;
use blockchain::BlockChain;

View File

@@ -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;

View File

@@ -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;