aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-03-03 03:45:42 +0800
committerGav Wood <i@gavwood.com>2015-03-04 00:05:53 +0800
commit2b3cbabef99d0c6824f3d77f5c004c648d4c9772 (patch)
tree5d1e0a1fcf733b459025598cce238ae140ce8c02
parentc416c8873b9452b7da063cf23c1afa4f081d4ec0 (diff)
downloaddexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar.gz
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar.bz2
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar.lz
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar.xz
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.tar.zst
dexon-solidity-2b3cbabef99d0c6824f3d77f5c004c648d4c9772.zip
only check rootHash of state if FATDB is off
-rw-r--r--state.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/state.cpp b/state.cpp
index 1581e405..37ffa7f8 100644
--- a/state.cpp
+++ b/state.cpp
@@ -71,7 +71,13 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
}
if (_fillin)
+ {
+#if ETH_FATDB
importer.exportTest(output, theState);
+#else
+ BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("You can not fill tests when FATDB is switched off"));
+#endif
+ }
else
{
BOOST_REQUIRE(o.count("post") > 0);
@@ -84,6 +90,8 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
checkLog(theState.pending().size() ? theState.log(0) : LogEntries(), importer.m_environment.sub.logs);
// check addresses
+#if ETH_FATDB
+ cout << "fatDB is defined\n";
auto expectedAddrs = importer.m_statePost.addresses();
auto resultAddrs = theState.addresses();
for (auto& expectedPair : expectedAddrs)
@@ -102,6 +110,8 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
}
}
checkAddresses<map<Address, u256> >(expectedAddrs, resultAddrs);
+#endif
+ BOOST_CHECK_MESSAGE(theState.rootHash() == h256(o["postStateRoot"].get_str()), "wrong post state root");
}
}
}