Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1751 trace multiple transactions in a single block #1783

Merged
merged 42 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3550f29
#1750 multiple transactions
kladkogex Jan 12, 2024
0f8a2fb
#1750 multiple transactions
kladkogex Jan 12, 2024
5901d5b
#1750 multiple transactions
kladkogex Jan 12, 2024
ace6fa6
#1750 multiple transactions
kladkogex Jan 12, 2024
14c56e6
#1750 multiple transactions
kladkogex Jan 12, 2024
67ba4c0
#1750 multiple transactions
kladkogex Jan 12, 2024
fce9fcb
#1750 multiple transactions
kladkogex Jan 12, 2024
4188e5f
1751 Adding exceptions
kladkogex Jan 15, 2024
8141ca5
#1750 multiple transactions
kladkogex Jan 15, 2024
8416726
#1751 multiple transactions
kladkogex Jan 15, 2024
689b7e2
#1751 multiple transactions
kladkogex Jan 15, 2024
31c4e62
#1751 multiple transactions
kladkogex Jan 15, 2024
8f51d17
#1751 multiple transactions
kladkogex Jan 15, 2024
028f6ba
#1751 multiple transactions
kladkogex Jan 15, 2024
e6f7572
#1751 multiple transactions
kladkogex Jan 15, 2024
3995d47
#1751 multiple transactions
kladkogex Jan 15, 2024
d7d2274
#1751 case where no contract is called
kladkogex Jan 15, 2024
8f3a34c
#1751 case where no contract is called
kladkogex Jan 15, 2024
7f92009
#1751 case where no contract is called
kladkogex Jan 15, 2024
238fe85
#1751 case where no contract is called
kladkogex Jan 15, 2024
fb7493b
#1751 case where no contract is called
kladkogex Jan 16, 2024
bce8a66
#1751 case where no contract is called
kladkogex Jan 16, 2024
6c8d897
#1751 case where no contract is called
kladkogex Jan 16, 2024
4174a67
#1751 case where no contract is called
kladkogex Jan 16, 2024
99a7d3d
#1751 case where no contract is called
kladkogex Jan 16, 2024
2a87706
#1751 case where no contract is called
kladkogex Jan 16, 2024
385c049
#1751 case where no contract is called
kladkogex Jan 16, 2024
4f2ea73
#1751 case where no contract is called
kladkogex Jan 17, 2024
5843bc4
#1751 case where no contract is called
kladkogex Jan 17, 2024
64f4b5b
#1751 case where no contract is called
kladkogex Jan 17, 2024
51d2ce6
#1751 case where no contract is called
kladkogex Jan 17, 2024
e557439
#1751 case where no contract is called
kladkogex Jan 17, 2024
706cd92
#1751 case where no contract is called
kladkogex Jan 17, 2024
a557989
#1751 case where no contract is called
kladkogex Jan 17, 2024
d620e7c
#1751 case where no contract is called
kladkogex Jan 17, 2024
940d5dc
#1751 case where no contract is called
kladkogex Jan 17, 2024
94fd7c1
#1751 case where no contract is called
kladkogex Jan 17, 2024
64be1d1
#1751 case where no contract is called
kladkogex Jan 17, 2024
ec245b0
#1751 case where no contract is called
kladkogex Jan 17, 2024
8f6e7b1
#1751 case where no contract is called
kladkogex Jan 17, 2024
1a06864
#1751 case where no contract is called
kladkogex Jan 22, 2024
cd21227
#1751 case where no contract is called
kladkogex Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 43 additions & 23 deletions libethereum/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,36 +795,56 @@
#ifdef HISTORIC_STATE
ExecutionResult Block::executeHistoricCall( LastBlockHashesFace const& _lh, Transaction const& _t,
std::shared_ptr< AlethStandardTrace > _tracer, uint64_t _transactionIndex ) {
auto onOp = OnOpFunc();
try {
auto onOp = OnOpFunc();

Check warning on line 799 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L799

Added line #L799 was not covered by tests

if ( _tracer ) {
onOp = _tracer->functionToExecuteOnEachOperation();
}
if ( _tracer ) {
onOp = _tracer->functionToExecuteOnEachOperation();

Check warning on line 802 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L801-L802

Added lines #L801 - L802 were not covered by tests
}


if ( isSealed() )
BOOST_THROW_EXCEPTION( InvalidOperationOnSealedBlock() );
if ( isSealed() )
BOOST_THROW_EXCEPTION( InvalidOperationOnSealedBlock() );

Check warning on line 807 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L806-L807

Added lines #L806 - L807 were not covered by tests

// Uncommitting is a non-trivial operation - only do it once we've verified as much of the
// transaction as possible.
uncommitToSeal();
uncommitToSeal();

Check warning on line 809 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L809

Added line #L809 was not covered by tests

u256 const gasUsed =
_transactionIndex ? receipt( _transactionIndex - 1 ).cumulativeGasUsed() : 0;
STATE_CHECK( _transactionIndex <= m_receipts.size() )

Check warning on line 811 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L811

Added line #L811 was not covered by tests

EnvInfo const envInfo{ info(), _lh, gasUsed, m_sealEngine->chainParams().chainID };
u256 const gasUsed =
_transactionIndex ? receipt( _transactionIndex - 1 ).cumulativeGasUsed() : 0;

Check warning on line 814 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L814

Added line #L814 was not covered by tests

if ( _tracer ) {
HistoricState stateBefore( m_state.mutableHistoricState() );
auto resultReceipt = m_state.mutableHistoricState().execute(
envInfo, *m_sealEngine, _t, skale::Permanence::Uncommitted, onOp );
HistoricState stateAfter( m_state.mutableHistoricState() );
_tracer->finalizeTrace( resultReceipt.first, stateBefore, stateAfter );
return resultReceipt.first;
} else {
auto resultReceipt = m_state.mutableHistoricState().execute(
envInfo, *m_sealEngine, _t, skale::Permanence::Reverted, onOp );
return resultReceipt.first;
EnvInfo const envInfo{ info(), _lh, gasUsed, m_sealEngine->chainParams().chainID };

Check warning on line 816 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L816

Added line #L816 was not covered by tests

if ( _tracer ) {

Check warning on line 818 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L818

Added line #L818 was not covered by tests
try {
HistoricState stateBefore( m_state.mutableHistoricState() );

Check warning on line 820 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L820

Added line #L820 was not covered by tests

auto resultReceipt = m_state.mutableHistoricState().execute(
envInfo, *m_sealEngine, _t, skale::Permanence::Uncommitted, onOp );
HistoricState stateAfter( m_state.mutableHistoricState() );
_tracer->finalizeAndPrintTrace( resultReceipt.first, stateBefore, stateAfter );

Check warning on line 825 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L822-L825

Added lines #L822 - L825 were not covered by tests
// for tracing the entire block is traced therefore, we save transaction receipt
// as it is used for execution of the next transaction
m_receipts.push_back( resultReceipt.second );
return resultReceipt.first;
} catch ( std::exception& e ) {
throw dev::eth::VMTracingError( "Exception doing trace for transaction index:" +
std::to_string( _transactionIndex ) + ":" +
e.what() );

Check warning on line 833 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L828-L833

Added lines #L828 - L833 were not covered by tests
}
} else {
auto resultReceipt = m_state.mutableHistoricState().execute(
envInfo, *m_sealEngine, _t, skale::Permanence::Reverted, onOp );
return resultReceipt.first;

Check warning on line 838 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L836-L838

Added lines #L836 - L838 were not covered by tests
}
} catch ( std::exception& e ) {
BOOST_THROW_EXCEPTION(

Check warning on line 841 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L840-L841

Added lines #L840 - L841 were not covered by tests
std::runtime_error( "Could not execute historic call for transactionIndex:" +
to_string( _transactionIndex ) + ":" + e.what() ) );
} catch ( ... ) {
BOOST_THROW_EXCEPTION(

Check warning on line 845 in libethereum/Block.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Block.cpp#L844-L845

Added lines #L844 - L845 were not covered by tests
std::runtime_error( "Could not execute historic call for transactionIndex:" +
to_string( _transactionIndex ) + ": unknown error" ) );
}
}
#endif
Expand Down
64 changes: 35 additions & 29 deletions libethereum/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,43 +1346,49 @@


Json::Value Client::traceBlock( BlockNumber _blockNumber, Json::Value const& _jsonTraceConfig ) {
Block previousBlock = blockByNumber( _blockNumber - 1 );
Block historicBlock = blockByNumber( _blockNumber );
try {
Block previousBlock = blockByNumber( _blockNumber - 1 );
Block historicBlock = blockByNumber( _blockNumber );

Check warning on line 1351 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1350-L1351

Added lines #L1350 - L1351 were not covered by tests

Json::Value traces( Json::arrayValue );
Json::Value traces( Json::arrayValue );

Check warning on line 1353 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1353

Added line #L1353 was not covered by tests

auto hash = ClientBase::hashFromNumber( _blockNumber );
Transactions transactions = this->transactions( hash );
auto hash = ClientBase::hashFromNumber( _blockNumber );
Transactions transactions = this->transactions( hash );

Check warning on line 1356 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1355-L1356

Added lines #L1355 - L1356 were not covered by tests

auto traceOptions = TraceOptions::make( _jsonTraceConfig );
auto traceOptions = TraceOptions::make( _jsonTraceConfig );

Check warning on line 1358 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1358

Added line #L1358 was not covered by tests

// cache results for better peformance
string key = to_string( _blockNumber ) + traceOptions.toString();
// cache results for better peformance
string key = to_string( _blockNumber ) + traceOptions.toString();

Check warning on line 1361 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1361

Added line #L1361 was not covered by tests

auto cachedResult = m_blockTraceCache.getIfExists( key );
if ( cachedResult.has_value() ) {
return std::any_cast< Json::Value >( cachedResult );
}
auto cachedResult = m_blockTraceCache.getIfExists( key );
if ( cachedResult.has_value() ) {
return std::any_cast< Json::Value >( cachedResult );

Check warning on line 1365 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1363-L1365

Added lines #L1363 - L1365 were not covered by tests
cerr << "match !!!" << endl;
DmytroNazarenko marked this conversation as resolved.
Show resolved Hide resolved
}

for ( unsigned k = 0; k < transactions.size(); k++ ) {
Json::Value transactionLog( Json::objectValue );
Transaction tx = transactions.at( k );
auto hashString = toHexPrefixed( tx.sha3() );
transactionLog["txHash"] = hashString;
tx.checkOutExternalGas( chainParams().externalGasDifficulty );
auto tracer =
std::make_shared< AlethStandardTrace >( tx, historicBlock.author(), traceOptions );
auto executionResult =
previousBlock.executeHistoricCall( bc().lastBlockHashes(), tx, tracer, k );
auto result = tracer->getJSONResult();
transactionLog["result"] = result;
traces.append( transactionLog );
}
for ( unsigned k = 0; k < transactions.size(); k++ ) {
Json::Value transactionLog( Json::objectValue );
Transaction tx = transactions.at( k );
auto hashString = toHexPrefixed( tx.sha3() );
transactionLog["txHash"] = hashString;
tx.checkOutExternalGas( chainParams().externalGasDifficulty );

Check warning on line 1374 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1369-L1374

Added lines #L1369 - L1374 were not covered by tests
auto tracer =
std::make_shared< AlethStandardTrace >( tx, historicBlock.author(), traceOptions );

Check warning on line 1376 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1376

Added line #L1376 was not covered by tests
auto executionResult =
previousBlock.executeHistoricCall( bc().lastBlockHashes(), tx, tracer, k );
auto result = tracer->getJSONResult();
transactionLog["result"] = result;
traces.append( transactionLog );

Check warning on line 1381 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1378-L1381

Added lines #L1378 - L1381 were not covered by tests
}

auto tracesSize = traces.toStyledString().size();
m_blockTraceCache.put( key, traces, tracesSize );
auto tracesSize = traces.toStyledString().size();
m_blockTraceCache.put( key, traces, tracesSize );

Check warning on line 1385 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1384-L1385

Added lines #L1384 - L1385 were not covered by tests

return traces;
return traces;
} catch ( std::exception& e ) {
BOOST_THROW_EXCEPTION( std::runtime_error(

Check warning on line 1389 in libethereum/Client.cpp

View check run for this annotation

Codecov / codecov/patch

libethereum/Client.cpp#L1387-L1389

Added lines #L1387 - L1389 were not covered by tests
"Could not trace block:" + to_string( _blockNumber ) + ":" + e.what() ) );
}
}

#endif
Expand Down
68 changes: 52 additions & 16 deletions libhistoric/AlethStandardTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
namespace dev::eth {

TraceOptions eth::AlethStandardTrace::getOptions() const {
STATE_CHECK( m_isFinalized )

Check warning on line 30 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L30

Added line #L30 was not covered by tests
return m_options;
}

Expand All @@ -35,6 +36,7 @@
const LegacyVM* _vm ) {
STATE_CHECK( _face )
STATE_CHECK( _vm )
STATE_CHECK( !m_isFinalized )

Check warning on line 39 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L39

Added line #L39 was not covered by tests

// check if instruction depth changed. This means a function has been called or has returned
processFunctionCallOrReturnIfHappened( _ext, _vm, ( uint64_t ) _gasRemaining );
Expand Down Expand Up @@ -128,6 +130,7 @@
}
}
const Address& AlethStandardTrace::getFrom() const {
STATE_CHECK( m_isFinalized )

Check warning on line 133 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L133

Added line #L133 was not covered by tests
return m_from;
}

