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.
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user