Merge branch 'master' into fo-6418-dont-export-bigint
# Conflicts: # dapps/src/tests/helpers/registrar.rs # ethcore/evm/src/interpreter/shared_cache.rs # ethcore/light/src/client/header_chain.rs # ethcore/light/src/client/mod.rs # ethcore/light/src/net/mod.rs # ethcore/light/src/on_demand/request.rs # ethcore/light/src/on_demand/tests.rs # ethcore/light/src/provider.rs # ethcore/node_filter/src/lib.rs # ethcore/src/block.rs # ethcore/src/blockchain/blockchain.rs # ethcore/src/client/test_client.rs # ethcore/src/engines/authority_round/mod.rs # ethcore/src/engines/basic_authority.rs # ethcore/src/engines/mod.rs # ethcore/src/engines/tendermint/mod.rs # ethcore/src/engines/validator_set/contract.rs # ethcore/src/engines/validator_set/multi.rs # ethcore/src/engines/validator_set/safe_contract.rs # ethcore/src/engines/vote_collector.rs # ethcore/src/miner/external.rs # ethcore/src/miner/miner.rs # ethcore/src/miner/service_transaction_checker.rs # ethcore/src/miner/work_notify.rs # ethcore/src/pod_account.rs # ethcore/src/pod_state.rs # ethcore/src/snapshot/block.rs # ethcore/src/snapshot/consensus/work.rs # ethcore/src/snapshot/mod.rs # ethcore/src/snapshot/service.rs # ethcore/src/spec/spec.rs # ethcore/src/state/backend.rs # ethcore/src/trace/db.rs # ethcore/src/verification/queue/mod.rs # ethcore/src/verification/verification.rs # parity/informant.rs # rpc/src/v1/helpers/dispatch.rs # rpc/src/v1/helpers/light_fetch.rs # rpc/src/v1/helpers/signing_queue.rs # rpc/src/v1/impls/eth.rs # rpc/src/v1/impls/eth_filter.rs # rpc/src/v1/impls/eth_pubsub.rs # rpc/src/v1/impls/light/eth.rs # rpc/src/v1/impls/signing.rs # rpc/src/v1/tests/helpers/miner_service.rs # rpc/src/v1/tests/helpers/snapshot_service.rs # rpc/src/v1/tests/helpers/sync_provider.rs # rpc/src/v1/tests/mocked/eth.rs # stratum/src/lib.rs # sync/src/blocks.rs # sync/src/chain.rs # sync/src/light_sync/mod.rs # sync/src/tests/helpers.rs # sync/src/tests/snapshot.rs # updater/src/updater.rs # util/src/lib.rs # util/triehash/src/lib.rs
This commit is contained in:
@@ -132,7 +132,7 @@ pub fn compute_root<I>(cht_num: u64, iterable: I) -> Option<H256>
|
||||
}
|
||||
|
||||
if v.len() == SIZE as usize {
|
||||
Some(::util::triehash::trie_root(v))
|
||||
Some(::triehash::trie_root(v))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -39,11 +39,10 @@ use rlp::{Encodable, Decodable, DecoderError, RlpStream, Rlp, UntrustedRlp};
|
||||
use heapsize::HeapSizeOf;
|
||||
use bigint::prelude::U256;
|
||||
use bigint::hash::H256;
|
||||
use util::RwLock;
|
||||
use util::kvdb::{DBTransaction, KeyValueDB};
|
||||
|
||||
use cache::Cache;
|
||||
use util::Mutex;
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
|
||||
use smallvec::SmallVec;
|
||||
|
||||
@@ -557,7 +556,7 @@ mod tests {
|
||||
use cache::Cache;
|
||||
|
||||
use time::Duration;
|
||||
use util::Mutex;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
fn make_db() -> Arc<::util::KeyValueDB> {
|
||||
Arc::new(::util::kvdb::in_memory(0))
|
||||
|
||||
@@ -30,10 +30,10 @@ use ethcore::spec::Spec;
|
||||
use ethcore::service::ClientIoMessage;
|
||||
use ethcore::encoded;
|
||||
use io::IoChannel;
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
|
||||
use bigint::prelude::U256;
|
||||
use bigint::hash::H256;
|
||||
use util::{Mutex, RwLock};
|
||||
use util::kvdb::{KeyValueDB, CompactionProfile};
|
||||
|
||||
use self::header_chain::{AncestryIter, HeaderChain};
|
||||
|
||||
@@ -28,7 +28,7 @@ use io::{IoContext, IoError, IoHandler, IoService};
|
||||
use util::kvdb::{Database, DatabaseConfig};
|
||||
|
||||
use cache::Cache;
|
||||
use util::Mutex;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use super::{Client, Config as ClientConfig};
|
||||
|
||||
@@ -117,11 +117,11 @@ mod tests {
|
||||
use super::Service;
|
||||
use devtools::RandomTempPath;
|
||||
use ethcore::spec::Spec;
|
||||
|
||||
|
||||
use std::sync::Arc;
|
||||
use cache::Cache;
|
||||
use time::Duration;
|
||||
use util::Mutex;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
|
||||
@@ -78,6 +78,7 @@ extern crate futures;
|
||||
extern crate itertools;
|
||||
extern crate rand;
|
||||
extern crate rlp;
|
||||
extern crate parking_lot;
|
||||
#[macro_use]
|
||||
extern crate rlp_derive;
|
||||
extern crate serde;
|
||||
@@ -86,6 +87,7 @@ extern crate stats;
|
||||
extern crate time;
|
||||
extern crate vm;
|
||||
extern crate hash;
|
||||
extern crate triehash;
|
||||
|
||||
#[cfg(feature = "ipc")]
|
||||
extern crate ethcore_ipc as ipc;
|
||||
|
||||
@@ -32,7 +32,7 @@ use request::{CompleteRequest, Kind};
|
||||
|
||||
use bincode;
|
||||
use time;
|
||||
use util::{RwLock, Mutex};
|
||||
use parking_lot::{RwLock, Mutex};
|
||||
|
||||
/// Number of time periods samples should be kept for.
|
||||
pub const MOVING_SAMPLE_SIZE: usize = 256;
|
||||
|
||||
@@ -25,7 +25,8 @@ use network::{HostInfo, NetworkProtocolHandler, NetworkContext, PeerId};
|
||||
use rlp::{RlpStream, UntrustedRlp};
|
||||
use bigint::prelude::U256;
|
||||
use bigint::hash::H256;
|
||||
use util::{DBValue, Mutex, RwLock};
|
||||
use util::DBValue;
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use time::{Duration, SteadyTime};
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
@@ -288,7 +289,7 @@ pub type PeerMap = HashMap<PeerId, Mutex<Peer>>;
|
||||
mod id_guard {
|
||||
|
||||
use network::PeerId;
|
||||
use util::RwLockReadGuard;
|
||||
use parking_lot::RwLockReadGuard;
|
||||
|
||||
use super::{PeerMap, ReqId};
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ fn id_guard() {
|
||||
pending_requests.insert(req_id_1, req.clone(), 0.into(), ::time::SteadyTime::now());
|
||||
pending_requests.insert(req_id_2, req, 1.into(), ::time::SteadyTime::now());
|
||||
|
||||
proto.peers.write().insert(peer_id, ::util::Mutex::new(Peer {
|
||||
proto.peers.write().insert(peer_id, ::parking_lot::Mutex::new(Peer {
|
||||
local_credits: flow_params.create_credits(),
|
||||
status: status(provider.client.chain_info()),
|
||||
capabilities: capabilities.clone(),
|
||||
|
||||
@@ -27,7 +27,7 @@ use ethcore::executed::{Executed, ExecutionError};
|
||||
use futures::{Async, Poll, Future};
|
||||
use futures::sync::oneshot::{self, Sender, Receiver, Canceled};
|
||||
use network::PeerId;
|
||||
use util::{RwLock, Mutex};
|
||||
use parking_lot::{RwLock, Mutex};
|
||||
|
||||
use net::{
|
||||
self, Handler, PeerStatus, Status, Capabilities,
|
||||
|
||||
@@ -32,7 +32,8 @@ use request::{self as net_request, IncompleteRequest, CompleteRequest, Output, O
|
||||
use rlp::{RlpStream, UntrustedRlp};
|
||||
use bigint::prelude::U256;
|
||||
use bigint::hash::H256;
|
||||
use util::{Address, Bytes, DBValue, HashDB, Mutex};
|
||||
use parking_lot::Mutex;
|
||||
use util::{Address, Bytes, DBValue, HashDB};
|
||||
use util::memorydb::MemoryDB;
|
||||
use util::trie::{Trie, TrieDB, TrieError};
|
||||
|
||||
@@ -710,7 +711,7 @@ impl Body {
|
||||
pub fn check_response(&self, cache: &Mutex<::cache::Cache>, body: &encoded::Body) -> Result<encoded::Block, Error> {
|
||||
// check the integrity of the the body against the header
|
||||
let header = self.0.as_ref()?;
|
||||
let tx_root = ::util::triehash::ordered_trie_root(body.rlp().at(0).iter().map(|r| r.as_raw().to_vec()));
|
||||
let tx_root = ::triehash::ordered_trie_root(body.rlp().at(0).iter().map(|r| r.as_raw().to_vec()));
|
||||
if tx_root != header.transactions_root() {
|
||||
return Err(Error::WrongTrieRoot(header.transactions_root(), tx_root));
|
||||
}
|
||||
@@ -740,7 +741,7 @@ impl BlockReceipts {
|
||||
/// Check a response with receipts against the stored header.
|
||||
pub fn check_response(&self, cache: &Mutex<::cache::Cache>, receipts: &[Receipt]) -> Result<Vec<Receipt>, Error> {
|
||||
let receipts_root = self.0.as_ref()?.receipts_root();
|
||||
let found_root = ::util::triehash::ordered_trie_root(receipts.iter().map(|r| ::rlp::encode(r).into_vec()));
|
||||
let found_root = ::triehash::ordered_trie_root(receipts.iter().map(|r| ::rlp::encode(r).into_vec()));
|
||||
|
||||
match receipts_root == found_root {
|
||||
true => {
|
||||
@@ -853,7 +854,8 @@ impl TransactionProof {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use bigint::hash::H256;
|
||||
use util::{MemoryDB, Address, Mutex};
|
||||
use util::{MemoryDB, Address};
|
||||
use parking_lot::Mutex;
|
||||
use util::trie::{Trie, TrieMut, SecTrieDB, SecTrieDBMut};
|
||||
use util::trie::recorder::Recorder;
|
||||
use hash::keccak;
|
||||
@@ -937,7 +939,7 @@ mod tests {
|
||||
}).collect::<Vec<_>>();
|
||||
|
||||
let mut header = Header::new();
|
||||
let receipts_root = ::util::triehash::ordered_trie_root(
|
||||
let receipts_root = ::triehash::ordered_trie_root(
|
||||
receipts.iter().map(|x| ::rlp::encode(x).into_vec())
|
||||
);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use futures::Future;
|
||||
use network::{PeerId, NodeId};
|
||||
use net::*;
|
||||
use bigint::hash::H256;
|
||||
use util::Mutex;
|
||||
use parking_lot::Mutex;
|
||||
use time::Duration;
|
||||
use ::request::{self as basic_request, Response};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use ethcore::transaction::PendingTransaction;
|
||||
use ethcore::ids::BlockId;
|
||||
use ethcore::encoded;
|
||||
use bigint::hash::H256;
|
||||
use util::RwLock;
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use cht::{self, BlockInfo};
|
||||
use client::{LightChainClient, AsLightClient};
|
||||
|
||||
Reference in New Issue
Block a user