aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mist')
-rw-r--r--cmd/mist/assets/qml/views/miner.qml2
-rw-r--r--cmd/mist/assets/qml/views/wallet.qml12
-rw-r--r--cmd/mist/bindings.go8
-rw-r--r--cmd/mist/debugger.go19
-rw-r--r--cmd/mist/ext_app.go14
-rw-r--r--cmd/mist/gui.go16
-rw-r--r--cmd/mist/html_container.go3
-rw-r--r--cmd/mist/main.go2
-rw-r--r--cmd/mist/qml_container.go3
-rw-r--r--cmd/mist/ui_lib.go13
10 files changed, 51 insertions, 41 deletions
diff --git a/cmd/mist/assets/qml/views/miner.qml b/cmd/mist/assets/qml/views/miner.qml
index 2d59bb3a4..e0182649f 100644
--- a/cmd/mist/assets/qml/views/miner.qml
+++ b/cmd/mist/assets/qml/views/miner.qml
@@ -119,12 +119,14 @@ Rectangle {
}
}
Component.onCompleted: {
+ /*
// XXX Temp. replace with above eventually
var tmpItems = ["JEVCoin", "Some coin", "Other coin", "Etc coin"];
var address = "e6716f9544a56c530d868e4bfbacb172315bdead";
for (var i = 0; i < tmpItems.length; i++) {
mergedMiningModel.append({checked: false, name: tmpItems[i], address: address, id: 0, itemId: i});
}
+ */
}
}
}
diff --git a/cmd/mist/assets/qml/views/wallet.qml b/cmd/mist/assets/qml/views/wallet.qml
index a57e7869a..9ffb1024d 100644
--- a/cmd/mist/assets/qml/views/wallet.qml
+++ b/cmd/mist/assets/qml/views/wallet.qml
@@ -16,7 +16,13 @@ Rectangle {
anchors.fill: parent
function onReady() {
- menuItem.secondaryTitle = eth.numberToHuman(eth.balanceAt(eth.key().address))
+ setBalance()
+ }
+
+ function setBalance() {
+ balance.text = "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address))
+ if(menuItem)
+ menuItem.secondaryTitle = eth.numberToHuman(eth.balanceAt(eth.key().address))
}
ListModel {
@@ -39,7 +45,6 @@ Rectangle {
Text {
id: balance
- text: "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address))
font.pixelSize: 24
anchors {
horizontalCenter: parent.horizontalCenter
@@ -126,7 +131,6 @@ Rectangle {
var value = txValue.text + denomModel.get(valueDenom.currentIndex).zeros;
var gasPrice = "10000000000000"
var res = eth.transact({from: eth.key().privateKey, to: txTo.text, value: value, gas: "500", gasPrice: gasPrice})
- console.log(res)
}
}
}
@@ -158,6 +162,8 @@ Rectangle {
}
function addTxs(messages) {
+ setBalance()
+
for(var i = 0; i < messages.length; i++) {
var message = messages.get(i);
var to = eth.lookupName(message.to);
diff --git a/cmd/mist/bindings.go b/cmd/mist/bindings.go
index eb78c3acc..6dbcc3f1d 100644
--- a/cmd/mist/bindings.go
+++ b/cmd/mist/bindings.go
@@ -21,11 +21,11 @@ import (
"encoding/json"
"os"
"strconv"
- "github.com/ethereum/go-ethereum/chain/types"
+
"github.com/ethereum/go-ethereum/cmd/utils"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/xeth"
)
type plugin struct {
@@ -45,12 +45,12 @@ func (gui *Gui) LogPrint(level logger.LogLevel, msg string) {
}
*/
}
-func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (*xeth.JSReceipt, error) {
+func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (string, error) {
var data string
if len(recipient) == 0 {
code, err := ethutil.Compile(d, false)
if err != nil {
- return nil, err
+ return "", err
}
data = ethutil.Bytes2Hex(code)
} else {
diff --git a/cmd/mist/debugger.go b/cmd/mist/debugger.go
index a2aae6f0b..ca3ff5af2 100644
--- a/cmd/mist/debugger.go
+++ b/cmd/mist/debugger.go
@@ -24,8 +24,8 @@ import (
"strings"
"unicode"
- "github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/cmd/utils"
+ "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
@@ -40,7 +40,7 @@ type DebuggerWindow struct {
vm *vm.DebugVm
Db *Debugger
- state *state.State
+ state *state.StateDB
}
func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
@@ -81,7 +81,7 @@ func (self *DebuggerWindow) SetData(data string) {
func (self *DebuggerWindow) SetAsm(data []byte) {
self.win.Root().Call("clearAsm")
- dis := chain.Disassemble(data)
+ dis := core.Disassemble(data)
for _, str := range dis {
self.win.Root().Call("setAsm", str)
}
@@ -144,24 +144,21 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
statedb := self.lib.eth.BlockManager().TransState()
account := self.lib.eth.BlockManager().TransState().GetAccount(keyPair.Address())
contract := statedb.NewStateObject([]byte{0})
+ contract.SetCode(script)
contract.SetBalance(value)
self.SetAsm(script)
block := self.lib.eth.ChainManager().CurrentBlock
- callerClosure := vm.NewClosure(&state.Message{}, account, contract, script, gas, gasPrice)
env := utils.NewEnv(statedb, block, account.Address(), value)
- evm := vm.NewDebugVm(env)
- evm.Dbg = self.Db
- self.vm = evm
- self.Db.done = false
self.Logf("callsize %d", len(script))
go func() {
- ret, g, err := callerClosure.Call(evm, data)
- tot := new(big.Int).Mul(g, gasPrice)
- self.Logf("gas usage %v total price = %v (%v)", g, tot, ethutil.CurrencyToString(tot))
+ ret, err := env.Call(account, contract.Address(), data, gas, gasPrice, ethutil.Big0)
+ //ret, g, err := callerClosure.Call(evm, data)
+ tot := new(big.Int).Mul(env.Gas, gasPrice)
+ self.Logf("gas usage %v total price = %v (%v)", env.Gas, tot, ethutil.CurrencyToString(tot))
if err != nil {
self.Logln("exited with errors:", err)
} else {
diff --git a/cmd/mist/ext_app.go b/cmd/mist/ext_app.go
index 22fa4bfaf..33c420a7a 100644
--- a/cmd/mist/ext_app.go
+++ b/cmd/mist/ext_app.go
@@ -20,8 +20,8 @@ package main
import (
"encoding/json"
- "github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/chain/types"
+ "github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
@@ -45,12 +45,12 @@ type AppContainer interface {
type ExtApplication struct {
*xeth.JSXEth
- eth chain.EthManager
+ eth core.EthManager
events event.Subscription
watcherQuitChan chan bool
- filters map[string]*chain.Filter
+ filters map[string]*core.Filter
container AppContainer
lib *UiLib
@@ -61,7 +61,7 @@ func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication {
JSXEth: xeth.NewJSXEth(lib.eth),
eth: lib.eth,
watcherQuitChan: make(chan bool),
- filters: make(map[string]*chain.Filter),
+ filters: make(map[string]*core.Filter),
container: container,
lib: lib,
}
@@ -81,7 +81,7 @@ func (app *ExtApplication) run() {
// Subscribe to events
mux := app.lib.eth.EventMux()
- app.events = mux.Subscribe(chain.NewBlockEvent{}, state.Messages(nil))
+ app.events = mux.Subscribe(core.NewBlockEvent{}, state.Messages(nil))
// Call the main loop
go app.mainLoop()
@@ -107,7 +107,7 @@ func (app *ExtApplication) stop() {
func (app *ExtApplication) mainLoop() {
for ev := range app.events.Chan() {
switch ev := ev.(type) {
- case chain.NewBlockEvent:
+ case core.NewBlockEvent:
app.container.NewBlock(ev.Block)
case state.Messages:
diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go
index 61b66cce3..e58e349d1 100644
--- a/cmd/mist/gui.go
+++ b/cmd/mist/gui.go
@@ -31,8 +31,8 @@ import (
"time"
"github.com/ethereum/go-ethereum"
- "github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/chain/types"
+ "github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
@@ -413,9 +413,9 @@ func (gui *Gui) update() {
events := gui.eth.EventMux().Subscribe(
eth.ChainSyncEvent{},
eth.PeerListEvent{},
- chain.NewBlockEvent{},
- chain.TxPreEvent{},
- chain.TxPostEvent{},
+ core.NewBlockEvent{},
+ core.TxPreEvent{},
+ core.TxPostEvent{},
)
// nameReg := gui.pipe.World().Config().Get("NameReg")
@@ -430,13 +430,13 @@ func (gui *Gui) update() {
return
}
switch ev := ev.(type) {
- case chain.NewBlockEvent:
+ case core.NewBlockEvent:
gui.processBlock(ev.Block, false)
if bytes.Compare(ev.Block.Coinbase, gui.address()) == 0 {
gui.setWalletValue(gui.eth.BlockManager().CurrentState().GetAccount(gui.address()).Balance(), nil)
}
- case chain.TxPreEvent:
+ case core.TxPreEvent:
tx := ev.Tx
object := state.GetAccount(gui.address())
@@ -449,7 +449,7 @@ func (gui *Gui) update() {
gui.setWalletValue(object.Balance(), unconfirmedFunds)
gui.insertTransaction("pre", tx)
- case chain.TxPostEvent:
+ case core.TxPostEvent:
tx := ev.Tx
object := state.GetAccount(gui.address())
diff --git a/cmd/mist/html_container.go b/cmd/mist/html_container.go
index 4c6609a95..b3fc219fa 100644
--- a/cmd/mist/html_container.go
+++ b/cmd/mist/html_container.go
@@ -26,7 +26,8 @@ import (
"os"
"path"
"path/filepath"
- "github.com/ethereum/go-ethereum/chain/types"
+
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
diff --git a/cmd/mist/main.go b/cmd/mist/main.go
index bc05d4f3d..8c46de6d9 100644
--- a/cmd/mist/main.go
+++ b/cmd/mist/main.go
@@ -31,7 +31,7 @@ import (
const (
ClientIdentifier = "Mist"
- Version = "0.7.5"
+ Version = "0.7.7"
)
var ethereum *eth.Ethereum
diff --git a/cmd/mist/qml_container.go b/cmd/mist/qml_container.go
index b5986c16e..a0a46f9b1 100644
--- a/cmd/mist/qml_container.go
+++ b/cmd/mist/qml_container.go
@@ -20,7 +20,8 @@ package main
import (
"fmt"
"runtime"
- "github.com/ethereum/go-ethereum/chain/types"
+
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go
index 01352f192..2b5e56646 100644
--- a/cmd/mist/ui_lib.go
+++ b/cmd/mist/ui_lib.go
@@ -25,8 +25,8 @@ import (
"strings"
"github.com/ethereum/go-ethereum"
- "github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/chain/types"
+ "github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
@@ -128,7 +128,10 @@ func (self *UiLib) PastPeers() *ethutil.List {
func (self *UiLib) ImportTx(rlpTx string) {
tx := types.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
- self.eth.TxPool().QueueTransaction(tx)
+ err := self.eth.TxPool().Add(tx)
+ if err != nil {
+ guilogger.Infoln("import tx failed ", err)
+ }
}
func (self *UiLib) EvalJavascriptFile(path string) {
@@ -228,7 +231,7 @@ func (self *UiLib) NewFilter(object map[string]interface{}) (id int) {
}
func (self *UiLib) NewFilterString(typ string) (id int) {
- filter := chain.NewFilter(self.eth)
+ filter := core.NewFilter(self.eth)
filter.BlockCallback = func(block *types.Block) {
if self.win != nil && self.win.Root() != nil {
self.win.Root().Call("invokeFilterCallback", "{}", id)
@@ -306,7 +309,7 @@ func mapToTxParams(object map[string]interface{}) map[string]string {
return conv
}
-func (self *UiLib) Transact(params map[string]interface{}) (*xeth.JSReceipt, error) {
+func (self *UiLib) Transact(params map[string]interface{}) (string, error) {
object := mapToTxParams(params)
return self.JSXEth.Transact(