Merge pull request #8415 from ethereum/tests-ExecutionFramework-reset

[test] Fixes ExecutionFramework providing different contract addresse…
This commit is contained in:
Christian Parpart 2020-03-04 14:17:11 +01:00 committed by GitHub
commit a3bc752e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -53,12 +53,16 @@ ExecutionFramework::ExecutionFramework(langutil::EVMVersion _evmVersion):
m_optimiserSettings = solidity::frontend::OptimiserSettings::full();
else if (solidity::test::CommonOptions::get().optimize)
m_optimiserSettings = solidity::frontend::OptimiserSettings::standard();
m_evmHost->reset();
reset();
}
void ExecutionFramework::reset()
{
m_evmHost->reset();
for (size_t i = 0; i < 10; i++)
m_evmHost->accounts[EVMHost::convertToEVMC(account(i))].balance =
EVMHost::convertToEVMC(u256(1) << 100);
}
std::pair<bool, string> ExecutionFramework::compareAndCreateMessage(

View File

@ -251,6 +251,8 @@ private:
}
protected:
void reset();
void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0);
void sendEther(Address const& _to, u256 const& _value);
size_t currentTimestamp();

View File

@ -101,6 +101,7 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref
{
for(bool compileViaYul: set<bool>{!m_runWithoutYul, m_runWithYul})
{
reset();
bool success = true;
m_compileViaYul = compileViaYul;