|
|
@ -300,6 +300,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) |
|
|
|
VM vm(fev.gas); |
|
|
|
|
|
|
|
u256 gas; |
|
|
|
bool vmExceptionOccured = false; |
|
|
|
try |
|
|
|
{ |
|
|
|
output = vm.go(fev, fev.simpleTrace()).toVector(); |
|
|
@ -308,7 +309,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) |
|
|
|
catch (VMException const& _e) |
|
|
|
{ |
|
|
|
cnote << "VM did throw an exception: " << diagnostic_information(_e); |
|
|
|
gas = 0; |
|
|
|
vmExceptionOccured = true; |
|
|
|
} |
|
|
|
catch (Exception const& _e) |
|
|
|
{ |
|
|
@ -342,13 +343,20 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) |
|
|
|
{ |
|
|
|
o["env"] = mValue(fev.exportEnv()); |
|
|
|
o["exec"] = mValue(fev.exportExec()); |
|
|
|
if (!vmExceptionOccured) |
|
|
|
{ |
|
|
|
o["post"] = mValue(fev.exportState()); |
|
|
|
o["callcreates"] = fev.exportCallCreates(); |
|
|
|
o["out"] = "0x" + toHex(output); |
|
|
|
fev.push(o, "gas", gas); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (o.count("post") > 0) // No exceptions expected
|
|
|
|
{ |
|
|
|
BOOST_CHECK(!vmExceptionOccured); |
|
|
|
|
|
|
|
BOOST_REQUIRE(o.count("post") > 0); |
|
|
|
BOOST_REQUIRE(o.count("callcreates") > 0); |
|
|
|
BOOST_REQUIRE(o.count("out") > 0); |
|
|
@ -385,6 +393,9 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) |
|
|
|
checkAddresses<std::map<Address, std::tuple<u256, u256, std::map<u256, u256>, bytes> > >(test.addresses, fev.addresses); |
|
|
|
BOOST_CHECK(test.callcreates == fev.callcreates); |
|
|
|
} |
|
|
|
else // Exception expected
|
|
|
|
BOOST_CHECK(vmExceptionOccured); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|