[ethcore]: move client test types to test-helpers (#11062)

This commit is contained in:
Niklas Adolfsson
2019-09-17 16:42:22 +02:00
committed by Andrew Jones
parent acad59b300
commit b6415c6196
38 changed files with 65 additions and 69 deletions

View File

@@ -22,19 +22,9 @@ mod client;
mod config;
mod traits;
#[cfg(any(test, feature = "test-helpers"))]
mod evm_test_client;
#[cfg(any(test, feature = "test-helpers"))]
mod test_client;
pub use self::client::Client;
pub use self::config::{ClientConfig, DatabaseCompactionProfile, VMType};
pub use self::traits::{
ReopenBlock, PrepareOpenBlock, ImportSealedBlock, BroadcastProposalBlock,
Call, EngineInfo, BlockProducer, SealedBlockImporter,
};
#[cfg(any(test, feature = "test-helpers"))]
pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
#[cfg(any(test, feature = "test-helpers"))]
pub use self::test_client::{TestBlockChainClient, EachBlockWith, TestState};

View File

@@ -16,13 +16,13 @@
use std::path::Path;
use std::sync::Arc;
use client::{EvmTestClient, Client, ClientConfig};
use client::{Client, ClientConfig};
use client_traits::{ImportBlock, ChainInfo};
use spec::Genesis;
use ethjson;
use miner::Miner;
use io::IoChannel;
use test_helpers;
use test_helpers::{self, EvmTestClient};
use types::verification::Unverified;
use verification::VerifierType;
use super::SKIP_TEST_STATE;

View File

@@ -18,8 +18,8 @@ use std::path::Path;
use super::test_common::*;
use pod::PodState;
use trace;
use client::{EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
use ethjson;
use test_helpers::{EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
use types::transaction::SignedTransaction;
use vm::EnvInfo;
use super::SKIP_TEST_STATE;

View File

@@ -16,7 +16,7 @@
use std::path::Path;
use super::test_common::*;
use client::EvmTestClient;
use test_helpers::EvmTestClient;
use ethjson;
use rlp::Rlp;
use types::{

View File

@@ -1491,10 +1491,12 @@ mod tests {
use hash::keccak;
use rustc_hex::FromHex;
use client::{TestBlockChainClient, EachBlockWith, ImportSealedBlock};
use client_traits::ChainInfo;
use client::ImportSealedBlock;
use miner::{MinerService, PendingOrdering};
use test_helpers::{generate_dummy_client, generate_dummy_client_with_spec};
use test_helpers::{
generate_dummy_client, generate_dummy_client_with_spec, TestBlockChainClient, EachBlockWith
};
use types::{
BlockNumber,
transaction::Transaction

View File

@@ -16,6 +16,18 @@
//! Set of different helpers for client tests
mod test_client;
mod evm_test_client;
/// Re-export for tests only
pub use evm::CreateContractAddress;
/// Re-export for tests only
pub use trie::TrieSpec;
/// Re-export for tests only
pub use self::test_client::{TestBlockChainClient, EachBlockWith, TestState};
/// Re-export for tests only
pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
use std::path::Path;
use std::sync::Arc;
use std::{fs, io};
@@ -53,10 +65,6 @@ use spec::{Spec, self};
use account_state::*;
use state_db::StateDB;
/// Re-export for tests only
pub use evm::CreateContractAddress;
/// Re-export for tests only
pub use trie::TrieSpec;
/// Creates test block with corresponding header
pub fn create_test_block(header: &Header) -> Bytes {