diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 1fa248f45..bd013a914 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -1363,7 +1363,6 @@ Json::Value Client::traceBlock( BlockNumber _blockNumber, Json::Value const& _js auto cachedResult = m_blockTraceCache.getIfExists( key ); if ( cachedResult.has_value() ) { return std::any_cast< Json::Value >( cachedResult ); - cerr << "match !!!" << endl; } for ( unsigned k = 0; k < transactions.size(); k++ ) { diff --git a/libhistoric/AlethStandardTrace.cpp b/libhistoric/AlethStandardTrace.cpp index 834b58c96..fbf300ef4 100644 --- a/libhistoric/AlethStandardTrace.cpp +++ b/libhistoric/AlethStandardTrace.cpp @@ -107,6 +107,7 @@ void AlethStandardTrace::analyzeInstructionAndRecordNeededInformation( uint64_t, // record the instruction m_lastOpRecord = OpExecutionRecord( _ext.depth, _inst, _gasRemaining, _lastOpGas ); } + void AlethStandardTrace::processFunctionCallOrReturnIfHappened( const AlethExtVM& _ext, const LegacyVM* _vm, uint64_t _gasRemaining ) { STATE_CHECK( !m_isFinalized ) @@ -150,7 +151,6 @@ vector< uint8_t > AlethStandardTrace::extractSmartContractMemoryByteArrayFromSta return result; } - void AlethStandardTrace::recordFunctionIsCalled( const Address& _from, const Address& _to, uint64_t _gasLimit, const vector< uint8_t >& _inputData, const u256& _value ) { STATE_CHECK( !m_isFinalized ) @@ -216,6 +216,7 @@ Json::Value AlethStandardTrace::getJSONResult() const { STATE_CHECK( !m_jsonTrace.isNull() ) return m_jsonTrace; } + uint64_t AlethStandardTrace::getTotalGasUsed() const { return m_totalGasUsed; } @@ -258,6 +259,7 @@ AlethStandardTrace::AlethStandardTrace( m_accessedAccounts.insert( m_from ); m_accessedAccounts.insert( m_to ); } + const u256& AlethStandardTrace::getGasLimit() const { return m_gasLimit; } @@ -395,6 +397,7 @@ void eth::AlethStandardTrace::finalizeAndPrintTrace( // now print trace printTrace( _er, _statePre, _statePost ); } + void eth::AlethStandardTrace::printTrace( ExecutionResult& _er, const HistoricState& _statePre, const HistoricState& _statePost ) { // now print the trace m_jsonTrace = Json::Value( Json::objectValue ); @@ -457,12 +460,15 @@ void AlethStandardTrace::setCurrentlyExecutingFunctionCall( STATE_CHECK( _currentlyExecutingFunctionCall ) m_currentlyExecutingFunctionCall = _currentlyExecutingFunctionCall; } + const Address& AlethStandardTrace::getBlockAuthor() const { return m_blockAuthor; } + const u256& AlethStandardTrace::getMinerPayment() const { return m_minerPayment; } + void AlethStandardTrace::recordMinerPayment( u256 _minerGasPayment ) { STATE_CHECK( !m_isFinalized ) m_minerPayment = _minerGasPayment; @@ -470,14 +476,15 @@ void AlethStandardTrace::recordMinerPayment( u256 _minerGasPayment ) { // transaction fee m_accessedAccounts.insert( m_blockAuthor ); } + bool AlethStandardTrace::isCall() const { return m_isCall; } + const u256& AlethStandardTrace::getOriginalFromBalance() const { return m_originalFromBalance; } - const bytes& AlethStandardTrace::getInputData() const { return m_inputData; } @@ -487,6 +494,7 @@ const u256& AlethStandardTrace::getValue() const { const Address& AlethStandardTrace::getTo() const { return m_to; } + const u256& AlethStandardTrace::getGasPrice() const { return m_gasPrice; } diff --git a/libhistoric/ReplayTracePrinter.cpp b/libhistoric/ReplayTracePrinter.cpp index e3fe78c94..f6d08f78d 100644 --- a/libhistoric/ReplayTracePrinter.cpp +++ b/libhistoric/ReplayTracePrinter.cpp @@ -46,10 +46,12 @@ void ReplayTracePrinter::print( Json::Value& _jsonTrace, const ExecutionResult& Json::Value emptyAddress( Json::arrayValue ); auto topFunctionCallRecord = m_trace.getTopFunctionCall(); - if ( !topFunctionCallRecord ) { - // no bytecodes were executed, this was purely ETH transfer - // print nothing - } else { + + + // if topFunctionCallRecord is null + // it means that no bytecodes were executed, this was purely ETH transfer + // print nothing + if ( topFunctionCallRecord ) { topFunctionCallRecord->printParityFunctionTrace( functionTraceArray, emptyAddress ); } _jsonTrace["trace"] = functionTraceArray;