diff --git a/mist/debugger.go b/mist/debugger.go index f81cddb1b..ebe18c78f 100644 --- a/mist/debugger.go +++ b/mist/debugger.go @@ -127,7 +127,7 @@ 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.Balance = value + contract.SetBalance(value) self.SetAsm(script) @@ -135,14 +135,14 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data callerClosure := vm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice) env := utils.NewEnv(state, block, account.Address(), value) - vm := vm.NewDebugVm(env) - vm.Dbg = self.Db + evm := vm.NewDebugVm(env) + evm.Dbg = self.Db - self.vm = vm + self.vm = evm self.Db.done = false self.Logf("callsize %d", len(script)) go func() { - ret, g, err := callerClosure.Call(vm, data) + 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)) if err != nil { diff --git a/mist/gui.go b/mist/gui.go index 1bb8a1934..2c19680c0 100644 --- a/mist/gui.go +++ b/mist/gui.go @@ -382,7 +382,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()).Balance))) + gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance()))) lastBlockLabel := gui.getObjectByName("lastBlockLabel") miningLabel := gui.getObjectByName("miningLabel") @@ -410,7 +410,7 @@ func (gui *Gui) update() { case ethchain.NewBlockEvent: gui.processBlock(ev.Block, false) if bytes.Compare(ev.Block.Coinbase, gui.address()) == 0 { - gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Balance, nil) + gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Balance(), nil) } case ethchain.TxEvent: @@ -424,7 +424,7 @@ func (gui *Gui) update() { unconfirmedFunds.Add(unconfirmedFunds, tx.Value) } - gui.setWalletValue(object.Balance, unconfirmedFunds) + gui.setWalletValue(object.Balance(), unconfirmedFunds) gui.insertTransaction("pre", tx) @@ -442,7 +442,7 @@ func (gui *Gui) update() { gui.txDb.Put(tx.Hash(), tx.RlpEncode()) } - gui.setWalletValue(object.Balance, nil) + gui.setWalletValue(object.Balance(), nil) state.UpdateStateObject(object) } diff --git a/mist/main.go b/mist/main.go index 54c4d4501..116bd78fd 100644 --- a/mist/main.go +++ b/mist/main.go @@ -12,7 +12,7 @@ import ( const ( ClientIdentifier = "Mist" - Version = "0.7.0" + Version = "0.7.1" ) var ethereum *eth.Ethereum diff --git a/utils/vm_env.go b/utils/vm_env.go index 585dda9cd..21341ab04 100644 --- a/utils/vm_env.go +++ b/utils/vm_env.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethstate" + "github.com/ethereum/eth-go/vm" ) type VMEnv struct { @@ -34,3 +35,6 @@ func (self *VMEnv) BlockHash() []byte { return self.block.Hash() } func (self *VMEnv) Value() *big.Int { return self.value } func (self *VMEnv) State() *ethstate.State { return self.state } func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit } +func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error { + return vm.Transfer(from, to, amount) +}