Skip to content

Commit

Permalink
[api] Fix parsing of log filter (#4376)
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Aug 26, 2024
1 parent 3aa7d30 commit c855595
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/web3server_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ func parseLogRequest(in gjson.Result) (*filterObject, error) {
logReq.Address = append(logReq.Address, addr.String())
}
for _, topics := range req.Get("topics").Array() {
var topicArr []string
if topics.IsArray() {
var topicArr []string
for _, topic := range topics.Array() {
topicArr = append(topicArr, util.Remove0xPrefix(topic.String()))
}
logReq.Topics = append(logReq.Topics, topicArr)
} else {
logReq.Topics = append(logReq.Topics, []string{util.Remove0xPrefix(topics.String())})
} else if str := topics.String(); str != "" {
topicArr = append(topicArr, util.Remove0xPrefix(str))
}
logReq.Topics = append(logReq.Topics, topicArr)
}
}
return &logReq, nil
Expand Down

0 comments on commit c855595

Please sign in to comment.