|
@ -72,7 +72,7 @@ ImportTest::ImportTest(json_spirit::mObject& _o, bool isFiller): m_TestObject(_o |
|
|
if (!isFiller) |
|
|
if (!isFiller) |
|
|
{ |
|
|
{ |
|
|
importState(_o["post"].get_obj(), m_statePost); |
|
|
importState(_o["post"].get_obj(), m_statePost); |
|
|
m_environment.sub.logs = importLog(_o["logs"].get_obj()); |
|
|
m_environment.sub.logs = importLog(_o["logs"].get_array()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -259,16 +259,17 @@ bytes importCode(json_spirit::mObject& _o) |
|
|
return code; |
|
|
return code; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
LogEntries importLog(json_spirit::mObject& _o) |
|
|
LogEntries importLog(json_spirit::mArray& _a) |
|
|
{ |
|
|
{ |
|
|
LogEntries logEntries; |
|
|
LogEntries logEntries; |
|
|
for (auto const& l: _o) |
|
|
for (auto const& l: _a) |
|
|
{ |
|
|
{ |
|
|
json_spirit::mObject o = l.second.get_obj(); |
|
|
json_spirit::mObject o = l.get_obj(); |
|
|
// cant use BOOST_REQUIRE, because this function is used outside boost test (createRandomTest)
|
|
|
// cant use BOOST_REQUIRE, because this function is used outside boost test (createRandomTest)
|
|
|
assert(o.count("address") > 0); |
|
|
assert(o.count("address") > 0); |
|
|
assert(o.count("topics") > 0); |
|
|
assert(o.count("topics") > 0); |
|
|
assert(o.count("data") > 0); |
|
|
assert(o.count("data") > 0); |
|
|
|
|
|
assert(o.count("bloom") > 0); |
|
|
LogEntry log; |
|
|
LogEntry log; |
|
|
log.address = Address(o["address"].get_str()); |
|
|
log.address = Address(o["address"].get_str()); |
|
|
for (auto const& t: o["topics"].get_array()) |
|
|
for (auto const& t: o["topics"].get_array()) |
|
@ -279,9 +280,9 @@ LogEntries importLog(json_spirit::mObject& _o) |
|
|
return logEntries; |
|
|
return logEntries; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
json_spirit::mObject exportLog(eth::LogEntries _logs) |
|
|
json_spirit::mArray exportLog(eth::LogEntries _logs) |
|
|
{ |
|
|
{ |
|
|
json_spirit::mObject ret; |
|
|
json_spirit::mArray ret; |
|
|
if (_logs.size() == 0) return ret; |
|
|
if (_logs.size() == 0) return ret; |
|
|
for (LogEntry const& l: _logs) |
|
|
for (LogEntry const& l: _logs) |
|
|
{ |
|
|
{ |
|
@ -292,7 +293,8 @@ json_spirit::mObject exportLog(eth::LogEntries _logs) |
|
|
topics.push_back(toString(t)); |
|
|
topics.push_back(toString(t)); |
|
|
o["topics"] = topics; |
|
|
o["topics"] = topics; |
|
|
o["data"] = "0x" + toHex(l.data); |
|
|
o["data"] = "0x" + toHex(l.data); |
|
|
ret[toString(l.bloom())] = o; |
|
|
o["bloom"] = toString(l.bloom()); |
|
|
|
|
|
ret.push_back(o); |
|
|
} |
|
|
} |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|