diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-08 23:14:58 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-08 23:15:45 +0800 |
commit | 1c872ddf4b1db51847a5d9d020e13d432e847f52 (patch) | |
tree | 72ec461427269a25165b58043f328fd374e143ee /rpc/responses.go | |
parent | 6284604b52e075e454e61f2933cadaaf9ded364b (diff) | |
download | dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.gz dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.zst dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.zip |
Changed how logs are being recorded
Logs are now recorded per transactions instead of tossing them out after
each transaction. This should also fix an issue with
`eth_getFilterLogs` (#629) Also now implemented are the `transactionHash,
blockHash, transactionIndex, logIndex` on logs. Closes #654.
Diffstat (limited to 'rpc/responses.go')
-rw-r--r-- | rpc/responses.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rpc/responses.go b/rpc/responses.go index 52a2f714c..3620f643e 100644 --- a/rpc/responses.go +++ b/rpc/responses.go @@ -284,15 +284,19 @@ type LogRes struct { TransactionIndex *hexnum `json:"transactionIndex"` } -func NewLogRes(log state.Log) LogRes { +func NewLogRes(log *state.Log) LogRes { var l LogRes - l.Topics = make([]*hexdata, len(log.Topics())) - for j, topic := range log.Topics() { + l.Topics = make([]*hexdata, len(log.Topics)) + for j, topic := range log.Topics { l.Topics[j] = newHexData(topic) } - l.Address = newHexData(log.Address()) - l.Data = newHexData(log.Data()) - l.BlockNumber = newHexNum(log.Number()) + l.Address = newHexData(log.Address) + l.Data = newHexData(log.Data) + l.BlockNumber = newHexNum(log.Number) + l.LogIndex = newHexNum(log.Index) + l.TransactionHash = newHexData(log.TxHash) + l.TransactionIndex = newHexNum(log.TxIndex) + l.BlockHash = newHexData(log.BlockHash) return l } |