update json_tests

This commit is contained in:
keorn 2016-11-11 18:57:57 +00:00
parent cc39b24599
commit ea9c479fff
2 changed files with 12 additions and 12 deletions

View File

@ -17,7 +17,7 @@
use super::test_common::*;
use client::{BlockChainClient, Client, ClientConfig};
use block::Block;
use ethereum;
use spec::Spec;
use tests::helpers::*;
use devtools::*;
use spec::Genesis;
@ -46,11 +46,11 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
let genesis = Genesis::from(blockchain.genesis());
let state = From::from(blockchain.pre_state.clone());
let mut spec = match era {
ChainEra::Frontier => ethereum::new_frontier_test(),
ChainEra::Homestead => ethereum::new_homestead_test(),
ChainEra::Eip150 => ethereum::new_eip150_test(),
ChainEra::Eip161 => ethereum::new_eip161_test(),
ChainEra::TransitionTest => ethereum::new_transition_test(),
ChainEra::Frontier => Spec::new_ethereum_frontier_test(),
ChainEra::Homestead => Spec::new_ethereum_homestead_test(),
ChainEra::Eip150 => Spec::new_ethereum_eip150_test(),
ChainEra::Eip161 => Spec::new_ethereum_eip161_test(),
ChainEra::TransitionTest => Spec::new_ethereum_transition_test(),
};
spec.set_genesis_state(state);
spec.overwrite_genesis_params(genesis);

View File

@ -18,7 +18,7 @@ use super::test_common::*;
use tests::helpers::*;
use pod_state::{self, PodState};
use log_entry::LogEntry;
use ethereum;
use spec::Spec;
use ethjson;
pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
@ -26,11 +26,11 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
let tests = ethjson::state::Test::load(json_data).unwrap();
let mut failed = Vec::new();
let engine = match era {
ChainEra::Frontier => ethereum::new_mainnet_like().engine,
ChainEra::Homestead => ethereum::new_homestead_test().engine,
ChainEra::Eip150 => ethereum::new_eip150_test().engine,
ChainEra::Eip161 => ethereum::new_eip161_test().engine,
ChainEra::TransitionTest => ethereum::new_transition_test().engine,
ChainEra::Frontier => Spec::new_ethereum_mainnet_like().engine,
ChainEra::Homestead => Spec::new_ethereum_homestead_test().engine,
ChainEra::Eip150 => Spec::new_ethereum_eip150_test().engine,
ChainEra::Eip161 => Spec::new_ethereum_eip161_test().engine,
ChainEra::TransitionTest => Spec::new_ethereum_transition_test().engine,
};
for (name, test) in tests.into_iter() {