Remove ethcore::common re-export module (#2792)
* no longer export action_params * remove transaction, header, receipt re-rexports from common * remove env_info and builtins re-exports from common * remove everything but util export from common * replace common usages with util, remove module * add a prelude module for ethcore-bigint
This commit is contained in:
parent
edbd667696
commit
0fedc27332
@ -15,10 +15,14 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Evm input params.
|
//! Evm input params.
|
||||||
use common::*;
|
use util::{Address, Bytes, Uint, U256};
|
||||||
|
use util::hash::{H256, FixedHash};
|
||||||
|
use util::sha3::{Hashable, SHA3_EMPTY};
|
||||||
use ethjson;
|
use ethjson;
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Transaction value
|
/// Transaction value
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum ActionValue {
|
pub enum ActionValue {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
//! Ethcore basic typenames.
|
//! Ethcore basic typenames.
|
||||||
|
|
||||||
use util::*;
|
use util::hash::H2048;
|
||||||
|
|
||||||
/// Type for a 2048-bit log-bloom, as used by our blocks.
|
/// Type for a 2048-bit log-bloom, as used by our blocks.
|
||||||
pub type LogBloom = H2048;
|
pub type LogBloom = H2048;
|
||||||
|
@ -587,10 +587,17 @@ pub fn enact_verified(
|
|||||||
mod tests {
|
mod tests {
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use common::*;
|
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::LastHashes;
|
||||||
|
use error::Error;
|
||||||
|
use header::Header;
|
||||||
use factory::Factories;
|
use factory::Factories;
|
||||||
use state_db::StateDB;
|
use state_db::StateDB;
|
||||||
|
use views::BlockView;
|
||||||
|
use util::Address;
|
||||||
|
use util::hash::FixedHash;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
|
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
|
||||||
#[cfg_attr(feature="dev", allow(too_many_arguments))]
|
#[cfg_attr(feature="dev", allow(too_many_arguments))]
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
// Copyright 2015, 2016 Ethcore (UK) Ltd.
|
|
||||||
// This file is part of Parity.
|
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
pub use util::*;
|
|
||||||
pub use basic_types::*;
|
|
||||||
pub use error::*;
|
|
||||||
pub use env_info::*;
|
|
||||||
pub use views::*;
|
|
||||||
pub use builtin::*;
|
|
||||||
pub use header::*;
|
|
||||||
pub use transaction::*;
|
|
||||||
pub use log_entry::*;
|
|
||||||
pub use receipt::*;
|
|
||||||
pub use action_params::*;
|
|
@ -16,14 +16,20 @@
|
|||||||
|
|
||||||
//! A blockchain engine that supports a basic, non-BFT proof-of-authority.
|
//! A blockchain engine that supports a basic, non-BFT proof-of-authority.
|
||||||
|
|
||||||
use common::*;
|
|
||||||
use ethkey::{recover, public_to_address};
|
use ethkey::{recover, public_to_address};
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
use block::*;
|
use block::*;
|
||||||
|
use builtin::Builtin;
|
||||||
use spec::CommonParams;
|
use spec::CommonParams;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::{BlockError, Error};
|
||||||
use evm::Schedule;
|
use evm::Schedule;
|
||||||
use ethjson;
|
use ethjson;
|
||||||
|
use header::Header;
|
||||||
|
use transaction::SignedTransaction;
|
||||||
|
|
||||||
|
use util::*;
|
||||||
|
|
||||||
/// `BasicAuthority` params.
|
/// `BasicAuthority` params.
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@ -184,10 +190,13 @@ impl Header {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use common::*;
|
use util::*;
|
||||||
use block::*;
|
use block::*;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::{BlockError, Error};
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
|
use header::Header;
|
||||||
use spec::Spec;
|
use spec::Spec;
|
||||||
|
|
||||||
/// Create a new test chain spec with `BasicAuthority` consensus engine.
|
/// Create a new test chain spec with `BasicAuthority` consensus engine.
|
||||||
|
@ -18,11 +18,11 @@ use std::collections::BTreeMap;
|
|||||||
use util::Address;
|
use util::Address;
|
||||||
use builtin::Builtin;
|
use builtin::Builtin;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
use spec::CommonParams;
|
use spec::CommonParams;
|
||||||
use evm::Schedule;
|
use evm::Schedule;
|
||||||
use env_info::EnvInfo;
|
|
||||||
use block::ExecutedBlock;
|
use block::ExecutedBlock;
|
||||||
use common::Bytes;
|
use util::Bytes;
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
|
|
||||||
/// An engine which does not provide any consensus mechanism, just seals blocks internally.
|
/// An engine which does not provide any consensus mechanism, just seals blocks internally.
|
||||||
@ -67,10 +67,11 @@ impl Engine for InstantSeal {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use common::*;
|
use util::*;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
use spec::Spec;
|
use spec::Spec;
|
||||||
|
use header::Header;
|
||||||
use block::*;
|
use block::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -24,11 +24,16 @@ pub use self::null_engine::NullEngine;
|
|||||||
pub use self::instant_seal::InstantSeal;
|
pub use self::instant_seal::InstantSeal;
|
||||||
pub use self::basic_authority::BasicAuthority;
|
pub use self::basic_authority::BasicAuthority;
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
use block::ExecutedBlock;
|
use block::ExecutedBlock;
|
||||||
|
use builtin::Builtin;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::Error;
|
||||||
use spec::CommonParams;
|
use spec::CommonParams;
|
||||||
use evm::Schedule;
|
use evm::Schedule;
|
||||||
|
use header::Header;
|
||||||
|
use transaction::SignedTransaction;
|
||||||
|
|
||||||
/// A consensus mechanism for the chain. Generally either proof-of-work or proof-of-stake-based.
|
/// A consensus mechanism for the chain. Generally either proof-of-work or proof-of-stake-based.
|
||||||
/// Provides hooks into each of the major parts of block import.
|
/// Provides hooks into each of the major parts of block import.
|
||||||
|
@ -15,9 +15,14 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use ethash::{quick_get_difficulty, slow_get_seedhash, EthashManager, H256 as EH256};
|
use ethash::{quick_get_difficulty, slow_get_seedhash, EthashManager, H256 as EH256};
|
||||||
use common::*;
|
use util::*;
|
||||||
use block::*;
|
use block::*;
|
||||||
|
use builtin::Builtin;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::{BlockError, Error};
|
||||||
|
use header::Header;
|
||||||
use spec::CommonParams;
|
use spec::CommonParams;
|
||||||
|
use transaction::SignedTransaction;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
use evm::Schedule;
|
use evm::Schedule;
|
||||||
use ethjson;
|
use ethjson;
|
||||||
@ -371,9 +376,12 @@ impl Header {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use common::*;
|
use util::*;
|
||||||
use block::*;
|
use block::*;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::{BlockError, Error};
|
||||||
|
use header::Header;
|
||||||
use super::super::new_morden;
|
use super::super::new_morden;
|
||||||
use super::Ethash;
|
use super::Ethash;
|
||||||
use rlp;
|
use rlp;
|
||||||
|
@ -65,10 +65,11 @@ pub fn new_morden() -> Spec { load(include_bytes!("../../res/ethereum/morden.jso
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use common::*;
|
use util::*;
|
||||||
use state::*;
|
use state::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
|
use views::BlockView;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ensure_db_good() {
|
fn ensure_db_good() {
|
||||||
|
@ -24,7 +24,8 @@ extern crate test;
|
|||||||
|
|
||||||
use self::test::{Bencher, black_box};
|
use self::test::{Bencher, black_box};
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use action_params::ActionParams;
|
||||||
use evm::{self, Factory, VMType};
|
use evm::{self, Factory, VMType};
|
||||||
use evm::tests::FakeExt;
|
use evm::tests::FakeExt;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
use super::u256_to_address;
|
use super::u256_to_address;
|
||||||
use evm::{self, CostType};
|
use evm::{self, CostType};
|
||||||
use evm::instructions::{self, Instruction, InstructionInfo};
|
use evm::instructions::{self, Instruction, InstructionInfo};
|
||||||
|
@ -29,12 +29,14 @@ use self::memory::Memory;
|
|||||||
pub use self::shared_cache::SharedCache;
|
pub use self::shared_cache::SharedCache;
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use common::*;
|
use action_params::{ActionParams, ActionValue};
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
use super::instructions::{self, Instruction, InstructionInfo};
|
use evm::instructions::{self, Instruction, InstructionInfo};
|
||||||
use evm::{self, MessageCallResult, ContractCreateResult, GasLeft, CostType};
|
use evm::{self, MessageCallResult, ContractCreateResult, GasLeft, CostType};
|
||||||
use bit_set::BitSet;
|
use bit_set::BitSet;
|
||||||
|
|
||||||
|
use util::*;
|
||||||
|
|
||||||
type CodePosition = usize;
|
type CodePosition = usize;
|
||||||
type ProgramCounter = usize;
|
type ProgramCounter = usize;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Just in time compiler execution environment.
|
//! Just in time compiler execution environment.
|
||||||
use common::*;
|
use util::*;
|
||||||
use evmjit;
|
use evmjit;
|
||||||
use evm::{self, GasLeft};
|
use evm::{self, GasLeft};
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use action_params::{ActionParams, ActionValue};
|
||||||
|
use env_info::EnvInfo;
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
use evm::{self, Ext, Schedule, Factory, GasLeft, VMType, ContractCreateResult, MessageCallResult};
|
use evm::{self, Ext, Schedule, Factory, GasLeft, VMType, ContractCreateResult, MessageCallResult};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
@ -15,13 +15,17 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Transaction Execution environment.
|
//! Transaction Execution environment.
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use action_params::{ActionParams, ActionValue};
|
||||||
use state::{State, Substate};
|
use state::{State, Substate};
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::ExecutionError;
|
||||||
use evm::{self, Ext, Factory, Finalize};
|
use evm::{self, Ext, Factory, Finalize};
|
||||||
use externalities::*;
|
use externalities::*;
|
||||||
use trace::{FlatTrace, Tracer, NoopTracer, ExecutiveTracer, VMTrace, VMTracer, ExecutiveVMTracer, NoopVMTracer};
|
use trace::{FlatTrace, Tracer, NoopTracer, ExecutiveTracer, VMTrace, VMTracer, ExecutiveVMTracer, NoopVMTracer};
|
||||||
|
use transaction::{Action, SignedTransaction};
|
||||||
use crossbeam;
|
use crossbeam;
|
||||||
pub use types::executed::{Executed, ExecutionResult};
|
pub use types::executed::{Executed, ExecutionResult};
|
||||||
|
|
||||||
@ -500,13 +504,18 @@ impl<'a> Executive<'a> {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use ethkey::{Generator, Random};
|
use ethkey::{Generator, Random};
|
||||||
use super::*;
|
use super::*;
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use action_params::{ActionParams, ActionValue};
|
||||||
|
use env_info::EnvInfo;
|
||||||
use evm::{Factory, VMType};
|
use evm::{Factory, VMType};
|
||||||
|
use error::ExecutionError;
|
||||||
use state::Substate;
|
use state::Substate;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use trace::trace;
|
use trace::trace;
|
||||||
use trace::{FlatTrace, Tracer, NoopTracer, ExecutiveTracer};
|
use trace::{FlatTrace, Tracer, NoopTracer, ExecutiveTracer};
|
||||||
use trace::{VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, VMTracer, NoopVMTracer, ExecutiveVMTracer};
|
use trace::{VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, VMTracer, NoopVMTracer, ExecutiveVMTracer};
|
||||||
|
use transaction::{Action, Transaction};
|
||||||
|
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -15,9 +15,11 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Transaction Execution environment.
|
//! Transaction Execution environment.
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use action_params::{ActionParams, ActionValue};
|
||||||
use state::{State, Substate};
|
use state::{State, Substate};
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
use executive::*;
|
use executive::*;
|
||||||
use evm::{self, Schedule, Ext, ContractCreateResult, MessageCallResult, Factory};
|
use evm::{self, Schedule, Ext, ContractCreateResult, MessageCallResult, Factory};
|
||||||
use types::executed::CallType;
|
use types::executed::CallType;
|
||||||
@ -253,6 +255,8 @@ impl<'a, T, V> Ext for Externalities<'a, T, V> where T: 'a + Tracer, V: 'a + VMT
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) {
|
fn log(&mut self, topics: Vec<H256>, data: &[u8]) {
|
||||||
|
use log_entry::LogEntry;
|
||||||
|
|
||||||
let address = self.origin_info.address.clone();
|
let address = self.origin_info.address.clone();
|
||||||
self.substate.logs.push(LogEntry {
|
self.substate.logs.push(LogEntry {
|
||||||
address: address,
|
address: address,
|
||||||
@ -303,8 +307,9 @@ impl<'a, T, V> Ext for Externalities<'a, T, V> where T: 'a + Tracer, V: 'a + VMT
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use common::*;
|
use util::*;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
use evm::Ext;
|
use evm::Ext;
|
||||||
use state::{State, Substate};
|
use state::{State, Substate};
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
//! Block header.
|
//! Block header.
|
||||||
|
|
||||||
use util::*;
|
use util::*;
|
||||||
use basic_types::*;
|
use basic_types::{LogBloom, Seal, ZERO_LOGBLOOM};
|
||||||
use time::get_time;
|
use time::get_time;
|
||||||
use rlp::*;
|
use rlp::*;
|
||||||
|
|
||||||
|
@ -15,9 +15,11 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::test_common::*;
|
use super::test_common::*;
|
||||||
|
use action_params::ActionParams;
|
||||||
use state::{State, Substate};
|
use state::{State, Substate};
|
||||||
use executive::*;
|
use executive::*;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
use evm;
|
use evm;
|
||||||
use evm::{Schedule, Ext, Factory, Finalize, VMType, ContractCreateResult, MessageCallResult};
|
use evm::{Schedule, Ext, Factory, Finalize, VMType, ContractCreateResult, MessageCallResult};
|
||||||
use externalities::*;
|
use externalities::*;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
use super::test_common::*;
|
use super::test_common::*;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use pod_state::{self, PodState};
|
use pod_state::{self, PodState};
|
||||||
|
use log_entry::LogEntry;
|
||||||
use ethereum;
|
use ethereum;
|
||||||
use ethjson;
|
use ethjson;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pub use common::*;
|
pub use util::*;
|
||||||
|
|
||||||
macro_rules! test {
|
macro_rules! test {
|
||||||
($name: expr) => {
|
($name: expr) => {
|
||||||
|
@ -18,6 +18,7 @@ use super::test_common::*;
|
|||||||
use evm;
|
use evm;
|
||||||
use ethjson;
|
use ethjson;
|
||||||
use rlp::{UntrustedRlp, View};
|
use rlp::{UntrustedRlp, View};
|
||||||
|
use transaction::{Action, SignedTransaction};
|
||||||
|
|
||||||
fn do_json_test(json_data: &[u8]) -> Vec<String> {
|
fn do_json_test(json_data: &[u8]) -> Vec<String> {
|
||||||
let tests = ethjson::transaction::Test::load(json_data).unwrap();
|
let tests = ethjson::transaction::Test::load(json_data).unwrap();
|
||||||
|
@ -140,7 +140,6 @@ pub mod db;
|
|||||||
|
|
||||||
mod cache_manager;
|
mod cache_manager;
|
||||||
mod blooms;
|
mod blooms;
|
||||||
mod common;
|
|
||||||
mod basic_types;
|
mod basic_types;
|
||||||
mod env_info;
|
mod env_info;
|
||||||
mod pod_account;
|
mod pod_account;
|
||||||
|
@ -163,7 +163,7 @@ pub fn diff_pod(pre: Option<&PodAccount>, post: Option<&PodAccount>) -> Option<A
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use common::*;
|
use util::*;
|
||||||
use types::account_diff::*;
|
use types::account_diff::*;
|
||||||
use super::{PodAccount, diff_pod};
|
use super::{PodAccount, diff_pod};
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ pub fn diff_pod(pre: &PodState, post: &PodState) -> StateDiff {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use common::*;
|
use util::*;
|
||||||
use types::state_diff::*;
|
use types::state_diff::*;
|
||||||
use types::account_diff::*;
|
use types::account_diff::*;
|
||||||
use pod_account::PodAccount;
|
use pod_account::PodAccount;
|
||||||
|
@ -16,10 +16,12 @@
|
|||||||
|
|
||||||
//! Parameters for a block chain.
|
//! Parameters for a block chain.
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use builtin::Builtin;
|
||||||
use engines::{Engine, NullEngine, InstantSeal, BasicAuthority};
|
use engines::{Engine, NullEngine, InstantSeal, BasicAuthority};
|
||||||
use pod_state::*;
|
use pod_state::*;
|
||||||
use account_db::*;
|
use account_db::*;
|
||||||
|
use header::{BlockNumber, Header};
|
||||||
use state_db::StateDB;
|
use state_db::StateDB;
|
||||||
use super::genesis::Genesis;
|
use super::genesis::Genesis;
|
||||||
use super::seal::Generic as GenericSeal;
|
use super::seal::Generic as GenericSeal;
|
||||||
|
@ -16,14 +16,18 @@
|
|||||||
|
|
||||||
use std::cell::{RefCell, RefMut};
|
use std::cell::{RefCell, RefMut};
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
use common::*;
|
use util::*;
|
||||||
|
use receipt::Receipt;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
|
use error::Error;
|
||||||
use executive::{Executive, TransactOptions};
|
use executive::{Executive, TransactOptions};
|
||||||
use factory::Factories;
|
use factory::Factories;
|
||||||
use trace::FlatTrace;
|
use trace::FlatTrace;
|
||||||
use pod_account::*;
|
use pod_account::*;
|
||||||
use pod_state::{self, PodState};
|
use pod_state::{self, PodState};
|
||||||
use types::state_diff::StateDiff;
|
use types::state_diff::StateDiff;
|
||||||
|
use transaction::SignedTransaction;
|
||||||
use state_db::StateDB;
|
use state_db::StateDB;
|
||||||
|
|
||||||
mod account;
|
mod account;
|
||||||
@ -756,7 +760,7 @@ use super::*;
|
|||||||
use util::{U256, H256, FixedHash, Address, Hashable};
|
use util::{U256, H256, FixedHash, Address, Hashable};
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use devtools::*;
|
use devtools::*;
|
||||||
use env_info::*;
|
use env_info::EnvInfo;
|
||||||
use spec::*;
|
use spec::*;
|
||||||
use transaction::*;
|
use transaction::*;
|
||||||
use util::log::init_log;
|
use util::log::init_log;
|
||||||
|
@ -20,11 +20,12 @@ use ethereum;
|
|||||||
use block::IsBlock;
|
use block::IsBlock;
|
||||||
use tests::helpers::*;
|
use tests::helpers::*;
|
||||||
use types::filter::Filter;
|
use types::filter::Filter;
|
||||||
use common::*;
|
use util::*;
|
||||||
use devtools::*;
|
use devtools::*;
|
||||||
use miner::Miner;
|
use miner::Miner;
|
||||||
use rlp::{Rlp, View};
|
use rlp::{Rlp, View};
|
||||||
use spec::Spec;
|
use spec::Spec;
|
||||||
|
use views::BlockView;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn imports_from_empty() {
|
fn imports_from_empty() {
|
||||||
|
@ -17,19 +17,23 @@
|
|||||||
use ethkey::KeyPair;
|
use ethkey::KeyPair;
|
||||||
use io::*;
|
use io::*;
|
||||||
use client::{BlockChainClient, Client, ClientConfig};
|
use client::{BlockChainClient, Client, ClientConfig};
|
||||||
use common::*;
|
use util::*;
|
||||||
use spec::*;
|
use spec::*;
|
||||||
use state_db::StateDB;
|
use state_db::StateDB;
|
||||||
use block::{OpenBlock, Drain};
|
use block::{OpenBlock, Drain};
|
||||||
use blockchain::{BlockChain, Config as BlockChainConfig};
|
use blockchain::{BlockChain, Config as BlockChainConfig};
|
||||||
|
use builtin::Builtin;
|
||||||
use state::*;
|
use state::*;
|
||||||
use evm::Schedule;
|
use evm::Schedule;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use env_info::EnvInfo;
|
||||||
use ethereum;
|
use ethereum;
|
||||||
use devtools::*;
|
use devtools::*;
|
||||||
use miner::Miner;
|
use miner::Miner;
|
||||||
|
use header::Header;
|
||||||
|
use transaction::{Action, SignedTransaction, Transaction};
|
||||||
use rlp::{self, RlpStream, Stream};
|
use rlp::{self, RlpStream, Stream};
|
||||||
use db::COL_STATE;
|
use views::BlockView;
|
||||||
|
|
||||||
#[cfg(feature = "json-tests")]
|
#[cfg(feature = "json-tests")]
|
||||||
pub enum ChainEra {
|
pub enum ChainEra {
|
||||||
@ -346,7 +350,7 @@ pub fn get_temp_state() -> GuardedTempResult<State> {
|
|||||||
|
|
||||||
pub fn get_temp_state_db_in(path: &Path) -> StateDB {
|
pub fn get_temp_state_db_in(path: &Path) -> StateDB {
|
||||||
let db = new_db(path.to_str().expect("Only valid utf8 paths for tests."));
|
let db = new_db(path.to_str().expect("Only valid utf8 paths for tests."));
|
||||||
let journal_db = journaldb::new(db.clone(), journaldb::Algorithm::EarlyMerge, COL_STATE);
|
let journal_db = journaldb::new(db.clone(), journaldb::Algorithm::EarlyMerge, ::db::COL_STATE);
|
||||||
StateDB::new(journal_db, 5 * 1024 * 1024)
|
StateDB::new(journal_db, 5 * 1024 * 1024)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,14 @@
|
|||||||
/// 2. Signatures verification done in the queue.
|
/// 2. Signatures verification done in the queue.
|
||||||
/// 3. Final verification against the blockchain done before enactment.
|
/// 3. Final verification against the blockchain done before enactment.
|
||||||
|
|
||||||
use common::*;
|
use util::*;
|
||||||
use engines::Engine;
|
use engines::Engine;
|
||||||
|
use error::{BlockError, Error};
|
||||||
use blockchain::*;
|
use blockchain::*;
|
||||||
|
use header::{BlockNumber, Header};
|
||||||
use rlp::{UntrustedRlp, View};
|
use rlp::{UntrustedRlp, View};
|
||||||
|
use transaction::SignedTransaction;
|
||||||
|
use views::BlockView;
|
||||||
|
|
||||||
/// Preprocessed block data gathered in `verify_block_unordered` call
|
/// Preprocessed block data gathered in `verify_block_unordered` call
|
||||||
pub struct PreverifiedBlock {
|
pub struct PreverifiedBlock {
|
||||||
|
@ -24,3 +24,16 @@ extern crate rustc_serialize;
|
|||||||
|
|
||||||
pub mod uint;
|
pub mod uint;
|
||||||
pub mod hash;
|
pub mod hash;
|
||||||
|
|
||||||
|
/// A prelude module for re-exporting all the types defined in this crate.
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// use ethcore_bigint::prelude::*;
|
||||||
|
///
|
||||||
|
/// let x: U256 = U256::zero();
|
||||||
|
/// let y = x + 1.into();
|
||||||
|
/// ```
|
||||||
|
pub mod prelude {
|
||||||
|
pub use ::uint::*;
|
||||||
|
pub use ::hash::*;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user