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

Function transactionReceiptToJSON

src/rpcwallet.cpp:124–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124UniValue 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
147void assignJSON(UniValue& entry, const TransactionReceiptInfo& resExec) {
148 entry.push_back(Pair("blockHash", resExec.blockHash.GetHex()));

Callers 1

callcontractFunction · 0.85

Calls 7

PairFunction · 0.85
HexStrFunction · 0.85
hexMethod · 0.80
push_backMethod · 0.45
gasUsedMethod · 0.45
bloomMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected