Skip to content

Commit

Permalink
fix build subs topics (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
secmask authored Jan 8, 2024
1 parent 1be5318 commit c6fa296
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/evmclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,15 @@ func toEthereumFilterQuery(q FilterQuery) ethereum.FilterQuery {
addresses = append(addresses, ethcommon.HexToAddress(address))
}

topics := make([][]ethcommon.Hash, 0, len(q.Topics))
for i, ts := range q.Topics {
topics[i] = make([]ethcommon.Hash, 0, len(ts))
for _, t := range ts {
topics[i] = append(topics[i], ethcommon.HexToHash(t))
var topics [][]ethcommon.Hash
if len(q.Topics) > 0 {
topics = make([][]ethcommon.Hash, 0, len(q.Topics))
for _, ts := range q.Topics {
tps := make([]ethcommon.Hash, 0, len(ts))
for _, t := range ts {
tps = append(tps, ethcommon.HexToHash(t))
}
topics = append(topics, tps)
}
}

Expand Down

0 comments on commit c6fa296

Please sign in to comment.