提交 827ea434 编写于 作者: O obscuren

removed all old filters

上级 253eb778
......@@ -24,7 +24,6 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/ui/qt"
"github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/qml"
)
......@@ -116,7 +115,3 @@ func (app *ExtApplication) mainLoop() {
}
}
}
func (self *ExtApplication) Watch(filterOptions map[string]interface{}, identifier string) {
self.filters[identifier] = qt.NewFilterFromMap(filterOptions, self.eth)
}
package qt
import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ui"
"github.com/obscuren/qml"
)
func NewFilterFromMap(object map[string]interface{}, eth core.Backend) *core.Filter {
filter := ui.NewFilterFromMap(object, eth)
if object["topics"] != nil {
filter.SetTopics(makeTopics(object["topics"]))
}
return filter
}
func makeTopics(v interface{}) (d [][]byte) {
if qList, ok := v.(*qml.List); ok {
var s []string
qList.Convert(&s)
d = ui.MakeTopics(s)
} else if str, ok := v.(string); ok {
d = ui.MakeTopics(str)
}
return
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册