mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
only check rootHash of state if FATDB is off
This commit is contained in:
parent
25cd3855c6
commit
8628b65164
10
state.cpp
10
state.cpp
@ -72,7 +72,13 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_fillin)
|
if (_fillin)
|
||||||
|
{
|
||||||
|
#if ETH_FATDB
|
||||||
importer.exportTest(output, theState);
|
importer.exportTest(output, theState);
|
||||||
|
#else
|
||||||
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("You can not fill tests when FATDB is switched off"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_REQUIRE(o.count("post") > 0);
|
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);
|
checkLog(theState.pending().size() ? theState.log(0) : LogEntries(), importer.m_environment.sub.logs);
|
||||||
|
|
||||||
// check addresses
|
// check addresses
|
||||||
|
#if ETH_FATDB
|
||||||
|
cout << "fatDB is defined\n";
|
||||||
auto expectedAddrs = importer.m_statePost.addresses();
|
auto expectedAddrs = importer.m_statePost.addresses();
|
||||||
auto resultAddrs = theState.addresses();
|
auto resultAddrs = theState.addresses();
|
||||||
for (auto& expectedPair : expectedAddrs)
|
for (auto& expectedPair : expectedAddrs)
|
||||||
@ -103,6 +111,8 @@ void doStateTests(json_spirit::mValue& v, bool _fillin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkAddresses<map<Address, u256> >(expectedAddrs, resultAddrs);
|
checkAddresses<map<Address, u256> >(expectedAddrs, resultAddrs);
|
||||||
|
#endif
|
||||||
|
BOOST_CHECK_MESSAGE(theState.rootHash() == h256(o["postStateRoot"].get_str()), "wrong post state root");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user