Expand Down Expand Up @@ -178,13 +181,15 @@
void AlethStandardTrace::setTopFunctionCall(
const shared_ptr< FunctionCallRecord >& _topFunctionCall ) {
STATE_CHECK( _topFunctionCall )
STATE_CHECK( !m_isFinalized )

Check warning on line 184 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L184

Added line #L184 was not covered by tests
m_topFunctionCall = _topFunctionCall;
}

void AlethStandardTrace::recordFunctionReturned(
evmc_status_code _status, const vector< uint8_t >& _returnData, uint64_t _gasUsed ) {
STATE_CHECK( m_lastOpRecord.m_gasRemaining >= m_lastOpRecord.m_opGas )
STATE_CHECK( m_currentlyExecutingFunctionCall )
STATE_CHECK( !m_isFinalized )

Check warning on line 192 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L192

Added line #L192 was not covered by tests

// record return values
getCurrentlyExecutingFunctionCall()->setReturnValues( _status, _returnData, _gasUsed );
Expand All @@ -202,8 +207,6 @@

// 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 )
STATE_CHECK( m_topFunctionCall );
return m_topFunctionCall;
}

Expand All @@ -213,6 +216,9 @@
STATE_CHECK( !m_jsonTrace.isNull() )
return m_jsonTrace;
}
uint64_t AlethStandardTrace::getTotalGasUsed() const {
return m_totalGasUsed;

Check warning on line 220 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L219-L220

Added lines #L219 - L220 were not covered by tests
}

