Implemented new watch

* Old watch methods have been removed
* Implemented new callback handlers for onWatchCb
* added new Filter JS object
This commit is contained in:
obscuren
2014-08-15 00:24:14 +02:00
parent 1fd69e9569
commit aadc5be3ff
6 changed files with 114 additions and 50 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"encoding/json"
"errors"
"io/ioutil"
"net/url"
@ -12,6 +13,7 @@ import (
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/go-qml/qml"
"github.com/howeyc/fsnotify"
)
@ -131,6 +133,17 @@ func (app *HtmlApplication) StorageChanged(storageObject *ethstate.StorageState)
app.webView.Call("onStorageChangeCb", ethpub.NewPStorageState(storageObject))
}
func (self *HtmlApplication) Messages(messages ethstate.Messages, id string) {
var msgs []javascript.JSMessage
for _, m := range messages {
msgs = append(msgs, javascript.NewJSMessage(m))
}
b, _ := json.Marshal(msgs)
self.webView.Call("onWatchedCb", string(b), id)
}
func (app *HtmlApplication) Destroy() {
app.engine.Destroy()
}