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

@@ -9,16 +9,17 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
log = "0.3"
ethcore = { path = ".."}
ethcore-util = { path = "../../util" }
ethcore-bigint = { path = "../../util/bigint" }
ethcore-bytes = { path = "../../util/bytes" }
ethereum-types = "0.1"
memorydb = { path = "../../util/memorydb" }
patricia-trie = { path = "../../util/patricia_trie" }
ethcore-network = { path = "../../util/network" }
ethcore-io = { path = "../../util/io" }
evm = { path = "../evm" }
hashdb = { path = "../../util/hashdb" }
heapsize = "0.4"
vm = { path = "../vm" }
plain_hasher = { path = "../../util/plain_hasher" }
rlp = { path = "../../util/rlp" }
rlp_derive = { path = "../../util/rlp_derive" }
time = "0.1"

View File

@@ -27,8 +27,7 @@ use ethcore::receipt::Receipt;
use stats::Corpus;
use time::{SteadyTime, Duration};
use heapsize::HeapSizeOf;
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256};
use memory_cache::MemoryLruCache;
/// Configuration for how much data to cache.

View File

@@ -21,9 +21,9 @@
//! we discarded.
use ethcore::ids::BlockId;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{HashDB, MemoryDB};
use ethereum_types::{H256, U256};
use hashdb::HashDB;
use memorydb::MemoryDB;
use bytes::Bytes;
use trie::{self, TrieMut, TrieDBMut, Trie, TrieDB, Recorder};
use rlp::{RlpStream, UntrustedRlp};

View File

@@ -24,7 +24,7 @@ use ethcore::machine::EthereumMachine;
use ethcore::header::Header;
use ethcore::receipt::Receipt;
use futures::future::IntoFuture;
use bigint::hash::H256;
use ethereum_types::H256;
/// Provides full chain data.
pub trait ChainDataFetcher: Send + Sync + 'static {

View File

@@ -43,8 +43,8 @@ use ethcore::engines::epoch::{
use rlp::{Encodable, Decodable, DecoderError, RlpStream, Rlp, UntrustedRlp};
use heapsize::HeapSizeOf;
use bigint::prelude::U256;
use bigint::hash::{H256, H256FastMap, H264};
use ethereum_types::{H256, H264, U256};
use plain_hasher::H256FastMap;
use kvdb::{self, DBTransaction, KeyValueDB};
use cache::Cache;

View File

@@ -32,8 +32,7 @@ use ethcore::service::ClientIoMessage;
use ethcore::encoded;
use io::IoChannel;
use parking_lot::{Mutex, RwLock};
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256};
use futures::{IntoFuture, Future};
use kvdb::{self, KeyValueDB};

View File

@@ -56,16 +56,17 @@ extern crate log;
extern crate bincode;
extern crate ethcore_io as io;
extern crate ethcore_network as network;
extern crate ethcore_util as util;
extern crate ethcore_bigint as bigint;
extern crate ethcore_bytes as bytes;
extern crate ethereum_types;
extern crate ethcore;
extern crate evm;
extern crate hashdb;
extern crate heapsize;
extern crate futures;
extern crate itertools;
extern crate memorydb;
extern crate patricia_trie as trie;
extern crate plain_hasher;
extern crate rand;
extern crate rlp;
extern crate parking_lot;

View File

