|
|
@ -24,7 +24,6 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/core" |
|
|
|
"github.com/ethereum/go-ethereum/core" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/event" |
|
|
|
"github.com/ethereum/go-ethereum/event" |
|
|
|
"github.com/ethereum/go-ethereum/state" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/ui/qt" |
|
|
|
"github.com/ethereum/go-ethereum/ui/qt" |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
"github.com/obscuren/qml" |
|
|
|
"github.com/obscuren/qml" |
|
|
@ -39,7 +38,6 @@ type AppContainer interface { |
|
|
|
|
|
|
|
|
|
|
|
NewBlock(*types.Block) |
|
|
|
NewBlock(*types.Block) |
|
|
|
NewWatcher(chan bool) |
|
|
|
NewWatcher(chan bool) |
|
|
|
Messages(state.Messages, string) |
|
|
|
|
|
|
|
Post(string, int) |
|
|
|
Post(string, int) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -79,10 +77,6 @@ func (app *ExtApplication) run() { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Subscribe to events
|
|
|
|
|
|
|
|
mux := app.lib.eth.EventMux() |
|
|
|
|
|
|
|
app.events = mux.Subscribe(core.NewBlockEvent{}, state.Messages(nil)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Call the main loop
|
|
|
|
// Call the main loop
|
|
|
|
go app.mainLoop() |
|
|
|
go app.mainLoop() |
|
|
|
|
|
|
|
|
|
|
@ -126,23 +120,3 @@ func (app *ExtApplication) mainLoop() { |
|
|
|
func (self *ExtApplication) Watch(filterOptions map[string]interface{}, identifier string) { |
|
|
|
func (self *ExtApplication) Watch(filterOptions map[string]interface{}, identifier string) { |
|
|
|
self.filters[identifier] = qt.NewFilterFromMap(filterOptions, self.eth) |
|
|
|
self.filters[identifier] = qt.NewFilterFromMap(filterOptions, self.eth) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *ExtApplication) GetMessages(object map[string]interface{}) string { |
|
|
|
|
|
|
|
/* TODO remove me |
|
|
|
|
|
|
|
filter := qt.NewFilterFromMap(object, self.eth) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
messages := filter.Find() |
|
|
|
|
|
|
|
var msgs []javascript.JSMessage |
|
|
|
|
|
|
|
for _, m := range messages { |
|
|
|
|
|
|
|
msgs = append(msgs, javascript.NewJSMessage(m)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
b, err := json.Marshal(msgs) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return "{\"error\":" + err.Error() + "}" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return string(b) |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
return "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|