| 177 | } |
| 178 | |
| 179 | Json::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 | } |
no test coverage detected