fixed loading of executive tests, unrevealed failing consensus tests

This commit is contained in:
debris
2016-03-24 01:25:59 +01:00
parent 3352b0e916
commit 1aa34e9dd4
16 changed files with 240 additions and 93 deletions

View File

@@ -17,7 +17,6 @@
//! Blockchain test state deserializer.
use std::collections::BTreeMap;
use std::ops::Deref;
use hash::Address;
use blockchain::account::Account;
@@ -25,10 +24,11 @@ use blockchain::account::Account;
#[derive(Debug, PartialEq, Deserialize, Clone)]
pub struct State(pub BTreeMap<Address, Account>);
impl Deref for State {
type Target = BTreeMap<Address, Account>;
impl IntoIterator for State {
type Item = <BTreeMap<Address, Account> as IntoIterator>::Item;
type IntoIter = <BTreeMap<Address, Account> as IntoIterator>::IntoIter;
fn deref(&self) -> &Self::Target {
&self.0
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}

View File

@@ -17,7 +17,6 @@
//! Blockchain test deserializer.
use std::collections::BTreeMap;
use std::ops::Deref;
use std::io::Read;
use serde_json;
use serde_json::Error;
@@ -27,11 +26,12 @@ use blockchain::blockchain::BlockChain;
#[derive(Debug, PartialEq, Deserialize)]
pub struct Test(BTreeMap<String, BlockChain>);
impl Deref for Test {
type Target = BTreeMap<String, BlockChain>;
impl IntoIterator for Test {
type Item = <BTreeMap<String, BlockChain> as IntoIterator>::Item;
type IntoIter = <BTreeMap<String, BlockChain> as IntoIterator>::IntoIter;
fn deref(&self) -> &Self::Target {
&self.0
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}