Eth JSON-RPC API: make EthLog#Data a string.
This commit is contained in:
parent
5b4ec7dbea
commit
a536f533d8
@ -545,8 +545,8 @@ type EthLog struct {
|
|||||||
// Address is the address of the actor that produced the event log.
|
// Address is the address of the actor that produced the event log.
|
||||||
Address EthAddress `json:"address"`
|
Address EthAddress `json:"address"`
|
||||||
|
|
||||||
// Data is the values of the event log, excluding topics
|
// Data is the value of the event log, excluding topics
|
||||||
Data []EthHash `json:"data"`
|
Data EthHash `json:"data"`
|
||||||
|
|
||||||
// List of topics associated with the event log.
|
// List of topics associated with the event log.
|
||||||
Topics []EthHash `json:"topics"`
|
Topics []EthHash `json:"topics"`
|
||||||
|
@ -176,7 +176,7 @@ func TestEthFilterResultMarshalJSON(t *testing.T) {
|
|||||||
BlockHash: hash2,
|
BlockHash: hash2,
|
||||||
BlockNumber: 53,
|
BlockNumber: 53,
|
||||||
Topics: []EthHash{hash1},
|
Topics: []EthHash{hash1},
|
||||||
Data: []EthHash{hash1},
|
Data: hash1,
|
||||||
Address: addr,
|
Address: addr,
|
||||||
}
|
}
|
||||||
logjson, err := json.Marshal(log)
|
logjson, err := json.Marshal(log)
|
||||||
|
@ -1062,7 +1062,7 @@ func ethFilterResultFromEvents(evs []*filter.CollectedEvent) (*api.EthFilterResu
|
|||||||
if entry.Key == api.EthTopic1 || entry.Key == api.EthTopic2 || entry.Key == api.EthTopic3 || entry.Key == api.EthTopic4 {
|
if entry.Key == api.EthTopic1 || entry.Key == api.EthTopic2 || entry.Key == api.EthTopic3 || entry.Key == api.EthTopic4 {
|
||||||
log.Topics = append(log.Topics, hash)
|
log.Topics = append(log.Topics, hash)
|
||||||
} else {
|
} else {
|
||||||
log.Data = append(log.Data, hash)
|
log.Data = hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1497,7 +1497,7 @@ func newEthTxReceipt(ctx context.Context, tx api.EthTx, lookup *api.MsgLookup, r
|
|||||||
if entry.Key == api.EthTopic1 || entry.Key == api.EthTopic2 || entry.Key == api.EthTopic3 || entry.Key == api.EthTopic4 {
|
if entry.Key == api.EthTopic1 || entry.Key == api.EthTopic2 || entry.Key == api.EthTopic3 || entry.Key == api.EthTopic4 {
|
||||||
l.Topics = append(l.Topics, hash)
|
l.Topics = append(l.Topics, hash)
|
||||||
} else {
|
} else {
|
||||||
l.Data = append(l.Data, hash)
|
l.Data = hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user