bigint upgraded to version 3.0 (#5986)

* bigint upgraded to version 3.0

* fixed missing FromHex import in ethcore tests

* fixed missing FromHex import in rpc tests
This commit is contained in:
Marek Kotewicz 2017-07-06 11:26:14 +02:00 committed by Tomasz Drwięga
parent a78a89b13a
commit 46183b1cdd
86 changed files with 139 additions and 235 deletions

46
Cargo.lock generated
View File

@ -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)",
@ -2122,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]]
@ -2182,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",
@ -2202,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"
@ -2908,7 +2915,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"
@ -3065,6 +3072,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"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethkey = { path = "../" }
rustc-serialize = "0.3"
rustc-hex = "1.0"
docopt = "0.7"
[[bin]]

View File

@ -15,13 +15,13 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
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#"

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
rustc-serialize = "0.3"
rustc-hex = "1.0"
docopt = "0.7"
ethstore = { path = "../" }

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
extern crate rustc_serialize;
extern crate rustc_hex;
extern crate docopt;
extern crate ethstore;

View File

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

View File

@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,4 +15,4 @@ ethkey = { path = "../ethkey" }
ethcore-bigint = { path = "../util/bigint" }
[dev-dependencies]
rustc-serialize = "0.3"
rustc-hex = "1.0"

View File

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

View File

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

View File

@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethcore-util = { path = "../util" }
rustc-serialize = "0.3"
rustc-hex = "1.0"
serde = "0.9"
serde_json = "0.9"
serde_derive = "0.9"

View File

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

View File

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

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
extern crate rustc_serialize;
extern crate rustc_hex;
extern crate serde;
extern crate serde_json;
extern crate ethcore_util as util;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ impl Into<Request> 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;

View File

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

View File

@ -131,7 +131,7 @@ impl Into<helpers::TransactionRequest> 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::*;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 <http://www.gnu.org/licenses/>.
//! 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 })
});
}

View File

@ -8,12 +8,13 @@ version = "0.1.3"
authors = ["Parity Technologies <admin@parity.io>"]
[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"]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,5 +10,5 @@ authors = ["Parity Technologies <admin@parity.io>"]
elastic-array = "0.9"
ethcore-bigint = { path = "../bigint" }
lazy_static = "0.2"
rustc-serialize = "0.3"
rustc-hex = "1.0"
byteorder = "1.0"

View File

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

View File

@ -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<u8> = FromHex::from_hex("f84d0589010efbef67941f79b2a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470").unwrap();

View File

@ -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\"]");

View File

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

View File

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

View File

@ -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};
pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};