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-06 19:45:24 +0800
commit8628b65164873270f846a30fc2d5c2734a8644ef (patch)
treed772450c9d891dc23d518083a8d8701be03ecddc
parent25cd3855c65d55139c301b187e26b5a7bb03bed1 (diff)
downloaddexon-solidity-8628b65164873270f846a30fc2d5c2734a8644ef.tar.gz
dexon-solidity-8628b65164873270f846a30fc2d5c2734a8644ef.tar.zst
dexon-solidity-8628b65164873270f846a30fc2d5c2734a8644ef.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 17ebe2b7..72eda1a1 100644
--- a/state.cpp
+++ b/state.cpp
@@ -72,7 +72,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);
@@ -85,6 +91,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)
@@ -103,6 +111,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");
}
}
}