|
|
@ -182,30 +182,17 @@ Json::Value toJson(dev::eth::TransactionReceipt const& _t) |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
Json::Value toJson(dev::eth::TransactionReceipt const& _tr, std::pair<h256, unsigned> _location, BlockNumber _blockNumber, Transaction const& _t) |
|
|
|
Json::Value toJson(dev::eth::LocalisedTransactionReceipt const& _t) |
|
|
|
{ |
|
|
|
Json::Value res; |
|
|
|
h256 h = _t.sha3(); |
|
|
|
res["transactionHash"] = toJS(h); |
|
|
|
res["transactionIndex"] = _location.second; |
|
|
|
res["blockHash"] = toJS(_location.first); |
|
|
|
res["blockNumber"] = _blockNumber; |
|
|
|
res["cumulativeGasUsed"] = toJS(_tr.gasUsed()); // TODO: check if this is fine
|
|
|
|
res["gasUsed"] = toJS(_tr.gasUsed()); |
|
|
|
res["contractAddress"] = toJS(toAddress(_t.from(), _t.nonce())); |
|
|
|
res["logs"] = Json::Value(Json::arrayValue); |
|
|
|
for (unsigned i = 0; i < _tr.log().size(); i++) |
|
|
|
{ |
|
|
|
LogEntry e = _tr.log()[i]; |
|
|
|
Json::Value l = toJson(e); |
|
|
|
l["type"] = "mined"; |
|
|
|
l["blockNumber"] = _blockNumber; |
|
|
|
l["blockHash"] = toJS(_location.first); |
|
|
|
l["logIndex"] = i; |
|
|
|
l["transactionHash"] = toJS(h); |
|
|
|
l["transactionIndex"] = _location.second; |
|
|
|
res["logs"].append(l); |
|
|
|
} |
|
|
|
res["transactionHash"] = toJS(_t.hash()); |
|
|
|
res["transactionIndex"] = _t.transactionIndex(); |
|
|
|
res["blockHash"] = toJS(_t.blockHash()); |
|
|
|
res["blockNumber"] = _t.blockNumber(); |
|
|
|
res["cumulativeGasUsed"] = toJS(_t.gasUsed()); // TODO: check if this is fine
|
|
|
|
res["gasUsed"] = toJS(_t.gasUsed()); |
|
|
|
res["contractAddress"] = toJS(_t.contractAddress()); |
|
|
|
res["logs"] = dev::toJson(_t.localisedLogs()); |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|