aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui/ui_lib.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-28 21:48:17 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-28 21:48:17 +0800
commit1eda1d25b0d27fe57287698fb883c9153ddda292 (patch)
tree17d3ab169fcb9a02b291abe4c37a8eb9bceb8c16 /ethereal/ui/ui_lib.go
parentaaeb26852299c0c65a4e296da718e0fc29baa6f8 (diff)
downloaddexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar.gz
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar.bz2
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar.lz
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar.xz
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.tar.zst
dexon-1eda1d25b0d27fe57287698fb883c9153ddda292.zip
Hooked up the Block Explorer to the Debugger so we can instantly debug made transactions
Diffstat (limited to 'ethereal/ui/ui_lib.go')
-rw-r--r--ethereal/ui/ui_lib.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/ethereal/ui/ui_lib.go b/ethereal/ui/ui_lib.go
index 998392525..73ec67c86 100644
--- a/ethereal/ui/ui_lib.go
+++ b/ethereal/ui/ui_lib.go
@@ -2,6 +2,7 @@ package ethui
import (
"bitbucket.org/kardianos/osext"
+ "encoding/hex"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
@@ -24,8 +25,9 @@ type UiLib struct {
connected bool
assetPath string
// The main application window
- win *qml.Window
- Db *Debugger
+ win *qml.Window
+ Db *Debugger
+ DbWindow *DebuggerWindow
}
func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
@@ -88,9 +90,26 @@ func (ui *UiLib) ConnectToPeer(addr string) {
func (ui *UiLib) AssetPath(p string) string {
return path.Join(ui.assetPath, p)
}
+func (self *UiLib) StartDbWithContractAndData(contractHash, data string) {
+ dbWindow := NewDebuggerWindow(self)
+ object := self.eth.StateManager().CurrentState().GetStateObject(ethutil.FromHex(contractHash))
+ if len(object.Script()) > 0 {
+ dbWindow.SetCode("0x" + hex.EncodeToString(object.Script()))
+ }
+ dbWindow.SetData(data)
+
+ dbWindow.Show()
+}
+
+func (self *UiLib) StartDbWithCode(code string) {
+ dbWindow := NewDebuggerWindow(self)
+ dbWindow.SetCode("0x" + code)
+ dbWindow.Show()
+}
func (self *UiLib) StartDebugger() {
dbWindow := NewDebuggerWindow(self)
+ //self.DbWindow = dbWindow
dbWindow.Show()
}