aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/parsing.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-06 19:43:02 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-06 19:43:02 +0800
commit4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a (patch)
tree7780b142547c121d9ada914b6bedce86777636cd /rpc/api/parsing.go
parent457a3c8f7691314b30909787b952fccebf7f38df (diff)
downloaddexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar.gz
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar.bz2
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar.lz
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar.xz
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.tar.zst
dexon-4f7fc7b23f50f3fba4e2fb6815738c4ec2c8fe0a.zip
rpc, xeth: fixed returned tx hash & receipt logs
Diffstat (limited to 'rpc/api/parsing.go')
-rw-r--r--rpc/api/parsing.go23
1 files changed, 14 insertions, 9 deletions
diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go
index 4209ea7e3..8e25ffffb 100644
--- a/rpc/api/parsing.go
+++ b/rpc/api/parsing.go
@@ -404,14 +404,14 @@ func NewUncleRes(h *types.Header) *UncleRes {
// }
type ReceiptRes struct {
- TransactionHash *hexdata `json:transactionHash`
- TransactionIndex *hexnum `json:transactionIndex`
- BlockNumber *hexnum `json:blockNumber`
- BlockHash *hexdata `json:blockHash`
- CumulativeGasUsed *hexnum `json:cumulativeGasUsed`
- GasUsed *hexnum `json:gasUsed`
- ContractAddress *hexdata `json:contractAddress`
- Logs *[]interface{} `json:logs`
+ TransactionHash *hexdata `json:"transactionHash"`
+ TransactionIndex *hexnum `json:"transactionIndex"`
+ BlockNumber *hexnum `json:"blockNumber"`
+ BlockHash *hexdata `json:"blockHash"`
+ CumulativeGasUsed *hexnum `json:"cumulativeGasUsed"`
+ GasUsed *hexnum `json:"gasUsed"`
+ ContractAddress *hexdata `json:"contractAddress"`
+ Logs *[]interface{} `json:"logs"`
}
func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
@@ -430,7 +430,12 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
if bytes.Compare(rec.ContractAddress.Bytes(), bytes.Repeat([]byte{0}, 20)) != 0 {
v.ContractAddress = newHexData(rec.ContractAddress)
}
- // v.Logs = rec.Logs()
+
+ logs := make([]interface{}, len(rec.Logs()))
+ for i, log := range rec.Logs() {
+ logs[i] = NewLogRes(log)
+ }
+ v.Logs = &logs
return v
}