From 82a2e4fe283d15eaacc554544131bd6669210f79 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 18 Oct 2014 13:31:04 +0200 Subject: [PATCH] Reflect changes to the eth/vm --- ethereum/flags.go | 4 ++-- mist/debugger.go | 16 ++++++++-------- mist/flags.go | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ethereum/flags.go b/ethereum/flags.go index 7924dd7bf4..af7b3365ac 100644 --- a/ethereum/flags.go +++ b/ethereum/flags.go @@ -9,7 +9,7 @@ import ( "path" "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/eth-go/ethvm" + "github.com/ethereum/eth-go/vm" ) var ( @@ -95,7 +95,7 @@ func Init() { flag.Parse() - if VmType >= int(ethvm.MaxVmTy) { + if VmType >= int(vm.MaxVmTy) { log.Fatal("Invalid VM type ", VmType) } diff --git a/mist/debugger.go b/mist/debugger.go index 241635ebed..f364a487e8 100644 --- a/mist/debugger.go +++ b/mist/debugger.go @@ -10,7 +10,7 @@ import ( "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/eth-go/vm" "github.com/ethereum/go-ethereum/utils" "gopkg.in/qml.v1" ) @@ -20,7 +20,7 @@ type DebuggerWindow struct { engine *qml.Engine lib *UiLib - vm *ethvm.DebugVm + vm *vm.DebugVm Db *Debugger state *ethstate.State @@ -37,7 +37,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow { win := component.CreateWindow(nil) - w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: ðvm.DebugVm{}} + w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: &vm.DebugVm{}} w.Db = NewDebugger(w) return w @@ -133,9 +133,9 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data block := self.lib.eth.BlockChain().CurrentBlock - callerClosure := ethvm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice) + callerClosure := vm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice) env := utils.NewEnv(state, block, account.Address(), value) - vm := ethvm.NewDebugVm(env) + vm := vm.NewDebugVm(env) vm.Dbg = self.Db self.vm = vm @@ -250,13 +250,13 @@ type storeVal struct { Key, Value string } -func (self *Debugger) BreakHook(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { +func (self *Debugger) BreakHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.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 ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { +func (self *Debugger) StepHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *ethstate.StateObject) bool { return self.halting(pc, op, mem, stack, stateObject) } @@ -268,7 +268,7 @@ func (self *Debugger) BreakPoints() []int64 { return self.breakPoints } -func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool { +func (d *Debugger) halting(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *ethstate.StateObject) bool { d.win.Root().Call("setInstruction", pc) d.win.Root().Call("clearMem") d.win.Root().Call("clearStack") diff --git a/mist/flags.go b/mist/flags.go index 5cf34c7407..68accf1bc2 100644 --- a/mist/flags.go +++ b/mist/flags.go @@ -12,7 +12,7 @@ import ( "bitbucket.org/kardianos/osext" "github.com/ethereum/eth-go/ethlog" - "github.com/ethereum/eth-go/ethvm" + "github.com/ethereum/eth-go/vm" ) var ( @@ -106,7 +106,7 @@ func Init() { flag.Parse() - if VmType >= int(ethvm.MaxVmTy) { + if VmType >= int(vm.MaxVmTy) { log.Fatal("Invalid VM type ", VmType) } }