MCPcopy Create free account
hub / github.com/LUX-Core/lux / debug_traceCall

Method debug_traceCall

src/cpp-ethereum/libweb3jsonrpc/Debug.cpp:179–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179Json::Value Debug::debug_traceCall(Json::Value const& _call, std::string const& _blockNumber, Json::Value const& _options)
180{
181 Json::Value ret;
182 try
183 {
184 Block temp = m_eth.block(jsToBlockNumber(_blockNumber));
185 TransactionSkeleton ts = toTransactionSkeleton(_call);
186 if (!ts.from) {
187 ts.from = Address();
188 }
189 u256 nonce = temp.transactionsFrom(ts.from);
190 u256 gas = ts.gas == Invalid256 ? m_eth.gasLimitRemaining() : ts.gas;
191 u256 gasPrice = ts.gasPrice == Invalid256 ? m_eth.gasBidPrice() : ts.gasPrice;
192 temp.mutableState().addBalance(ts.from, gas * gasPrice + ts.value);
193 Transaction transaction(ts.value, gasPrice, gas, ts.to, ts.data, nonce);
194 transaction.forceSender(ts.from);
195 eth::ExecutionResult er;
196 Executive e(temp);
197 e.setResultRecipient(er);
198 Json::Value trace = traceTransaction(e, transaction, _options);
199 ret["gas"] = toHex(transaction.gas(), HexPrefix::Add);
200 ret["return"] = toHex(er.output, 2, HexPrefix::Add);
201 ret["structLogs"] = trace;
202 }
203 catch(Exception const& _e)
204 {
205 cwarn << diagnostic_information(_e);
206 }
207 return ret;
208}

Callers 1

debug_traceCallIMethod · 0.80

Calls 11

jsToBlockNumberFunction · 0.85
toTransactionSkeletonFunction · 0.85
toHexFunction · 0.85
transactionsFromMethod · 0.80
forceSenderMethod · 0.80
setResultRecipientMethod · 0.80
blockMethod · 0.45
gasLimitRemainingMethod · 0.45
gasBidPriceMethod · 0.45
addBalanceMethod · 0.45
gasMethod · 0.45

Tested by

no test coverage detected