@@ -23,9 +23,8 @@ use ethcore::transaction::UnverifiedTransaction;
use io::TimerToken;
use network::{HostInfo, NetworkProtocolHandler, NetworkContext, PeerId};
use rlp::{RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::DBValue;
use ethereum_types::{H256, U256};
use kvdb::DBValue;
use parking_lot::{Mutex, RwLock};
use time::{Duration, SteadyTime};

View File

@@ -30,7 +30,7 @@ use request::{self, Request};
use super::error::Error;
use rlp::*;
use bigint::prelude::U256;
use ethereum_types::U256;
use time::{Duration, SteadyTime};
/// Credits value.

View File

@@ -27,7 +27,7 @@ use std::iter::FromIterator;
use request::Request;
use request::NetworkRequests as Requests;
use net::{timeout, ReqId};
use bigint::prelude::U256;
use ethereum_types::U256;
use time::{Duration, SteadyTime};

View File

@@ -17,8 +17,7 @@
//! Peer status and capabilities.
use rlp::{DecoderError, Encodable, Decodable, RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256};
use super::request_credits::FlowParams;
@@ -374,8 +373,7 @@ pub fn write_announcement(announcement: &Announcement) -> Vec<u8> {
mod tests {
use super::*;
use super::super::request_credits::FlowParams;
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{U256, H256};
use rlp::{RlpStream, UntrustedRlp};
#[test]

View File

@@ -32,9 +32,7 @@ use request;
use request::*;
use rlp::*;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::Address;
use ethereum_types::{H256, U256, Address};
use std::sync::Arc;

View File

@@ -31,10 +31,10 @@ use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY, KECCAK_EMPTY_LIST_RLP, keccak};
use request::{self as net_request, IncompleteRequest, CompleteRequest, Output, OutputKind, Field};
use rlp::{RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256, Address};
use parking_lot::Mutex;
use util::{Address, DBValue, HashDB};
use hashdb::HashDB;
use kvdb::DBValue;
use bytes::Bytes;
use memorydb::MemoryDB;
use trie::{Trie, TrieDB, TrieError};
@@ -941,8 +941,8 @@ impl Signal {
#[cfg(test)]
mod tests {
use super::*;
use bigint::hash::H256;
use util::{MemoryDB, Address};
use ethereum_types::{H256, Address};
use memorydb::MemoryDB;
use parking_lot::Mutex;
use trie::{Trie, TrieMut, SecTrieDB, SecTrieDBMut};
use trie::recorder::Recorder;

View File

@@ -22,7 +22,7 @@ use ethcore::header::{Header, Seal};
use futures::Future;
use network::{PeerId, NodeId};
use net::*;
use bigint::hash::H256;
use ethereum_types::H256;
use parking_lot::Mutex;
use time::Duration;
use ::request::{self as basic_request, Response};

View File

@@ -24,7 +24,7 @@ use ethcore::client::{BlockChainClient, ProvingBlockChainClient};
use ethcore::transaction::PendingTransaction;
use ethcore::ids::BlockId;
use ethcore::encoded;
use bigint::hash::H256;
use ethereum_types::H256;
use parking_lot::RwLock;
use cht::{self, BlockInfo};

View File

@@ -28,9 +28,8 @@ use std::collections::hash_map::Entry;
use ethcore::error::{TransactionError, TransactionImportResult};
use ethcore::transaction::{Condition, PendingTransaction, SignedTransaction};
use bigint::prelude::U256;
use bigint::hash::{H256, H256FastMap};
use util::Address;
use ethereum_types::{H256, U256, Address};
use plain_hasher::H256FastMap;
// Knowledge of an account's current nonce.
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -331,7 +330,7 @@ impl TransactionQueue {
#[cfg(test)]
mod tests {
use super::TransactionQueue;
use util::Address;
use ethereum_types::Address;
use ethcore::transaction::{Transaction, PendingTransaction, Condition};
#[test]

View File

@@ -211,7 +211,7 @@ impl<T: IncompleteRequest> DerefMut for Batch<T> {
mod tests {
use request::*;
use super::Builder;
use bigint::hash::H256;
use ethereum_types::H256;
#[test]
fn all_scalar() {

View File

@@ -17,7 +17,7 @@
//! Light protocol request types.
use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp};
use bigint::hash::H256;
use ethereum_types::H256;
mod batch;
@@ -786,8 +786,7 @@ pub mod header {
pub mod header_proof {
use super::{Field, NoSuchOutput, OutputKind, Output};
use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256};
use bytes::Bytes;
/// Potentially incomplete header proof request.
@@ -882,7 +881,7 @@ pub mod header_proof {
/// Request and response for transaction index.
pub mod transaction_index {
use super::{Field, NoSuchOutput, OutputKind, Output};
use bigint::hash::H256;
use ethereum_types::H256;
/// Potentially incomplete transaction index request.
#[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)]
@@ -960,7 +959,7 @@ pub mod transaction_index {
pub mod block_receipts {
use super::{Field, NoSuchOutput, OutputKind, Output};
use ethcore::receipt::Receipt;
use bigint::hash::H256;
use ethereum_types::H256;
/// Potentially incomplete block receipts request.
#[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)]
@@ -1029,7 +1028,7 @@ pub mod block_body {
use super::{Field, NoSuchOutput, OutputKind, Output};
use ethcore::encoded;
use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp};
use bigint::hash::H256;
use ethereum_types::H256;
/// Potentially incomplete block body request.
#[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)]
@@ -1117,8 +1116,7 @@ pub mod block_body {
/// A request for an account proof.
pub mod account {
use super::{Field, NoSuchOutput, OutputKind, Output};
use bigint::prelude::U256;
use bigint::hash::H256;
use ethereum_types::{H256, U256};
use bytes::Bytes;
/// Potentially incomplete request for an account proof.
@@ -1218,7 +1216,7 @@ pub mod account {
/// A request for a storage proof.
pub mod storage {
use super::{Field, NoSuchOutput, OutputKind, Output};
use bigint::hash::H256;
use ethereum_types::H256;
use bytes::Bytes;
/// Potentially incomplete request for an storage proof.
@@ -1327,7 +1325,7 @@ pub mod storage {
/// A request for contract code.
pub mod contract_code {
use super::{Field, NoSuchOutput, OutputKind, Output};
use bigint::hash::H256;
use ethereum_types::H256;
use bytes::Bytes;
/// Potentially incomplete contract code request.
@@ -1414,9 +1412,8 @@ pub mod execution {
use super::{Field, NoSuchOutput, OutputKind, Output};
use ethcore::transaction::Action;
use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Address, DBValue};
use ethereum_types::{H256, U256, Address};
use kvdb::DBValue;
use bytes::Bytes;
/// Potentially incomplete execution proof request.
@@ -1540,7 +1537,7 @@ pub mod execution {
pub mod epoch_signal {
use super::{Field, NoSuchOutput, OutputKind, Output};
use rlp::{Encodable, Decodable, DecoderError, RlpStream, UntrustedRlp};
use bigint::hash::H256;
use ethereum_types::H256;
use bytes::Bytes;
/// Potentially incomplete epoch signal request.
@@ -1725,7 +1722,7 @@ mod tests {
let full_req = Request::TransactionIndex(req.clone());
let res = TransactionIndexResponse {
num: 1000,
hash: ::bigint::hash::H256::random(),
hash: ::ethereum_types::H256::random(),
index: 4,
};
let full_res = Response::TransactionIndex(res.clone());
@@ -1848,7 +1845,7 @@ mod tests {
#[test]
fn execution_roundtrip() {
use util::DBValue;
use kvdb::DBValue;
let req = IncompleteExecutionRequest {
block_hash: Field::Scalar(Default::default()),