diff --git a/ethcore/src/tests/chain.rs b/ethcore/src/json_tests/chain.rs similarity index 99% rename from ethcore/src/tests/chain.rs rename to ethcore/src/json_tests/chain.rs index 4d1835033..19e792f52 100644 --- a/ethcore/src/tests/chain.rs +++ b/ethcore/src/json_tests/chain.rs @@ -3,7 +3,7 @@ use client::{BlockChainClient,Client}; use pod_state::*; use block::Block; use ethereum; -use super::helpers::*; +use tests::helpers::*; pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec { init_log(); diff --git a/ethcore/src/tests/client.rs b/ethcore/src/json_tests/client.rs similarity index 98% rename from ethcore/src/tests/client.rs rename to ethcore/src/json_tests/client.rs index 56b6e7db0..1d09ed079 100644 --- a/ethcore/src/tests/client.rs +++ b/ethcore/src/json_tests/client.rs @@ -1,6 +1,6 @@ use client::{BlockChainClient,Client}; use super::test_common::*; -use super::helpers::*; +use tests::helpers::*; #[test] fn created() { @@ -75,4 +75,4 @@ fn can_collect_garbage() { let client = client_result.reference(); client.tick(); assert!(client.cache_info().blocks < 100 * 1024); -} \ No newline at end of file +} diff --git a/ethcore/src/tests/executive.rs b/ethcore/src/json_tests/executive.rs similarity index 100% rename from ethcore/src/tests/executive.rs rename to ethcore/src/json_tests/executive.rs diff --git a/ethcore/src/tests/homestead_chain.rs b/ethcore/src/json_tests/homestead_chain.rs similarity index 98% rename from ethcore/src/tests/homestead_chain.rs rename to ethcore/src/json_tests/homestead_chain.rs index 5691f3a19..1962da1bc 100644 --- a/ethcore/src/tests/homestead_chain.rs +++ b/ethcore/src/json_tests/homestead_chain.rs @@ -1,6 +1,6 @@ use super::test_common::*; -use super::helpers::*; use super::chain::json_chain_test; +use tests::helpers::*; fn do_json_test(json_data: &[u8]) -> Vec { json_chain_test(json_data, ChainEra::Homestead) diff --git a/ethcore/src/tests/homestead_state.rs b/ethcore/src/json_tests/homestead_state.rs similarity index 98% rename from ethcore/src/tests/homestead_state.rs rename to ethcore/src/json_tests/homestead_state.rs index f0f7cd21e..474d56f8a 100644 --- a/ethcore/src/tests/homestead_state.rs +++ b/ethcore/src/json_tests/homestead_state.rs @@ -1,5 +1,5 @@ use super::test_common::*; -use super::helpers::*; +use tests::helpers::*; use super::state::json_chain_test; fn do_json_test(json_data: &[u8]) -> Vec { diff --git a/ethcore/src/json_tests/mod.rs b/ethcore/src/json_tests/mod.rs new file mode 100644 index 000000000..b5d6779bc --- /dev/null +++ b/ethcore/src/json_tests/mod.rs @@ -0,0 +1,10 @@ +#[macro_use] +mod test_common; + +mod transaction; +mod executive; +mod state; +mod client; +mod chain; +mod homestead_state; +mod homestead_chain; diff --git a/ethcore/src/tests/state.rs b/ethcore/src/json_tests/state.rs similarity index 99% rename from ethcore/src/tests/state.rs rename to ethcore/src/json_tests/state.rs index 34b24de3b..3fb43c132 100644 --- a/ethcore/src/tests/state.rs +++ b/ethcore/src/json_tests/state.rs @@ -1,5 +1,5 @@ use super::test_common::*; -use super::helpers::*; +use tests::helpers::*; use pod_state::*; use state_diff::*; use ethereum; diff --git a/ethcore/src/tests/test_common.rs b/ethcore/src/json_tests/test_common.rs similarity index 86% rename from ethcore/src/tests/test_common.rs rename to ethcore/src/json_tests/test_common.rs index fd88ae96a..87e7b979e 100644 --- a/ethcore/src/tests/test_common.rs +++ b/ethcore/src/json_tests/test_common.rs @@ -12,7 +12,6 @@ macro_rules! declare_test { #[ignore] #[test] #[allow(non_snake_case)] - #[cfg(feature="json-tests")] fn $id() { test!($name); } @@ -21,7 +20,6 @@ macro_rules! declare_test { #[cfg(feature = "test-heavy")] #[test] #[allow(non_snake_case)] - #[cfg(feature="json-tests")] fn $id() { test!($name); } @@ -29,7 +27,6 @@ macro_rules! declare_test { ($id: ident, $name: expr) => { #[test] #[allow(non_snake_case)] - #[cfg(feature="json-tests")] fn $id() { test!($name); } diff --git a/ethcore/src/tests/transaction.rs b/ethcore/src/json_tests/transaction.rs similarity index 100% rename from ethcore/src/tests/transaction.rs rename to ethcore/src/json_tests/transaction.rs diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 32792fe34..66da6c274 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -108,4 +108,8 @@ mod executive; mod externalities; mod verification; -#[cfg(test)] mod tests; +#[cfg(test)] +mod tests; +#[cfg(test)] +#[cfg(feature="json-tests")] +mod json_tests; diff --git a/ethcore/src/tests/helpers.rs b/ethcore/src/tests/helpers.rs index 1923e9164..ddc2aedc2 100644 --- a/ethcore/src/tests/helpers.rs +++ b/ethcore/src/tests/helpers.rs @@ -1,6 +1,6 @@ use client::{BlockChainClient,Client}; use std::env; -use super::test_common::*; +use common::*; use std::path::PathBuf; use spec::*; use std::fs::{remove_dir_all}; diff --git a/ethcore/src/tests/mod.rs b/ethcore/src/tests/mod.rs index bda581eac..1630fabcd 100644 --- a/ethcore/src/tests/mod.rs +++ b/ethcore/src/tests/mod.rs @@ -1,11 +1 @@ -#[macro_use] -mod test_common; - -mod transaction; -mod executive; -mod state; -mod client; -mod chain; pub mod helpers; -mod homestead_state; -mod homestead_chain; \ No newline at end of file diff --git a/ethcore/src/transaction.rs b/ethcore/src/transaction.rs index 61c17a755..7f681bcac 100644 --- a/ethcore/src/transaction.rs +++ b/ethcore/src/transaction.rs @@ -64,6 +64,7 @@ impl Transaction { sender: RefCell::new(None), } } + /// Create a new message-call transaction. pub fn new_call(to: Address, value: U256, data: Bytes, gas: U256, gas_price: U256, nonce: U256) -> Transaction { Transaction {