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 22, 2024
1 parent 1a06864 commit cd21227
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion libhistoric/AlethStandardTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ void AlethStandardTrace::recordFunctionReturned(

// the getter functions are called by printer classes after the trace has been generated
const shared_ptr< FunctionCallRecord >& AlethStandardTrace::getTopFunctionCall() const {
STATE_CHECK( m_isFinalized )
return m_topFunctionCall;
}

Expand All @@ -218,6 +219,7 @@ Json::Value AlethStandardTrace::getJSONResult() const {
}

uint64_t AlethStandardTrace::getTotalGasUsed() const {
STATE_CHECK( m_isFinalized )
return m_totalGasUsed;

Check warning on line 223 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L221-L223

Added lines #L221 - L223 were not covered by tests
}

Expand Down Expand Up @@ -261,6 +263,7 @@ AlethStandardTrace::AlethStandardTrace(
}

const u256& AlethStandardTrace::getGasLimit() const {
STATE_CHECK( m_isFinalized )
return m_gasLimit;

Check warning on line 267 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L265-L267

Added lines #L265 - L267 were not covered by tests
}
void AlethStandardTrace::setOriginalFromBalance( const u256& _originalFromBalance ) {
Expand Down Expand Up @@ -389,7 +392,7 @@ void eth::AlethStandardTrace::finalizeAndPrintTrace(

// if transaction is not just ETH transfer
// record return of the top function.
if ( getTopFunctionCall() ) {
if ( m_topFunctionCall ) {
recordFunctionReturned( statusCode, _er.output, m_totalGasUsed );

Check warning on line 396 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L395-L396

Added lines #L395 - L396 were not covered by tests
}
// we are done. Set the trace to finalized
Expand Down Expand Up @@ -462,10 +465,12 @@ void AlethStandardTrace::setCurrentlyExecutingFunctionCall(
}

const Address& AlethStandardTrace::getBlockAuthor() const {
STATE_CHECK( m_isFinalized )

Check warning on line 468 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L468

Added line #L468 was not covered by tests
return m_blockAuthor;
}

const u256& AlethStandardTrace::getMinerPayment() const {
STATE_CHECK( m_isFinalized )

Check warning on line 473 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L473

Added line #L473 was not covered by tests
return m_minerPayment;
}

Expand All @@ -478,24 +483,30 @@ void AlethStandardTrace::recordMinerPayment( u256 _minerGasPayment ) {
}

bool AlethStandardTrace::isCall() const {
STATE_CHECK( m_isFinalized )

Check warning on line 486 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L486

Added line #L486 was not covered by tests
return m_isCall;
}

const u256& AlethStandardTrace::getOriginalFromBalance() const {
STATE_CHECK( m_isFinalized )

Check warning on line 491 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L491

Added line #L491 was not covered by tests
return m_originalFromBalance;
}

const bytes& AlethStandardTrace::getInputData() const {
STATE_CHECK( m_isFinalized )
return m_inputData;

Check warning on line 497 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L495-L497

Added lines #L495 - L497 were not covered by tests
}
const u256& AlethStandardTrace::getValue() const {
STATE_CHECK( m_isFinalized )
return m_value;

Check warning on line 501 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L499-L501

Added lines #L499 - L501 were not covered by tests
}
const Address& AlethStandardTrace::getTo() const {
STATE_CHECK( m_isFinalized )
return m_to;

Check warning on line 505 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L503-L505

Added lines #L503 - L505 were not covered by tests
}

const u256& AlethStandardTrace::getGasPrice() const {
STATE_CHECK( m_isFinalized )
return m_gasPrice;

Check warning on line 510 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L508-L510

Added lines #L508 - L510 were not covered by tests
}
} // namespace dev::eth
Expand Down

0 comments on commit cd21227

Please sign in to comment.