diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-03-03 03:45:42 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-03-06 19:19:43 +0800 |
commit | e043f63819953dd00a3ed9d403d7d5d29fa8b148 (patch) | |
tree | 5d1e0a1fcf733b459025598cce238ae140ce8c02 | |
parent | 3359c6a7889d45ba94ee1fb3c3542147806b0e68 (diff) | |
download | dexon-solidity-e043f63819953dd00a3ed9d403d7d5d29fa8b148.tar.gz dexon-solidity-e043f63819953dd00a3ed9d403d7d5d29fa8b148.tar.zst dexon-solidity-e043f63819953dd00a3ed9d403d7d5d29fa8b148.zip |
only check rootHash of state if FATDB is off
-rw-r--r-- | state.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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"); } } } |