Merge pull request #6459 from paritytech/fo-6418-dont-export-bigint

Refactor: Don't reexport bigint from util
This commit is contained in:
Marek Kotewicz
2017-09-05 12:38:03 +02:00
committed by GitHub
290 changed files with 663 additions and 333 deletions

View File

@@ -39,6 +39,7 @@ jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "
ethcore-io = { path = "../util/io" }
ethcore-ipc = { path = "../ipc/rpc" }
ethcore-util = { path = "../util" }
ethcore-bigint = { path = "../util/bigint" }
ethcore = { path = "../ethcore" }
ethcrypto = { path = "../ethcrypto" }
ethkey = { path = "../ethkey" }

View File

@@ -22,7 +22,7 @@ use itertools::Itertools;
use rand::Rng;
use rand::os::OsRng;
use hash::keccak;
use util::H256;
use bigint::hash::H256;
/// Providing current time in seconds
pub trait TimeProvider {
@@ -234,7 +234,7 @@ mod tests {
use std::cell::Cell;
use hash::keccak;
use util::H256;
use bigint::hash::H256;
use super::*;
fn generate_hash(val: &str, time: u64) -> H256 {

View File

@@ -46,6 +46,7 @@ extern crate jsonrpc_pubsub;
extern crate ethash;
extern crate ethcore;
extern crate ethcore_bigint as bigint;
extern crate ethcore_devtools as devtools;
extern crate ethcore_io as io;
extern crate ethcore_ipc;

View File

@@ -25,7 +25,7 @@ use ipc;
use jsonrpc_core as core;
use jsonrpc_pubsub::Session;
use ws;
use util::H256;
use bigint::hash::H256;
use v1::{Metadata, Origin};
use v1::informant::RpcStats;

View File

@@ -27,7 +27,9 @@ use light::on_demand::{request, OnDemand};
use light::TransactionQueue as LightTransactionQueue;
use rlp;
use hash::keccak;
use util::{Address, H520, H256, U256, Bytes};
use bigint::prelude::U256;
use bigint::hash::{H256, H520};
use util::{Address, Bytes};
use parking_lot::{Mutex, RwLock};
use stats::Corpus;

View File

@@ -18,7 +18,7 @@ use std::sync::Arc;
use ethcore::client::MiningBlockChainClient;
use ethcore::miner::MinerService;
use ethcore::transaction::{Transaction, SignedTransaction, Action};
use util::U256;
use bigint::prelude::U256;
use jsonrpc_core::Error;
use v1::helpers::CallRequest;

View File

@@ -37,7 +37,8 @@ use light::on_demand::{request, OnDemand, HeaderRef, Request as OnDemandRequest,
use light::request::Field;
use ethsync::LightSync;
use util::{Address, U256};
use bigint::prelude::U256;
use util::Address;
use parking_lot::Mutex;
use v1::helpers::{CallRequest as CallRequestHelper, errors, dispatch};

View File

@@ -1,7 +1,7 @@
//! Helper type with all filter state data.
use std::collections::HashSet;
use util::hash::H256;
use bigint::hash::H256;
use v1::types::{Filter, Log};
pub type BlockNumber = u64;

View File

@@ -14,7 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use util::{Address, U256, Bytes};
use bigint::prelude::U256;
use util::{Address, Bytes};
use v1::types::{Origin, TransactionCondition};
/// Transaction request coming from RPC

View File

@@ -19,8 +19,9 @@ use std::cell::RefCell;
use std::sync::Arc;
use std::collections::BTreeMap;
use jsonrpc_core;
use bigint::prelude::U256;
use util::Address;
use parking_lot::{Mutex, RwLock};
use util::{U256, Address};
use ethcore::account_provider::DappId;
use v1::helpers::{ConfirmationRequest, ConfirmationPayload};
use v1::types::{ConfirmationResponse, H160 as RpcH160, Origin, DappId as RpcDappId};
@@ -298,8 +299,9 @@ mod test {
use std::time::Duration;
use std::thread;
use std::sync::{mpsc, Arc};
use bigint::prelude::U256;
use util::Address;
use parking_lot::Mutex;
use util::{Address, U256};
use v1::helpers::{SigningQueue, ConfirmationsQueue, QueueEvent, FilledTransactionRequest, ConfirmationPayload};
use v1::types::ConfirmationResponse;

View File

@@ -23,7 +23,9 @@ use std::sync::Arc;
use futures::{self, future, BoxFuture, Future};
use rlp::{self, UntrustedRlp};
use time::get_time;
use util::{H160, H256, Address, U256, H64};
use bigint::prelude::U256;
use bigint::hash::{H64, H160, H256};
use util::Address;
use parking_lot::Mutex;
use ethash::SeedHashCompute;

View File

@@ -23,7 +23,7 @@ use jsonrpc_core::*;
use ethcore::miner::MinerService;
use ethcore::filter::Filter as EthcoreFilter;
use ethcore::client::{BlockChainClient, BlockId};
use util::H256;
use bigint::hash::H256;
use parking_lot::Mutex;
use futures::{future, Future, BoxFuture};

View File

@@ -39,7 +39,8 @@ use light::cache::Cache;
use light::on_demand::OnDemand;
use light::client::{LightChainClient, LightChainNotify};
use parity_reactor::Remote;
use util::{H256, Bytes};
use bigint::hash::H256;
use util::Bytes;
use parking_lot::{RwLock, Mutex};
type Client = Sink<pubsub::Result>;

View File

@@ -39,7 +39,7 @@ use ethcore::transaction::{Action, SignedTransaction, Transaction as EthTransact
use ethsync::LightSync;
use rlp::UntrustedRlp;
use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP};
use util::U256;
use bigint::prelude::U256;
use parking_lot::{RwLock, Mutex};
use futures::{future, Future, BoxFuture, IntoFuture};
@@ -473,7 +473,7 @@ impl<T: LightChainClient + 'static> Filterable for EthClient<T> {
self.client.block_hash(id).map(Into::into)
}
fn pending_transactions_hashes(&self, _block_number: u64) -> Vec<::util::H256> {
fn pending_transactions_hashes(&self, _block_number: u64) -> Vec<::bigint::hash::H256> {
Vec::new()
}

View File

@@ -20,7 +20,8 @@ use std::sync::Arc;
use ethcore::account_provider::AccountProvider;
use ethcore::transaction::PendingTransaction;
use util::{Address, U128, ToPretty};
use bigint::prelude::U128;
use util::{Address, ToPretty};
use futures::{future, Future, BoxFuture};
use jsonrpc_core::Error;

View File

@@ -18,8 +18,8 @@
use std::sync::Arc;
use transient_hashmap::TransientHashMap;
use bigint::prelude::U256;
use parking_lot::Mutex;
use util::U256;
use ethcore::account_provider::AccountProvider;

View File

@@ -29,7 +29,9 @@ use ethcore::miner::{MinerOptions, Banning, GasPricer, MinerService, ExternalMin
use ethcore::account_provider::AccountProvider;
use ethjson::blockchain::BlockChain;
use io::IoChannel;
use util::{U256, H256, Address};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::Address;
use jsonrpc_core::IoHandler;
use v1::impls::{EthClient, SigningUnsafeClient};

View File

@@ -18,7 +18,9 @@
use std::collections::{BTreeMap, HashMap};
use std::collections::hash_map::Entry;
use util::{Address, H256, Bytes, U256};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Address, Bytes};
use parking_lot::{RwLock, Mutex};
use ethcore::error::Error;
use ethcore::client::MiningBlockChainClient;

View File

@@ -16,9 +16,9 @@
use ethcore::snapshot::{ManifestData, RestorationStatus, SnapshotService};
use parking_lot::Mutex;
use util::Bytes;
use util::hash::H256;
use bigint::hash::H256;
use parking_lot::Mutex;
/// Mocked snapshot service (used for sync info extensions).
pub struct TestSnapshotService {

View File

@@ -17,8 +17,8 @@
//! Test implementation of SyncProvider.
use std::collections::BTreeMap;
use bigint::hash::H256;
use parking_lot::RwLock;
use util::H256;
use ethsync::{SyncProvider, EthProtocolInfo, SyncStatus, SyncState, PeerInfo, TransactionStats};
/// TestSyncProvider config.

View File

@@ -22,7 +22,9 @@ use rustc_hex::{FromHex, ToHex};
use time::get_time;
use rlp;
use util::{U256, Address, H256};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::Address;
use parking_lot::Mutex;
use ethkey::Secret;
use ethcore::account_provider::AccountProvider;
@@ -534,7 +536,7 @@ fn rpc_eth_transaction_count_by_number_pending() {
#[test]
fn rpc_eth_pending_transaction_by_hash() {
use util::H256;
use bigint::hash::H256;
use rlp;
use ethcore::transaction::SignedTransaction;

View File

@@ -485,7 +485,8 @@ fn rpc_parity_local_transactions() {
#[test]
fn rpc_parity_chain_status() {
use util::{H256, U256};
use bigint::prelude::U256;
use bigint::hash::H256;
let deps = Dependencies::new();
let io = deps.default_client();
@@ -523,7 +524,7 @@ fn rpc_parity_cid() {
#[test]
fn rpc_parity_call() {
use util::U256;
use bigint::prelude::U256;
let deps = Dependencies::new();
deps.client.set_execution_result(Ok(Executed {

View File

@@ -17,7 +17,8 @@
use std::sync::Arc;
use std::str::FromStr;
use rustc_hex::FromHex;
use util::{U256, Address};
use bigint::prelude::U256;
use util::Address;
use ethcore::miner::MinerService;
use ethcore::client::TestBlockChainClient;

View File

@@ -21,7 +21,8 @@ use ethcore::account_provider::AccountProvider;
use ethcore::client::TestBlockChainClient;
use ethcore::transaction::{Action, Transaction};
use jsonrpc_core::IoHandler;
use util::{U256, Address};
use bigint::prelude::U256;
use util::Address;
use v1::{PersonalClient, Personal, Metadata};
use v1::helpers::dispatch::FullDispatcher;

View File

@@ -16,7 +16,8 @@
use std::sync::Arc;
use std::str::FromStr;
use util::{U256, Address, ToPretty};
use bigint::prelude::U256;
use util::{Address, ToPretty};
use ethcore::account_provider::AccountProvider;
use ethcore::client::TestBlockChainClient;

View File

@@ -28,7 +28,8 @@ use v1::types::ConfirmationResponse;
use v1::tests::helpers::TestMinerService;
use v1::tests::mocked::parity;
use util::{Address, U256, ToPretty};
use bigint::prelude::U256;
use util::{Address, ToPretty};
use ethkey::Secret;
use ethcore::account_provider::AccountProvider;
use ethcore::client::TestBlockChainClient;

View File

@@ -124,7 +124,7 @@ impl Serialize for FilterChanges {
mod tests {
use serde_json;
use std::str::FromStr;
use util::hash::H256;
use bigint::hash::H256;
use super::{VariadicValue, Topic, Filter};
use v1::types::BlockNumber;
use ethcore::filter::Filter as EthFilter;

View File

@@ -20,7 +20,7 @@ use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use serde;
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};
use bigint::hash::{H64 as Eth64, H160 as Eth160, H256 as Eth256, H520 as Eth520, H512 as Eth512, H2048 as Eth2048};
macro_rules! impl_hash {
($name: ident, $other: ident, $size: expr) => {

View File

@@ -29,8 +29,8 @@ pub struct Histogram {
pub counts: Vec<usize>,
}
impl From<::stats::Histogram<::util::U256>> for Histogram {
fn from(h: ::stats::Histogram<::util::U256>) -> Self {
impl From<::stats::Histogram<::bigint::prelude::U256>> for Histogram {
fn from(h: ::stats::Histogram<::bigint::prelude::U256>) -> Self {
Histogram {
bucket_bounds: h.bucket_bounds.into_iter().map(Into::into).collect(),
counts: h.counts

View File

@@ -17,7 +17,7 @@
use std::str::FromStr;
use std::fmt;
use serde;
use util::{U256 as EthU256, U128 as EthU128};
use bigint::prelude::{U256 as EthU256, U128 as EthU128};
macro_rules! impl_uint {
($name: ident, $other: ident, $size: expr) => {