bigint upgraded to version 3.0
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 }),
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
//! extern crate ethcore_util as util;
|
||||
//! extern crate ethcore;
|
||||
//! extern crate ethkey;
|
||||
//! extern crate rustc_serialize;
|
||||
//! extern crate rustc_hex;
|
||||
//!
|
||||
//! use util::{U256, Address};
|
||||
//! use ethkey::{Random, Generator};
|
||||
//! use ethcore::miner::{TransactionQueue, RemovalReason, TransactionQueueDetailsProvider, AccountDetails, TransactionOrigin};
|
||||
//! use ethcore::transaction::*;
|
||||
//! use rustc_serialize::hex::FromHex;
|
||||
//! use rustc_hex::FromHex;
|
||||
//!
|
||||
//! #[derive(Default)]
|
||||
//! struct DummyTransactionDetailsProvider;
|
||||
@@ -1422,7 +1422,6 @@ fn check_if_removed(sender: &Address, nonce: &U256, dropped: Option<HashMap<Addr
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test {
|
||||
extern crate rustc_serialize;
|
||||
use util::table::*;
|
||||
use util::*;
|
||||
use ethkey::{Random, Generator};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
//! Parameters for a block chain.
|
||||
|
||||
use rustc_hex::FromHex;
|
||||
use super::genesis::Genesis;
|
||||
use super::seal::Generic as GenericSeal;
|
||||
|
||||
|
||||
@@ -977,7 +977,6 @@ mod tests {
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::str::FromStr;
|
||||
use rustc_serialize::hex::FromHex;
|
||||
use super::*;
|
||||
use ethkey::Secret;
|
||||
use util::{U256, H256, Address, Hashable};
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user