Skip to content

Commit

Permalink
Merge pull request #10215 from filecoin-project/steb/txhash-topic
Browse files Browse the repository at this point in the history
feat: eth: harden event processing
  • Loading branch information
arajasek authored Feb 10, 2023
2 parents 1588dd3 + b0d917d commit 1996694
Show file tree
Hide file tree
Showing 9 changed files with 368 additions and 219 deletions.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/gateway.json.gz
Binary file not shown.
9 changes: 1 addition & 8 deletions chain/types/ethtypes/eth_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ import (
"github.com/filecoin-project/lotus/lib/must"
)

var (
EthTopic1 = "t1"
EthTopic2 = "t2"
EthTopic3 = "t3"
EthTopic4 = "t4"
)

var ErrInvalidAddress = errors.New("invalid Filecoin Eth address")

type EthUint64 uint64
Expand Down Expand Up @@ -626,7 +619,7 @@ type EthLog struct {
Data EthBytes `json:"data"`

// List of topics associated with the event log.
Topics []EthBytes `json:"topics"`
Topics []EthHash `json:"topics"`

// Following fields are derived from the transaction containing the log

Expand Down
2 changes: 1 addition & 1 deletion chain/types/ethtypes/eth_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func TestEthFilterResultMarshalJSON(t *testing.T) {
TransactionHash: hash1,
BlockHash: hash2,
BlockNumber: 53,
Topics: []EthBytes{hash1[:]},
Topics: []EthHash{hash1},
Data: EthBytes(hash1[:]),
Address: addr,
}
Expand Down
2 changes: 1 addition & 1 deletion documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2794,7 +2794,7 @@ Response:
"address": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"data": "0x07",
"topics": [
"0x07"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
],
"removed": true,
"logIndex": "0x5",
Expand Down
Loading

0 comments on commit 1996694

Please sign in to comment.