AlethStandardTrace::AlethStandardTrace(
Transaction& _t, const Address& _blockAuthor, const TraceOptions& _options, bool _isCall )
Expand Down Expand Up @@ -243,12 +249,20 @@
{ TraceType::FOUR_BYTE_TRACER, m_fourByteTracePrinter },
{ TraceType::NOOP_TRACER, m_noopTracePrinter } },
m_blockAuthor( _blockAuthor ),
m_isCall( _isCall ) {
m_isCall( _isCall ),
m_value( _t.value() ),
m_gasLimit( _t.gas() ),
m_inputData( _t.data() ),
m_gasPrice( _t.gasPrice() ) {

Check warning on line 256 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L255-L256

Added lines #L255 - L256 were not covered by tests
// mark from and to accounts as accessed
m_accessedAccounts.insert( m_from );
m_accessedAccounts.insert( m_to );
}
const u256& AlethStandardTrace::getGasLimit() const {
return m_gasLimit;

Check warning on line 262 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L261-L262

Added lines #L261 - L262 were not covered by tests
}
void AlethStandardTrace::setOriginalFromBalance( const u256& _originalFromBalance ) {
STATE_CHECK( !m_isFinalized )

Check warning on line 265 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L265

Added line #L265 was not covered by tests
m_originalFromBalance = _originalFromBalance;
}

Expand Down Expand Up @@ -361,24 +375,29 @@
return "0x" + hexStr;
}

