dissolve util (#7460)

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* removed obsolete util/src/lib.rs

* removed commented out code
This commit is contained in:
Marek Kotewicz
2018-01-10 13:35:18 +01:00
committed by Svyatoslav Nikolsky
parent 4a4d64be56
commit e95b093483
395 changed files with 744 additions and 1913 deletions

View File

@@ -21,7 +21,7 @@ use std::fmt;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde::de::{Error, Visitor};
use rustc_hex::ToHex;
use bigint::hash::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048};
use ethereum_types::{H64 as Hash64, H160 as Hash160, H256 as Hash256, H520 as Hash520, H2048 as Hash2048};
macro_rules! impl_hash {
@@ -99,7 +99,7 @@ impl_hash!(Bloom, Hash2048);
mod test {
use std::str::FromStr;
use serde_json;
use bigint::hash;
use ethereum_types;
use hash::H256;
#[test]
@@ -107,13 +107,13 @@ mod test {
let s = r#"["", "5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae"]"#;
let deserialized: Vec<H256> = serde_json::from_str(s).unwrap();
assert_eq!(deserialized, vec![
H256(hash::H256::from(0)),
H256(hash::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap())
H256(ethereum_types::H256::from(0)),
H256(ethereum_types::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap())
]);
}
#[test]
fn hash_into() {
assert_eq!(hash::H256::from(0), H256(hash::H256::from(0)).into());
assert_eq!(ethereum_types::H256::from(0), H256(ethereum_types::H256::from(0)).into());
}
}

View File

@@ -17,7 +17,7 @@
extern crate rustc_hex;
extern crate serde;
extern crate serde_json;
extern crate ethcore_bigint as bigint;
extern crate ethereum_types;
#[macro_use] extern crate serde_derive;
pub mod hash;

View File

@@ -68,7 +68,7 @@ impl<T> Into<Option<T>> for MaybeEmpty<T> {
mod tests {
use std::str::FromStr;
use serde_json;
use bigint::hash;
use ethereum_types;
use hash::H256;
use maybe::MaybeEmpty;
@@ -78,7 +78,7 @@ mod tests {
let deserialized: Vec<MaybeEmpty<H256>> = serde_json::from_str(s).unwrap();
assert_eq!(deserialized, vec![
MaybeEmpty::None,
MaybeEmpty::Some(H256(hash::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap()))
MaybeEmpty::Some(H256(ethereum_types::H256::from_str("5a39ed1020c04d4d84539975b893a4e7c53eab6c2965db8bc3468093a31bc5ae").unwrap()))
]);
}

View File

@@ -50,7 +50,7 @@ mod tests {
use std::collections::BTreeMap;
use serde_json;
use spec::account::Account;
use bigint::prelude::U256;
use ethereum_types::U256;
use uint::Uint;
use bytes::Bytes;

View File

@@ -60,7 +60,7 @@ pub struct AuthorityRound {
#[cfg(test)]
mod tests {
use bigint::prelude::{U256, H160};
use ethereum_types::{U256, H160};
use uint::Uint;
use serde_json;
use hash::Address;

View File

@@ -40,7 +40,7 @@ pub struct BasicAuthority {
mod tests {
use serde_json;
use uint::Uint;
use bigint::prelude::{U256, H160};
use ethereum_types::{U256, H160};
use hash::Address;
use spec::basic_authority::BasicAuthority;
use spec::validator_set::ValidatorSet;

View File

@@ -146,7 +146,7 @@ pub struct Ethash {
mod tests {
use serde_json;
use uint::Uint;
use bigint::prelude::{H160, U256};
use ethereum_types::{H160, U256};
use hash::Address;
use spec::ethash::{Ethash, EthashParams};

View File

@@ -60,7 +60,7 @@ mod tests {
use serde_json;
use bytes::Bytes;
use uint::Uint;
use bigint::prelude::{U256, H160, H64 as Eth64, H256 as Eth256};
use ethereum_types::{U256, H160, H64 as Eth64, H256 as Eth256};
use hash::{H64, H256, Address};
use spec::genesis::Genesis;
use spec::{Ethereum, Seal};

View File

@@ -37,7 +37,7 @@ pub struct NullEngine {
mod tests {
use serde_json;
use uint::Uint;
use bigint::prelude::U256;
use ethereum_types::U256;
use super::*;
#[test]

View File

@@ -123,7 +123,7 @@ pub struct Params {
mod tests {
use serde_json;
use uint::Uint;
use bigint::prelude::U256;
use ethereum_types::U256;
use spec::params::Params;
#[test]

View File

@@ -73,7 +73,7 @@ mod tests {
use hash::*;
use bytes::Bytes;
use uint::Uint;
use bigint::prelude::{U256, H64 as Eth64, H256 as Eth256, H520 as Eth520};
use ethereum_types::{U256, H64 as Eth64, H256 as Eth256, H520 as Eth520};
use spec::{Ethereum, AuthorityRoundSeal, TendermintSeal, Seal};
#[test]

View File

@@ -51,7 +51,7 @@ pub struct Tendermint {
#[cfg(test)]
mod tests {
use serde_json;
use bigint::prelude::H160;
use ethereum_types::H160;
use hash::Address;
use spec::tendermint::Tendermint;
use spec::validator_set::ValidatorSet;

View File

@@ -41,7 +41,7 @@ pub enum ValidatorSet {
mod tests {
use serde_json;
use uint::Uint;
use bigint::prelude::{H160, U256};
use ethereum_types::{H160, U256};
use hash::Address;
use spec::validator_set::ValidatorSet;

View File

@@ -20,7 +20,7 @@ use std::fmt;
use std::str::FromStr;
use serde::{Deserialize, Deserializer};
use serde::de::{Error, Visitor};
use bigint::prelude::U256;
use ethereum_types::U256;
/// Lenient uint json deserialization for test json files.
#[derive(Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
@@ -93,7 +93,7 @@ impl<'a> Visitor<'a> for UintVisitor {
#[cfg(test)]
mod test {
use serde_json;
use bigint::prelude::U256;
use ethereum_types::U256;
use uint::Uint;
#[test]

View File

@@ -39,7 +39,7 @@ pub struct Call {
mod tests {
use serde_json;
use vm::Call;
use bigint::prelude::{U256, H160 as Hash160};
use ethereum_types::{U256, H160 as Hash160};
use uint::Uint;
use hash::Address;
use maybe::MaybeEmpty;