Skip to content

Commit

Permalink
#1751 case where no contract is called
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Jan 15, 2024
1 parent 3995d47 commit d7d2274
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libhistoric/DefaultTracePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ void DefaultTracePrinter::print( Json::Value& _jsonTrace, const ExecutionResult&
_jsonTrace["gas"] = ( uint64_t ) _er.gasUsed;
auto defaultOpTrace = m_trace.getDefaultOpTrace();
STATE_CHECK( defaultOpTrace );
_jsonTrace["structLogs"] = *defaultOpTrace;
if (defaultOpTrace->empty()) {
// make it compatible with geth in cases where
// no contract was called so there is no trace
_jsonTrace["structLogs"] = Json::Value(Json::arrayValue);
} else {
_jsonTrace["structLogs"] = *defaultOpTrace;
}
auto failed = _er.excepted != TransactionException::None;
_jsonTrace["failed"] = failed;
if ( !failed ) {
Expand Down

0 comments on commit d7d2274

Please sign in to comment.