// execution completed. Now use the tracer that the user requested
// to print the resulting trace
void eth::AlethStandardTrace::finalizeTrace(
// execution completed. Now finalize the trace and use the tracer that the user requested
// to print the resulting trace to json
void eth::AlethStandardTrace::finalizeAndPrintTrace(

Check warning on line 380 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L380

Added line #L380 was not covered by tests
ExecutionResult& _er, HistoricState& _statePre, HistoricState& _statePost ) {
auto totalGasUsed = ( uint64_t ) _er.gasUsed;
auto statusCode = AlethExtVM::transactionExceptionToEvmcStatusCode( _er.excepted );
m_totalGasUsed = ( uint64_t ) _er.gasUsed;

Check warning on line 382 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L382

Added line #L382 was not covered by tests

// we are done. Set the trace to finalized.
STATE_CHECK( !m_isFinalized.exchange( true ) )
auto statusCode = AlethExtVM::transactionExceptionToEvmcStatusCode( _er.excepted );

Check warning on line 384 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L384

Added line #L384 was not covered by tests

STATE_CHECK( m_topFunctionCall )
STATE_CHECK( m_topFunctionCall == m_currentlyExecutingFunctionCall )

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

if ( getTopFunctionCall() ) {
recordFunctionReturned( statusCode, _er.output, m_totalGasUsed );

Check warning on line 391 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L390-L391

Added lines #L390 - L391 were not covered by tests
}
// we are done. Set the trace to finalized
STATE_CHECK( !m_isFinalized.exchange( true ) )

Check warning on line 394 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L394

Added line #L394 was not covered by tests
// now print trace
printTrace( _er, _statePre, _statePost );
}
void eth::AlethStandardTrace::printTrace( ExecutionResult& _er, const HistoricState& _statePre,

Check warning on line 398 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L396-L398

Added lines #L396 - L398 were not covered by tests
DmytroNazarenko marked this conversation as resolved.
Show resolved Hide resolved
const HistoricState& _statePost ) { // now print the trace
m_jsonTrace = Json::Value( Json::objectValue );

// now run the trace that the user wants based on options provided
if ( m_tracePrinters.count( m_options.tracerType ) > 0 ) {
m_tracePrinters.at( m_options.tracerType ).print( m_jsonTrace, _er, _statePre, _statePost );
Expand Down Expand Up @@ -427,12 +446,14 @@

const shared_ptr< FunctionCallRecord >& AlethStandardTrace::getCurrentlyExecutingFunctionCall()
const {
STATE_CHECK( !m_isFinalized )

Check warning on line 449 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L449

Added line #L449 was not covered by tests
STATE_CHECK( m_currentlyExecutingFunctionCall )
return m_currentlyExecutingFunctionCall;
}

void AlethStandardTrace::setCurrentlyExecutingFunctionCall(
const shared_ptr< FunctionCallRecord >& _currentlyExecutingFunctionCall ) {
STATE_CHECK( !m_isFinalized )

Check warning on line 456 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L456

Added line #L456 was not covered by tests
STATE_CHECK( _currentlyExecutingFunctionCall )
m_currentlyExecutingFunctionCall = _currentlyExecutingFunctionCall;
}
Expand All @@ -443,17 +464,32 @@
return m_minerPayment;
}
void AlethStandardTrace::recordMinerPayment( u256 _minerGasPayment ) {
this->m_minerPayment = _minerGasPayment;
STATE_CHECK( !m_isFinalized )
m_minerPayment = _minerGasPayment;

Check warning on line 468 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L467-L468

Added lines #L467 - L468 were not covered by tests
// add miner to the list of accessed accounts, since the miner is paid
// transaction fee
this->m_accessedAccounts.insert( m_blockAuthor );
m_accessedAccounts.insert( m_blockAuthor );

Check warning on line 471 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L471

Added line #L471 was not covered by tests
}
bool AlethStandardTrace::isCall() const {
return m_isCall;
}
const u256& AlethStandardTrace::getOriginalFromBalance() const {
return m_originalFromBalance;
}

DmytroNazarenko marked this conversation as resolved.
Show resolved Hide resolved

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

Check warning on line 482 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L481-L482

Added lines #L481 - L482 were not covered by tests
}
const u256& AlethStandardTrace::getValue() const {
return m_value;

Check warning on line 485 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L484-L485

Added lines #L484 - L485 were not covered by tests
}
const Address& AlethStandardTrace::getTo() const {
return m_to;

Check warning on line 488 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L487-L488

Added lines #L487 - L488 were not covered by tests
}
const u256& AlethStandardTrace::getGasPrice() const {
return m_gasPrice;

Check warning on line 491 in libhistoric/AlethStandardTrace.cpp

View check run for this annotation

Codecov / codecov/patch

libhistoric/AlethStandardTrace.cpp#L490-L491

Added lines #L490 - L491 were not covered by tests
}
} // namespace dev::eth

#endif
Loading
Loading