good morning!!!!

Skip to content
Snippets Groups Projects
Commit a7538d00 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

merge

parent 8560004f
No related branches found
No related tags found
No related merge requests found
...@@ -665,10 +665,20 @@ func toFilterOptions(options *FilterOptions) core.FilterOptions { ...@@ -665,10 +665,20 @@ func toFilterOptions(options *FilterOptions) core.FilterOptions {
opts.Earliest = options.Earliest opts.Earliest = options.Earliest
opts.Latest = options.Latest opts.Latest = options.Latest
opts.Topics = make([][][]byte, len(options.Topic))
for i, topic := range options.Topic { topics := make([][][]byte, len(options.Topics))
opts.Topics[i] = fromHex(topic) 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 return opts
} }
...@@ -333,7 +333,7 @@ type FilterOptions struct { ...@@ -333,7 +333,7 @@ type FilterOptions struct {
Earliest int64 Earliest int64
Latest int64 Latest int64
Address interface{} Address interface{}
Topic []interface{} Topics []interface{}
Skip int Skip int
Max int Max int
} }
...@@ -360,20 +360,7 @@ func (args *FilterOptions) UnmarshalJSON(b []byte) (err error) { ...@@ -360,20 +360,7 @@ func (args *FilterOptions) UnmarshalJSON(b []byte) (err error) {
args.Max = int(ethutil.Big(obj[0].Limit).Int64()) args.Max = int(ethutil.Big(obj[0].Limit).Int64())
args.Skip = int(ethutil.Big(obj[0].Offset).Int64()) args.Skip = int(ethutil.Big(obj[0].Offset).Int64())
args.Address = obj[0].Address args.Address = obj[0].Address
args.Topics = obj[0].Topics
topics := make([][][]byte, len(obj[0].Topics))
for i, topicDat := range obj[0].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)
}
}
args.Topics = topics
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment