From d3e31a4a6db6166b0639f0e9be5f70d5035baeeb Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 11 Jul 2014 16:04:27 +0200 Subject: [PATCH 1/9] Special diff output + debugger changes --- ethereal/assets/debugger/debugger.qml | 2 +- ethereal/debugger.go | 13 +++++++++++-- ethereum/flags.go | 2 ++ ethereum/main.go | 8 ++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ethereal/assets/debugger/debugger.qml b/ethereal/assets/debugger/debugger.qml index f204647c8..4d01ea183 100644 --- a/ethereal/assets/debugger/debugger.qml +++ b/ethereal/assets/debugger/debugger.qml @@ -116,7 +116,7 @@ ApplicationWindow { id: compileTimer interval: 500 ; running: true ; repeat: true onTriggered: { - dbg.compile(codeEditor.text) + dbg.autoComp(codeEditor.text) } } } diff --git a/ethereal/debugger.go b/ethereal/debugger.go index 64ca316f8..997c2e8dd 100644 --- a/ethereal/debugger.go +++ b/ethereal/debugger.go @@ -74,6 +74,13 @@ func (self *DebuggerWindow) Compile(code string) { } } +// Used by QML +func (self *DebuggerWindow) AutoComp(code string) { + if self.Db.done { + self.Compile(code) + } +} + func (self *DebuggerWindow) ClearLog() { self.win.Root().Call("clearLog") } @@ -110,8 +117,6 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data return } - self.SetAsm(script) - var ( gas = ethutil.Big(gasStr) gasPrice = ethutil.Big(gasPriceStr) @@ -257,6 +262,10 @@ func (self *Debugger) StepHook(pc int, op ethchain.OpCode, mem *ethchain.Memory, return self.halting(pc, op, mem, stack, stateObject) } +func (self *Debugger) SetCode(byteCode []byte) { + self.main.SetAsm(byteCode) +} + func (self *Debugger) BreakPoints() []int64 { return self.breakPoints } diff --git a/ethereum/flags.go b/ethereum/flags.go index d5a9c3a8a..af0fd9a69 100644 --- a/ethereum/flags.go +++ b/ethereum/flags.go @@ -11,6 +11,7 @@ import ( var Identifier string var KeyRing string +var DiffTool bool var KeyStore string var StartRpc bool var RpcPort int @@ -66,6 +67,7 @@ func Init() { flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file") flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") + flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") flag.BoolVar(&StartMining, "mine", false, "start dagger mining") flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console") diff --git a/ethereum/main.go b/ethereum/main.go index e4d73d494..39226c1d2 100644 --- a/ethereum/main.go +++ b/ethereum/main.go @@ -2,6 +2,7 @@ package main import ( "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/utils" "runtime" ) @@ -20,7 +21,14 @@ func main() { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line + + // If the difftool option is selected ignore all other log output + if DiffTool { + LogLevel = 0 + } + utils.InitConfig(ConfigFile, Datadir, "ETH") + ethutil.Config.Diff = DiffTool utils.InitDataDir(Datadir) From 288f1c5387c1a0a8863499389e8a7ca7e3068208 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 12 Jul 2014 11:02:50 +0200 Subject: [PATCH 2/9] Removed timer --- ethereal/assets/debugger/debugger.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereal/assets/debugger/debugger.qml b/ethereal/assets/debugger/debugger.qml index 4d01ea183..fa56737a2 100644 --- a/ethereal/assets/debugger/debugger.qml +++ b/ethereal/assets/debugger/debugger.qml @@ -19,7 +19,7 @@ ApplicationWindow { property alias dataText: rawDataField.text onClosing: { - compileTimer.stop() + //compileTimer.stop() } MenuBar { @@ -112,6 +112,7 @@ ApplicationWindow { anchors.right: settings.left focus: true + /* Timer { id: compileTimer interval: 500 ; running: true ; repeat: true @@ -119,6 +120,7 @@ ApplicationWindow { dbg.autoComp(codeEditor.text) } } + */ } Column { From e6a428f85f0d1c7e50dc8262a7687ec2f1ce2d7b Mon Sep 17 00:00:00 2001 From: Maran Date: Mon, 14 Jul 2014 15:25:01 +0200 Subject: [PATCH 3/9] Make the reload watcher use windows-safe paths --- ethereal/html_container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 1e835eebc..2ad06ffb5 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -59,7 +59,7 @@ func (app *HtmlApplication) RootFolder() string { if err != nil { return "" } - return path.Dir(folder.RequestURI()) + return path.Dir(ethutil.WindonizePath(folder.RequestURI())) } func (app *HtmlApplication) RecursiveFolders() []os.FileInfo { files, _ := ioutil.ReadDir(app.RootFolder()) From dce0ccf4902def623f33af3ce3878d1c1512101e Mon Sep 17 00:00:00 2001 From: Maran Date: Mon, 14 Jul 2014 15:29:02 +0200 Subject: [PATCH 4/9] Don't silently fail on watcher creation --- ethereal/html_container.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 2ad06ffb5..04136f801 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -8,7 +8,6 @@ import ( "github.com/go-qml/qml" "github.com/howeyc/fsnotify" "io/ioutil" - "log" "net/url" "os" "path" @@ -77,11 +76,13 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) { app.watcher, err = fsnotify.NewWatcher() if err != nil { + logger.Infoln("Could not create new auto-reload watcher:", err) return } err = app.watcher.Watch(app.RootFolder()) if err != nil { - log.Fatal(err) + logger.Infoln("Could not start auto-reload watcher:", err) + return } for _, folder := range app.RecursiveFolders() { fullPath := app.RootFolder() + "/" + folder.Name() From e53acdc2ac45fa8953afc3392ed81653d6f26326 Mon Sep 17 00:00:00 2001 From: Maran Date: Mon, 14 Jul 2014 16:46:00 +0200 Subject: [PATCH 5/9] Work around race condition with qt webinspector for windows builds --- ethereal/assets/qml/webapp.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ethereal/assets/qml/webapp.qml b/ethereal/assets/qml/webapp.qml index 401267511..5e4c035d8 100644 --- a/ethereal/assets/qml/webapp.qml +++ b/ethereal/assets/qml/webapp.qml @@ -191,6 +191,7 @@ ApplicationWindow { inspector.visible = false }else{ inspector.visible = true + inspector.url = webview.experimental.remoteInspectorUrl } } onDoubleClicked: { @@ -224,7 +225,6 @@ ApplicationWindow { WebView { id: inspector visible: false - url: webview.experimental.remoteInspectorUrl anchors { left: root.left right: root.right @@ -238,7 +238,6 @@ ApplicationWindow { name: "inspectorShown" PropertyChanges { target: inspector - url: webview.experimental.remoteInspectorUrl } } ] From c0ae5c58a6b3d78540ec19b24bd31b6e14e24191 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 15 Jul 2014 12:52:30 +0200 Subject: [PATCH 6/9] Rewrote mnemonic word loading to facilitate deployable builds. --- ethereal/flags.go | 31 ++----------------------------- utils/cmd.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/ethereal/flags.go b/ethereal/flags.go index d5ca9f336..c7d330f80 100644 --- a/ethereal/flags.go +++ b/ethereal/flags.go @@ -1,15 +1,13 @@ package main import ( - "bitbucket.org/kardianos/osext" "flag" "fmt" "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/go-ethereum/utils" "os" "os/user" "path" - "path/filepath" - "runtime" ) var Identifier string @@ -36,31 +34,6 @@ var LogLevel int // flags specific to gui client var AssetPath string -func defaultAssetPath() string { - var assetPath string - // If the current working directory is the go-ethereum dir - // assume a debug build and use the source directory as - // asset directory. - pwd, _ := os.Getwd() - if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") { - assetPath = path.Join(pwd, "assets") - } else { - switch runtime.GOOS { - case "darwin": - // Get Binary Directory - exedir, _ := osext.ExecutableFolder() - assetPath = filepath.Join(exedir, "../Resources") - case "linux": - assetPath = "/usr/share/ethereal" - case "windows": - assetPath = "./assets" - default: - assetPath = "." - } - } - return assetPath -} - func defaultDataDir() string { usr, _ := user.Current() return path.Join(usr.HomeDir, ".ethereal") @@ -93,7 +66,7 @@ func Init() { flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") - flag.StringVar(&AssetPath, "asset_path", defaultAssetPath(), "absolute path to GUI assets directory") + flag.StringVar(&AssetPath, "asset_path", utils.DefaultAssetPath(), "absolute path to GUI assets directory") flag.Parse() } diff --git a/utils/cmd.go b/utils/cmd.go index 889726b04..fac164b47 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -1,6 +1,7 @@ package utils import ( + "bitbucket.org/kardianos/osext" "fmt" "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethcrypto" @@ -16,6 +17,8 @@ import ( "os" "os/signal" "path" + "path/filepath" + "runtime" "time" ) @@ -164,7 +167,33 @@ func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *ethcry return keyManager } +func DefaultAssetPath() string { + var assetPath string + // If the current working directory is the go-ethereum dir + // assume a debug build and use the source directory as + // asset directory. + pwd, _ := os.Getwd() + if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") { + assetPath = path.Join(pwd, "assets") + } else { + switch runtime.GOOS { + case "darwin": + // Get Binary Directory + exedir, _ := osext.ExecutableFolder() + assetPath = filepath.Join(exedir, "../Resources") + case "linux": + assetPath = "/usr/share/ethereal" + case "windows": + assetPath = "./assets" + default: + assetPath = "." + } + } + return assetPath +} func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) { + ethcrypto.InitWords(DefaultAssetPath()) // Init mnemonic word list + var err error switch { case GenAddr: From 223432fa1eedb9fa5c712056afb804322aa12b02 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 15 Jul 2014 16:21:16 +0200 Subject: [PATCH 7/9] Work around crash issues when building OSX binary --- ethereal/flags.go | 31 +++++++++++++++++++++++++++++-- utils/cmd.go | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ethereal/flags.go b/ethereal/flags.go index c7d330f80..c9327c3d3 100644 --- a/ethereal/flags.go +++ b/ethereal/flags.go @@ -1,13 +1,15 @@ package main import ( + "bitbucket.org/kardianos/osext" "flag" "fmt" "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/go-ethereum/utils" "os" "os/user" "path" + "path/filepath" + "runtime" ) var Identifier string @@ -34,6 +36,31 @@ var LogLevel int // flags specific to gui client var AssetPath string +//TODO: If we re-use the one defined in cmd.go the binary osx image crashes. If somebody finds out why we can dry this up. +func defaultAssetPath() string { + var assetPath string + // If the current working directory is the go-ethereum dir + // assume a debug build and use the source directory as + // asset directory. + pwd, _ := os.Getwd() + if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") { + assetPath = path.Join(pwd, "assets") + } else { + switch runtime.GOOS { + case "darwin": + // Get Binary Directory + exedir, _ := osext.ExecutableFolder() + assetPath = filepath.Join(exedir, "../Resources") + case "linux": + assetPath = "/usr/share/ethereal" + case "windows": + assetPath = "./assets" + default: + assetPath = "." + } + } + return assetPath +} func defaultDataDir() string { usr, _ := user.Current() return path.Join(usr.HomeDir, ".ethereal") @@ -66,7 +93,7 @@ func Init() { flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") - flag.StringVar(&AssetPath, "asset_path", utils.DefaultAssetPath(), "absolute path to GUI assets directory") + flag.StringVar(&AssetPath, "asset_path", defaultAssetPath(), "absolute path to GUI assets directory") flag.Parse() } diff --git a/utils/cmd.go b/utils/cmd.go index fac164b47..1e1599582 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -191,6 +191,7 @@ func DefaultAssetPath() string { } return assetPath } + func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) { ethcrypto.InitWords(DefaultAssetPath()) // Init mnemonic word list From 28948d061cfc14d7a5da307a12ebd504b78d2dbb Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 15 Jul 2014 20:34:25 +0200 Subject: [PATCH 8/9] Moved the repl to a new package --- ethereum/cmd.go | 5 +- ethereum/flags.go | 2 + ethereum/main.go | 1 + ethereum/{ => repl}/javascript_runtime.go | 2 +- ethereum/{ => repl}/js_lib.go | 2 +- ethereum/repl/repl.go | 83 +++++++++++++++++++++++ ethereum/{ => repl}/repl_darwin.go | 2 +- ethereum/{ => repl}/repl_linux.go | 0 ethereum/{ => repl}/repl_windows.go | 2 +- ethereum/{repl.go => repl/types.go} | 82 ++++------------------ 10 files changed, 105 insertions(+), 76 deletions(-) rename ethereum/{ => repl}/javascript_runtime.go (99%) rename ethereum/{ => repl}/js_lib.go (98%) create mode 100644 ethereum/repl/repl.go rename ethereum/{ => repl}/repl_darwin.go (99%) rename ethereum/{ => repl}/repl_linux.go (100%) rename ethereum/{ => repl}/repl_windows.go (95%) rename ethereum/{repl.go => repl/types.go} (57%) diff --git a/ethereum/cmd.go b/ethereum/cmd.go index 08147824d..ff2b8409c 100644 --- a/ethereum/cmd.go +++ b/ethereum/cmd.go @@ -2,13 +2,14 @@ package main import ( "github.com/ethereum/eth-go" + "github.com/ethereum/go-ethereum/ethereum/repl" "github.com/ethereum/go-ethereum/utils" "io/ioutil" "os" ) func InitJsConsole(ethereum *eth.Ethereum) { - repl := NewJSRepl(ethereum) + repl := ethrepl.NewJSRepl(ethereum) go repl.Start() utils.RegisterInterrupt(func(os.Signal) { repl.Stop() @@ -24,7 +25,7 @@ func ExecJsFile(ethereum *eth.Ethereum, InputFile string) { if err != nil { logger.Fatalln(err) } - re := NewJSRE(ethereum) + re := ethrepl.NewJSRE(ethereum) utils.RegisterInterrupt(func(os.Signal) { re.Stop() }) diff --git a/ethereum/flags.go b/ethereum/flags.go index af0fd9a69..4f59ddf06 100644 --- a/ethereum/flags.go +++ b/ethereum/flags.go @@ -12,6 +12,7 @@ import ( var Identifier string var KeyRing string var DiffTool bool +var DiffType string var KeyStore string var StartRpc bool var RpcPort int @@ -68,6 +69,7 @@ func Init() { flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") + flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false") flag.BoolVar(&StartMining, "mine", false, "start dagger mining") flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console") diff --git a/ethereum/main.go b/ethereum/main.go index 39226c1d2..fd4a89aa9 100644 --- a/ethereum/main.go +++ b/ethereum/main.go @@ -29,6 +29,7 @@ func main() { utils.InitConfig(ConfigFile, Datadir, "ETH") ethutil.Config.Diff = DiffTool + ethutil.Config.DiffType = DiffType utils.InitDataDir(Datadir) diff --git a/ethereum/javascript_runtime.go b/ethereum/repl/javascript_runtime.go similarity index 99% rename from ethereum/javascript_runtime.go rename to ethereum/repl/javascript_runtime.go index 852a50487..cd87f9868 100644 --- a/ethereum/javascript_runtime.go +++ b/ethereum/repl/javascript_runtime.go @@ -1,4 +1,4 @@ -package main +package ethrepl import ( "fmt" diff --git a/ethereum/js_lib.go b/ethereum/repl/js_lib.go similarity index 98% rename from ethereum/js_lib.go rename to ethereum/repl/js_lib.go index 189dcc3a0..c781c43d0 100644 --- a/ethereum/js_lib.go +++ b/ethereum/repl/js_lib.go @@ -1,4 +1,4 @@ -package main +package ethrepl const jsLib = ` function pp(object) { diff --git a/ethereum/repl/repl.go b/ethereum/repl/repl.go new file mode 100644 index 000000000..92d4ad86a --- /dev/null +++ b/ethereum/repl/repl.go @@ -0,0 +1,83 @@ +package ethrepl + +import ( + "bufio" + "fmt" + "github.com/ethereum/eth-go" + "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethutil" + "io" + "os" + "path" +) + +var logger = ethlog.NewLogger("REPL") + +type Repl interface { + Start() + Stop() +} + +type JSRepl struct { + re *JSRE + + prompt string + + history *os.File + + running bool +} + +func NewJSRepl(ethereum *eth.Ethereum) *JSRepl { + hist, err := os.OpenFile(path.Join(ethutil.Config.ExecPath, "history"), os.O_RDWR|os.O_CREATE, os.ModePerm) + if err != nil { + panic(err) + } + + return &JSRepl{re: NewJSRE(ethereum), prompt: "> ", history: hist} +} + +func (self *JSRepl) Start() { + if !self.running { + self.running = true + logger.Infoln("init JS Console") + reader := bufio.NewReader(self.history) + for { + line, err := reader.ReadString('\n') + if err != nil && err == io.EOF { + break + } else if err != nil { + fmt.Println("error reading history", err) + break + } + + addHistory(line[:len(line)-1]) + } + self.read() + } +} + +func (self *JSRepl) Stop() { + if self.running { + self.running = false + self.re.Stop() + logger.Infoln("exit JS Console") + self.history.Close() + } +} + +func (self *JSRepl) parseInput(code string) { + defer func() { + if r := recover(); r != nil { + fmt.Println("[native] error", r) + } + }() + + value, err := self.re.Run(code) + if err != nil { + fmt.Println(err) + return + } + + self.PrintValue(value) +} diff --git a/ethereum/repl_darwin.go b/ethereum/repl/repl_darwin.go similarity index 99% rename from ethereum/repl_darwin.go rename to ethereum/repl/repl_darwin.go index 62b40059a..3a91b0d44 100644 --- a/ethereum/repl_darwin.go +++ b/ethereum/repl/repl_darwin.go @@ -1,4 +1,4 @@ -package main +package ethrepl // #cgo darwin CFLAGS: -I/usr/local/opt/readline/include // #cgo darwin LDFLAGS: -L/usr/local/opt/readline/lib diff --git a/ethereum/repl_linux.go b/ethereum/repl/repl_linux.go similarity index 100% rename from ethereum/repl_linux.go rename to ethereum/repl/repl_linux.go diff --git a/ethereum/repl_windows.go b/ethereum/repl/repl_windows.go similarity index 95% rename from ethereum/repl_windows.go rename to ethereum/repl/repl_windows.go index 9d4787772..4106c89bc 100644 --- a/ethereum/repl_windows.go +++ b/ethereum/repl/repl_windows.go @@ -1,4 +1,4 @@ -package main +package ethrepl import ( "bufio" diff --git a/ethereum/repl.go b/ethereum/repl/types.go similarity index 57% rename from ethereum/repl.go rename to ethereum/repl/types.go index 34380a06f..16a18e6e5 100644 --- a/ethereum/repl.go +++ b/ethereum/repl/types.go @@ -1,84 +1,26 @@ -package main +package ethrepl import ( - "bufio" "fmt" - "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "github.com/obscuren/otto" - "io" - "os" - "path" ) -type Repl interface { - Start() - Stop() +type JSStateObject struct { + *ethpub.PStateObject + eth *JSEthereum } -type JSRepl struct { - re *JSRE +func (self *JSStateObject) EachStorage(call otto.FunctionCall) otto.Value { + cb := call.Argument(0) + self.PStateObject.EachStorage(func(key string, value *ethutil.Value) { + value.Decode() - prompt string + cb.Call(self.eth.toVal(self), self.eth.toVal(key), self.eth.toVal(ethutil.Bytes2Hex(value.Bytes()))) + }) - history *os.File - - running bool -} - -func NewJSRepl(ethereum *eth.Ethereum) *JSRepl { - hist, err := os.OpenFile(path.Join(ethutil.Config.ExecPath, "history"), os.O_RDWR|os.O_CREATE, os.ModePerm) - if err != nil { - panic(err) - } - - return &JSRepl{re: NewJSRE(ethereum), prompt: "> ", history: hist} -} - -func (self *JSRepl) Start() { - if !self.running { - self.running = true - logger.Infoln("init JS Console") - reader := bufio.NewReader(self.history) - for { - line, err := reader.ReadString('\n') - if err != nil && err == io.EOF { - break - } else if err != nil { - fmt.Println("error reading history", err) - break - } - - addHistory(line[:len(line)-1]) - } - self.read() - } -} - -func (self *JSRepl) Stop() { - if self.running { - self.running = false - self.re.Stop() - logger.Infoln("exit JS Console") - self.history.Close() - } -} - -func (self *JSRepl) parseInput(code string) { - defer func() { - if r := recover(); r != nil { - fmt.Println("[native] error", r) - } - }() - - value, err := self.re.Run(code) - if err != nil { - fmt.Println(err) - return - } - - self.PrintValue(value) + return otto.UndefinedValue() } // The JSEthereum object attempts to wrap the PEthereum object and returns @@ -110,7 +52,7 @@ func (self *JSEthereum) GetKey() otto.Value { } func (self *JSEthereum) GetStateObject(addr string) otto.Value { - return self.toVal(self.PEthereum.GetStateObject(addr)) + return self.toVal(&JSStateObject{self.PEthereum.GetStateObject(addr), self}) } func (self *JSEthereum) GetStateKeyVals(addr string) otto.Value { From 7d64b589b4cf3f71125d5bd0f0a8f6a560e909db Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 17 Jul 2014 15:02:25 +0200 Subject: [PATCH 9/9] h scroll --- ethereal/assets/debugger/debugger.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereal/assets/debugger/debugger.qml b/ethereal/assets/debugger/debugger.qml index fa56737a2..34fe01253 100644 --- a/ethereal/assets/debugger/debugger.qml +++ b/ethereal/assets/debugger/debugger.qml @@ -86,7 +86,7 @@ ApplicationWindow { TableView { id: asmTableView width: 200 - TableViewColumn{ role: "value" ; title: "" ; width: 200 } + TableViewColumn{ role: "value" ; title: "" ; width: asmTableView.width - 2 } model: asmModel }