aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-10 01:19:35 +0800
committerobscuren <geffobscura@gmail.com>2015-03-10 01:19:35 +0800
commita7538d0020d3a51ab3b25997b3c4f01db87d4c7a (patch)
treeac23a9075dadc07d780c93ffff94f6fc6ce742c6 /rpc/api.go
parent8560004f380dc688a1171ad5aeffa593aae41193 (diff)
downloaddexon-a7538d0020d3a51ab3b25997b3c4f01db87d4c7a.tar.gz
dexon-a7538d0020d3a51ab3b25997b3c4f01db87d4c7a.tar.zst
dexon-a7538d0020d3a51ab3b25997b3c4f01db87d4c7a.zip
merge
Diffstat (limited to 'rpc/api.go')
-rw-r--r--rpc/api.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 617e4998d..dc0945d19 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -665,10 +665,20 @@ func toFilterOptions(options *FilterOptions) core.FilterOptions {
opts.Earliest = options.Earliest
opts.Latest = options.Latest
- opts.Topics = make([][][]byte, len(options.Topic))
- for i, topic := range options.Topic {
- opts.Topics[i] = fromHex(topic)
+
+ topics := make([][][]byte, len(options.Topics))
+ for i, topicDat := range options.Topics {
+ if slice, ok := topicDat.([]interface{}); ok {
+ topics[i] = make([][]byte, len(slice))
+ for j, topic := range slice {
+ topics[i][j] = fromHex(topic.(string))
+ }
+ } else if str, ok := topicDat.(string); ok {
+ topics[i] = make([][]byte, 1)
+ topics[i][0] = fromHex(str)
+ }
}
+ opts.Topics = topics
return opts
}