| 122 | } |
| 123 | |
| 124 | UniValue transactionReceiptToJSON(const dev::eth::TransactionReceipt& txRec) |
| 125 | { |
| 126 | UniValue result(UniValue::VOBJ); |
| 127 | result.push_back(Pair("stateRoot", txRec.stateRoot().hex())); |
| 128 | result.push_back(Pair("gasUsed", CAmount(txRec.gasUsed()))); |
| 129 | result.push_back(Pair("bloom", txRec.bloom().hex())); |
| 130 | UniValue logEntries(UniValue::VARR); |
| 131 | dev::eth::LogEntries logs = txRec.log(); |
| 132 | for(dev::eth::LogEntry log : logs){ |
| 133 | UniValue logEntrie(UniValue::VOBJ); |
| 134 | logEntrie.push_back(Pair("address", log.address.hex())); |
| 135 | UniValue topics(UniValue::VARR); |
| 136 | for(dev::h256 l : log.topics){ |
| 137 | topics.push_back(l.hex()); |
| 138 | } |
| 139 | logEntrie.push_back(Pair("topics", topics)); |
| 140 | logEntrie.push_back(Pair("data", HexStr(log.data))); |
| 141 | logEntries.push_back(logEntrie); |
| 142 | } |
| 143 | result.push_back(Pair("log", logEntries)); |
| 144 | return result; |
| 145 | } |
| 146 | |
| 147 | void assignJSON(UniValue& entry, const TransactionReceiptInfo& resExec) { |
| 148 | entry.push_back(Pair("blockHash", resExec.blockHash.GetHex())); |