From 5c9fd19105c572ea717a8bc04758dcf3e71af47e Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 00:17:23 +0200 Subject: A few start up optimisations --- ethereal/html_container.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index b00d3f78e..40a9f5584 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -2,17 +2,18 @@ package main import ( "errors" + "io/ioutil" + "net/url" + "os" + "path" + "path/filepath" + "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" "github.com/go-qml/qml" "github.com/howeyc/fsnotify" - "io/ioutil" - "net/url" - "os" - "path" - "path/filepath" ) type HtmlApplication struct { @@ -41,7 +42,7 @@ func (app *HtmlApplication) Create() error { return errors.New("Ethereum package not yet supported") // TODO - ethutil.OpenPackage(app.path) + //ethutil.OpenPackage(app.path) } win := component.CreateWindow(nil) -- cgit v1.2.3 From aadc5be3ff9e3818e41d83910b9730e5f1af042e Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 00:24:14 +0200 Subject: Implemented new watch * Old watch methods have been removed * Implemented new callback handlers for onWatchCb * added new Filter JS object --- ethereal/html_container.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 40a9f5584..7deee487d 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -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() } -- cgit v1.2.3 From a6c4543c575b52b943ff54f74c9d650d73175fe0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 13:16:07 +0200 Subject: Moving over to ethpipe --- ethereal/html_container.go | 8 -------- 1 file changed, 8 deletions(-) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 7deee487d..bbf77402e 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -125,14 +125,6 @@ func (app *HtmlApplication) NewBlock(block *ethchain.Block) { app.webView.Call("onNewBlockCb", b) } -func (app *HtmlApplication) ObjectChanged(stateObject *ethstate.StateObject) { - app.webView.Call("onObjectChangeCb", ethpub.NewPStateObject(stateObject)) -} - -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 { -- cgit v1.2.3 From 9f4886839fbd3cf4872d721e5be1c1d61bbb64e7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 13:27:43 +0200 Subject: Moved over to hardcoded v1 of Go QML --- ethereal/html_container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index bbf77402e..172fff08e 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -14,8 +14,8 @@ import ( "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" + "gopkg.in/qml.v1" ) type HtmlApplication struct { -- cgit v1.2.3 From 2eab964a00b998068f49b088949730f4896e256c Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 16 Aug 2014 01:38:24 +0200 Subject: Switched over to ethpipe --- ethereal/html_container.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 172fff08e..e682dc3eb 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -10,7 +10,7 @@ import ( "path/filepath" "github.com/ethereum/eth-go/ethchain" - "github.com/ethereum/eth-go/ethpub" + "github.com/ethereum/eth-go/ethpipe" "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/javascript" @@ -121,7 +121,7 @@ func (app *HtmlApplication) Window() *qml.Window { } func (app *HtmlApplication) NewBlock(block *ethchain.Block) { - b := ðpub.PBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} + b := ðpipe.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} app.webView.Call("onNewBlockCb", b) } -- cgit v1.2.3 From 27735bbdfc4e32e2e5ca11f48591d62b766aa3f5 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 17 Aug 2014 12:41:23 +0200 Subject: State dumps from gui --- ethereal/html_container.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ethereal/html_container.go') diff --git a/ethereal/html_container.go b/ethereal/html_container.go index e682dc3eb..69edea570 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "errors" + "fmt" "io/ioutil" "net/url" "os" @@ -139,3 +140,8 @@ func (self *HtmlApplication) Messages(messages ethstate.Messages, id string) { func (app *HtmlApplication) Destroy() { app.engine.Destroy() } + +func (app *HtmlApplication) Post(data string, seed int) { + fmt.Println("about to call 'post'") + app.webView.Call("post", seed, data) +} -- cgit v1.2.3