From e7a80ec68165755678647f2d3e9b475d492a70dd Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 22 Jul 2014 19:54:33 +0200 Subject: [PATCH 01/11] set asm --- ethereal/debugger.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ethereal/debugger.go b/ethereal/debugger.go index 17087f8ce..a82dcb43f 100644 --- a/ethereal/debugger.go +++ b/ethereal/debugger.go @@ -133,6 +133,8 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data contract := ethchain.NewStateObject([]byte{0}) contract.Amount = value + self.SetAsm(script) + callerClosure := ethchain.NewClosure(account, contract, script, state, gas, gasPrice) block := self.lib.eth.BlockChain().CurrentBlock From a06a84d19b24da4005bc4d150f071ec4a703521b Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 24 Jul 2014 12:30:41 +0200 Subject: [PATCH 02/11] Refactored to reflect the new VM and State --- README.md | 2 +- ethereal/assets/qml/wallet.qml | 2 ++ ethereal/debugger.go | 44 ++++++++++++++++++++-------------- ethereal/ext_app.go | 9 +++---- ethereal/html_container.go | 5 ++-- ethereal/main.go | 2 +- ethereal/qml_container.go | 5 ++-- ethereal/ui_lib.go | 4 ++-- ethereum/main.go | 2 +- utils/vm_env.go | 33 +++++++++++++++++++++++++ 10 files changed, 77 insertions(+), 31 deletions(-) create mode 100644 utils/vm_env.go diff --git a/README.md b/README.md index 29dae7341..790ee541e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Ethereum Ethereum Go Client © 2014 Jeffrey Wilcke. -Current state: Proof of Concept 0.5.17. +Current state: Proof of Concept 0.6.0. For the development package please see the [eth-go package](https://github.com/ethereum/eth-go). diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index a79e4708c..eef49824f 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -249,6 +249,8 @@ ApplicationWindow { } TextField { text: eth.getCustomIdentifier() + width: 500 + placeholderText: "Anonymous" onTextChanged: { eth.setCustomIdentifier(text) } diff --git a/ethereal/debugger.go b/ethereal/debugger.go index a82dcb43f..096387405 100644 --- a/ethereal/debugger.go +++ b/ethereal/debugger.go @@ -3,7 +3,10 @@ package main import ( "fmt" "github.com/ethereum/eth-go/ethchain" + "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" + "github.com/ethereum/eth-go/ethvm" + "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" "math/big" "strconv" @@ -15,10 +18,10 @@ type DebuggerWindow struct { engine *qml.Engine lib *UiLib - vm *ethchain.Vm + vm *ethvm.Vm Db *Debugger - state *ethchain.State + state *ethstate.State } func NewDebuggerWindow(lib *UiLib) *DebuggerWindow { @@ -32,7 +35,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow { win := component.CreateWindow(nil) - w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: ðchain.Vm{}} + w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: ðvm.Vm{}} w.Db = NewDebugger(w) return w @@ -130,24 +133,29 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data state := self.lib.eth.StateManager().TransState() account := self.lib.eth.StateManager().TransState().GetAccount(keyPair.Address()) - contract := ethchain.NewStateObject([]byte{0}) + contract := ethstate.NewStateObject([]byte{0}) contract.Amount = value self.SetAsm(script) - callerClosure := ethchain.NewClosure(account, contract, script, state, gas, gasPrice) + callerClosure := ethvm.NewClosure(account, contract, script, gas, gasPrice) block := self.lib.eth.BlockChain().CurrentBlock - vm := ethchain.NewVm(state, self.lib.eth.StateManager(), ethchain.RuntimeVars{ - Block: block, - Origin: account.Address(), - BlockNumber: block.Number, - PrevHash: block.PrevHash, - Coinbase: block.Coinbase, - Time: block.Time, - Diff: block.Difficulty, - Value: ethutil.Big(valueStr), - }) + + /* + vm := ethchain.NewVm(state, self.lib.eth.StateManager(), ethchain.RuntimeVars{ + Block: block, + Origin: account.Address(), + BlockNumber: block.Number, + PrevHash: block.PrevHash, + Coinbase: block.Coinbase, + Time: block.Time, + Diff: block.Difficulty, + Value: ethutil.Big(valueStr), + }) + */ + env := utils.NewEnv(state, block, account.Address(), value) + vm := ethvm.New(env) vm.Verbose = true vm.Dbg = self.Db @@ -257,13 +265,13 @@ type storeVal struct { Key, Value string } -func (self *Debugger) BreakHook(pc int, op ethchain.OpCode, mem *ethchain.Memory, stack *ethchain.Stack, stateObject *ethchain.StateObject) bool { +func (self *Debugger) BreakHook(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { self.main.Logln("break on instr:", pc) return self.halting(pc, op, mem, stack, stateObject) } -func (self *Debugger) StepHook(pc int, op ethchain.OpCode, mem *ethchain.Memory, stack *ethchain.Stack, stateObject *ethchain.StateObject) bool { +func (self *Debugger) StepHook(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { return self.halting(pc, op, mem, stack, stateObject) } @@ -275,7 +283,7 @@ func (self *Debugger) BreakPoints() []int64 { return self.breakPoints } -func (d *Debugger) halting(pc int, op ethchain.OpCode, mem *ethchain.Memory, stack *ethchain.Stack, stateObject *ethchain.StateObject) bool { +func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { d.win.Root().Call("setInstruction", pc) d.win.Root().Call("clearMem") d.win.Root().Call("clearStack") diff --git a/ethereal/ext_app.go b/ethereal/ext_app.go index 17c342a1b..ac3e090f9 100644 --- a/ethereal/ext_app.go +++ b/ethereal/ext_app.go @@ -4,6 +4,7 @@ import ( "fmt" "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" ) @@ -16,8 +17,8 @@ type AppContainer interface { Engine() *qml.Engine NewBlock(*ethchain.Block) - ObjectChanged(*ethchain.StateObject) - StorageChanged(*ethchain.StorageState) + ObjectChanged(*ethstate.StateObject) + StorageChanged(*ethstate.StorageState) NewWatcher(chan bool) } @@ -108,9 +109,9 @@ out: app.container.NewBlock(block) } case object := <-app.changeChan: - if stateObject, ok := object.Resource.(*ethchain.StateObject); ok { + if stateObject, ok := object.Resource.(*ethstate.StateObject); ok { app.container.ObjectChanged(stateObject) - } else if storageObject, ok := object.Resource.(*ethchain.StorageState); ok { + } else if storageObject, ok := object.Resource.(*ethstate.StorageState); ok { app.container.StorageChanged(storageObject) } } diff --git a/ethereal/html_container.go b/ethereal/html_container.go index 04136f801..b00d3f78e 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -4,6 +4,7 @@ import ( "errors" "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" @@ -121,11 +122,11 @@ func (app *HtmlApplication) NewBlock(block *ethchain.Block) { app.webView.Call("onNewBlockCb", b) } -func (app *HtmlApplication) ObjectChanged(stateObject *ethchain.StateObject) { +func (app *HtmlApplication) ObjectChanged(stateObject *ethstate.StateObject) { app.webView.Call("onObjectChangeCb", ethpub.NewPStateObject(stateObject)) } -func (app *HtmlApplication) StorageChanged(storageObject *ethchain.StorageState) { +func (app *HtmlApplication) StorageChanged(storageObject *ethstate.StorageState) { app.webView.Call("onStorageChangeCb", ethpub.NewPStorageState(storageObject)) } diff --git a/ethereal/main.go b/ethereal/main.go index e1cd43ace..ebda552ee 100644 --- a/ethereal/main.go +++ b/ethereal/main.go @@ -10,7 +10,7 @@ import ( const ( ClientIdentifier = "Ethereal" - Version = "0.5.17" + Version = "0.6.0" ) func main() { diff --git a/ethereal/qml_container.go b/ethereal/qml_container.go index cb43a99bd..1b420ee21 100644 --- a/ethereal/qml_container.go +++ b/ethereal/qml_container.go @@ -3,6 +3,7 @@ package main import ( "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" "runtime" @@ -50,11 +51,11 @@ func (app *QmlApplication) NewBlock(block *ethchain.Block) { app.win.Call("onNewBlockCb", pblock) } -func (app *QmlApplication) ObjectChanged(stateObject *ethchain.StateObject) { +func (app *QmlApplication) ObjectChanged(stateObject *ethstate.StateObject) { app.win.Call("onObjectChangeCb", ethpub.NewPStateObject(stateObject)) } -func (app *QmlApplication) StorageChanged(storageObject *ethchain.StorageState) { +func (app *QmlApplication) StorageChanged(storageObject *ethstate.StorageState) { app.win.Call("onStorageChangeCb", ethpub.NewPStorageState(storageObject)) } diff --git a/ethereal/ui_lib.go b/ethereal/ui_lib.go index 997a3391a..6a62fa1df 100644 --- a/ethereal/ui_lib.go +++ b/ethereal/ui_lib.go @@ -78,8 +78,8 @@ func (ui *UiLib) AssetPath(p string) string { func (self *UiLib) StartDbWithContractAndData(contractHash, data string) { dbWindow := NewDebuggerWindow(self) object := self.eth.StateManager().CurrentState().GetStateObject(ethutil.Hex2Bytes(contractHash)) - if len(object.Script()) > 0 { - dbWindow.SetCode("0x" + ethutil.Bytes2Hex(object.Script())) + if len(object.Code) > 0 { + dbWindow.SetCode("0x" + ethutil.Bytes2Hex(object.Code)) } dbWindow.SetData("0x" + data) diff --git a/ethereum/main.go b/ethereum/main.go index b670cb495..217991074 100644 --- a/ethereum/main.go +++ b/ethereum/main.go @@ -9,7 +9,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.5.17" + Version = "0.6.0" ) var logger = ethlog.NewLogger("CLI") diff --git a/utils/vm_env.go b/utils/vm_env.go new file mode 100644 index 000000000..2c40dd7b8 --- /dev/null +++ b/utils/vm_env.go @@ -0,0 +1,33 @@ +package utils + +import ( + "github.com/ethereum/eth-go/ethchain" + "github.com/ethereum/eth-go/ethstate" + "math/big" +) + +type VMEnv struct { + state *ethstate.State + block *ethchain.Block + + transactor []byte + value *big.Int +} + +func NewEnv(state *ethstate.State, block *ethchain.Block, transactor []byte, value *big.Int) *VMEnv { + return &VMEnv{ + state: state, + block: block, + transactor: transactor, + value: value, + } +} + +func (self *VMEnv) Origin() []byte { return self.transactor } +func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number } +func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash } +func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase } +func (self *VMEnv) Time() int64 { return self.block.Time } +func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty } +func (self *VMEnv) Value() *big.Int { return self.value } +func (self *VMEnv) State() *ethstate.State { return self.state } From 2e39efbe7c487fd605de0f6915bcae789138fb7e Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 24 Jul 2014 12:34:48 +0200 Subject: [PATCH 03/11] New State object --- ethereum/repl/javascript_runtime.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ethereum/repl/javascript_runtime.go b/ethereum/repl/javascript_runtime.go index cd87f9868..41b6216d4 100644 --- a/ethereum/repl/javascript_runtime.go +++ b/ethereum/repl/javascript_runtime.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethpub" + "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/utils" "github.com/obscuren/otto" @@ -121,12 +122,12 @@ out: if _, ok := block.Resource.(*ethchain.Block); ok { } case object := <-self.changeChan: - if stateObject, ok := object.Resource.(*ethchain.StateObject); ok { + if stateObject, ok := object.Resource.(*ethstate.StateObject); ok { for _, cb := range self.objectCb[ethutil.Bytes2Hex(stateObject.Address())] { val, _ := self.vm.ToValue(ethpub.NewPStateObject(stateObject)) cb.Call(cb, val) } - } else if storageObject, ok := object.Resource.(*ethchain.StorageState); ok { + } else if storageObject, ok := object.Resource.(*ethstate.StorageState); ok { for _, cb := range self.objectCb[ethutil.Bytes2Hex(storageObject.StateAddress)+ethutil.Bytes2Hex(storageObject.Address)] { val, _ := self.vm.ToValue(ethpub.NewPStorageState(storageObject)) cb.Call(cb, val) From 82a84dca807c8966079253977329ef0800d20557 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 24 Jul 2014 14:16:43 +0200 Subject: [PATCH 04/11] Move to goroutine for faster startup time --- ethereal/gui.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ethereal/gui.go b/ethereal/gui.go index d76db2ade..df01cddda 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -143,10 +143,12 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { win := gui.createWindow(component) - gui.setInitialBlockChain() - gui.loadAddressBook() - gui.readPreviousTransactions() - gui.setPeerInfo() + go func() { + gui.setInitialBlockChain() + gui.loadAddressBook() + gui.readPreviousTransactions() + gui.setPeerInfo() + }() go gui.update() From 44da1801d87abff4803338d9bcfb25be93969dad Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 24 Jul 2014 14:34:22 +0200 Subject: [PATCH 05/11] Fixed strange issue where qml will crash first run after go install --- ethereal/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ethereal/main.go b/ethereal/main.go index ebda552ee..0f99be886 100644 --- a/ethereal/main.go +++ b/ethereal/main.go @@ -14,11 +14,10 @@ const ( ) func main() { - // Leave QT on top at ALL times. Qt Needs to be initialized from the main thread - qml.Init(nil) - runtime.GOMAXPROCS(runtime.NumCPU()) + qml.Init(nil) + var interrupted = false utils.RegisterInterrupt(func(os.Signal) { interrupted = true From 97004f7eb22ab30ba1acc5dd3ee2f17b5466d41a Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 25 Jul 2014 10:41:57 +0200 Subject: [PATCH 06/11] wip export --- ethereal/assets/qml/wallet.qml | 34 ++++++++++++++++++++++++++++++++-- ethereal/gui.go | 3 +++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index eef49824f..aadc90e3b 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -26,6 +26,22 @@ ApplicationWindow { shortcut: "Ctrl+o" onTriggered: openAppDialog.open() } + + MenuSeparator {} + + MenuItem { + text: "Import key" + shortcut: "Ctrl+i" + onTriggered: importDialog.open() + } + + MenuItem { + text: "Export keys" + shortcut: "Ctrl+e" + onTriggered: exportDialog.open() + } + + //MenuSeparator {} } Menu { @@ -375,9 +391,7 @@ ApplicationWindow { //ui.open(openAppDialog.fileUrl.toString()) //ui.openHtml(Qt.resolvedUrl(ui.assetPath("test.html"))) var path = openAppDialog.fileUrl.toString() - console.log(path) var ext = path.split('.').pop() - console.log(ext) if(ext == "html" || ext == "htm") { ui.openHtml(path) }else if(ext == "qml"){ @@ -386,6 +400,22 @@ ApplicationWindow { } } + FileDialog { + id: exportDialog + title: "Export keys" + onAccepted: { + } + } + + FileDialog { + id: importDialog + title: "Import key" + onAccepted: { + var path = this.fileUrl.toString() + ui.importKey(path) + } + } + statusBar: StatusBar { height: 30 RowLayout { diff --git a/ethereal/gui.go b/ethereal/gui.go index df01cddda..832200176 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -155,6 +155,9 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { return win, nil } +func (gui *Gui) ImportKey(filePath string) { +} + func (gui *Gui) showKeyImport(context *qml.Context) (*qml.Window, error) { context.SetVar("lib", gui) component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/first_run.qml")) From 5c9fd19105c572ea717a8bc04758dcf3e71af47e Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 00:17:23 +0200 Subject: [PATCH 07/11] A few start up optimisations --- ethereal/assets/qml/wallet.qml | 2 +- ethereal/gui.go | 4 ++-- ethereal/html_container.go | 13 +++++++------ ethereal/qml_container.go | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index aadc90e3b..50ff73060 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -690,7 +690,7 @@ ApplicationWindow { anchors.left: aboutIcon.right anchors.leftMargin: 10 font.pointSize: 12 - text: "

Ethereal


Development

Jeffrey Wilcke
Maran Hidskes
Viktor Trón
" + text: "

Ethereal - Adrastea


Development

Jeffrey Wilcke
Maran Hidskes
Viktor Trón
" } } diff --git a/ethereal/gui.go b/ethereal/gui.go index 832200176..573f68959 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -144,10 +144,10 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { win := gui.createWindow(component) go func() { - gui.setInitialBlockChain() + go gui.setInitialBlockChain() gui.loadAddressBook() - gui.readPreviousTransactions() gui.setPeerInfo() + gui.readPreviousTransactions() }() go gui.update() 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) diff --git a/ethereal/qml_container.go b/ethereal/qml_container.go index 1b420ee21..53ff13c2f 100644 --- a/ethereal/qml_container.go +++ b/ethereal/qml_container.go @@ -25,7 +25,7 @@ func (app *QmlApplication) Create() error { path := string(app.path) // For some reason for windows we get /c:/path/to/something, windows doesn't like the first slash but is fine with the others so we are removing it - if string(app.path[0]) == "/" && runtime.GOOS == "windows" { + if app.path[0] == '/' && runtime.GOOS == "windows" { path = app.path[1:] } From 719b7784f38a8ee6158d4d5a9230a98041f140b1 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 00:30:57 +0200 Subject: [PATCH 08/11] Renamed to balance --- ethereal/debugger.go | 24 ++++++------------------ ethereal/gui.go | 17 +++++++++-------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/ethereal/debugger.go b/ethereal/debugger.go index 096387405..1cf5e0b66 100644 --- a/ethereal/debugger.go +++ b/ethereal/debugger.go @@ -2,15 +2,16 @@ package main import ( "fmt" + "math/big" + "strconv" + "strings" + "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethvm" "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" - "math/big" - "strconv" - "strings" ) type DebuggerWindow struct { @@ -134,26 +135,13 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data state := self.lib.eth.StateManager().TransState() account := self.lib.eth.StateManager().TransState().GetAccount(keyPair.Address()) contract := ethstate.NewStateObject([]byte{0}) - contract.Amount = value + contract.Balance = value self.SetAsm(script) - callerClosure := ethvm.NewClosure(account, contract, script, gas, gasPrice) - block := self.lib.eth.BlockChain().CurrentBlock - /* - vm := ethchain.NewVm(state, self.lib.eth.StateManager(), ethchain.RuntimeVars{ - Block: block, - Origin: account.Address(), - BlockNumber: block.Number, - PrevHash: block.PrevHash, - Coinbase: block.Coinbase, - Time: block.Time, - Diff: block.Difficulty, - Value: ethutil.Big(valueStr), - }) - */ + callerClosure := ethvm.NewClosure(account, contract, script, gas, gasPrice) env := utils.NewEnv(state, block, account.Address(), value) vm := ethvm.New(env) vm.Verbose = true diff --git a/ethereal/gui.go b/ethereal/gui.go index 573f68959..31d4248b2 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -3,6 +3,11 @@ package main import ( "bytes" "fmt" + "math/big" + "strconv" + "strings" + "time" + "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethdb" @@ -13,10 +18,6 @@ import ( "github.com/ethereum/eth-go/ethwire" "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" - "math/big" - "strconv" - "strings" - "time" ) var logger = ethlog.NewLogger("GUI") @@ -313,7 +314,7 @@ func (gui *Gui) update() { state := gui.eth.StateManager().TransState() unconfirmedFunds := new(big.Int) - gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Amount))) + gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance))) gui.getObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate()) lastBlockLabel := gui.getObjectByName("lastBlockLabel") @@ -324,7 +325,7 @@ func (gui *Gui) update() { block := b.Resource.(*ethchain.Block) gui.processBlock(block, false) if bytes.Compare(block.Coinbase, gui.address()) == 0 { - gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Amount, nil) + gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Balance, nil) } case txMsg := <-txChan: @@ -345,7 +346,7 @@ func (gui *Gui) update() { unconfirmedFunds.Add(unconfirmedFunds, tx.Value) } - gui.setWalletValue(object.Amount, unconfirmedFunds) + gui.setWalletValue(object.Balance, unconfirmedFunds) } else { object := state.GetAccount(gui.address()) if bytes.Compare(tx.Sender(), gui.address()) == 0 { @@ -354,7 +355,7 @@ func (gui *Gui) update() { object.AddAmount(tx.Value) } - gui.setWalletValue(object.Amount, nil) + gui.setWalletValue(object.Balance, nil) state.UpdateStateObject(object) } From 23f83f53ccd71e5aefa9faf93e3527a589d1e487 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 01:05:40 +0200 Subject: [PATCH 09/11] Upped version number --- ethereal/main.go | 7 ++++--- ethereum/main.go | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ethereal/main.go b/ethereal/main.go index 0f99be886..04a04536d 100644 --- a/ethereal/main.go +++ b/ethereal/main.go @@ -1,16 +1,17 @@ package main import ( + "os" + "runtime" + "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" - "os" - "runtime" ) const ( ClientIdentifier = "Ethereal" - Version = "0.6.0" + Version = "0.6.1" ) func main() { diff --git a/ethereum/main.go b/ethereum/main.go index 217991074..9ece8133d 100644 --- a/ethereum/main.go +++ b/ethereum/main.go @@ -1,15 +1,16 @@ package main import ( + "runtime" + "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/utils" - "runtime" ) const ( ClientIdentifier = "Ethereum(G)" - Version = "0.6.0" + Version = "0.6.1" ) var logger = ethlog.NewLogger("CLI") From 5501679642321f3ad17b6dd7f25e3c090c1405df Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 15:33:42 +0200 Subject: [PATCH 10/11] Updated README to include Cpt. Obv. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 790ee541e..e22bfc4ec 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ Ethereum [![Build Status](https://travis-ci.org/ethereum/go-ethereum.png?branch=master)](https://travis-ci.org/ethereum/go-ethereum) +Master [![Build +Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-master-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-master-docker/builds/-1) + +Develop [![Build +Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-develop-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-develop-docker/builds/-1) + Ethereum Go Client © 2014 Jeffrey Wilcke. Current state: Proof of Concept 0.6.0. From 834803f1e8ce45040045359185c8b8d75f63de2c Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 15:34:36 +0200 Subject: [PATCH 11/11] Update --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index e22bfc4ec..186c979bc 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,8 @@ Ethereum ======== -[![Build Status](https://travis-ci.org/ethereum/go-ethereum.png?branch=master)](https://travis-ci.org/ethereum/go-ethereum) - Master [![Build -Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-master-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-master-docker/builds/-1) - -Develop [![Build +Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-master-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-master-docker/builds/-1) Develop [![Build Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-develop-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-develop-docker/builds/-1) Ethereum Go Client © 2014 Jeffrey Wilcke.