mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Reflect changes to the eth/vm
This commit is contained in:
parent
6956b5104f
commit
82a2e4fe28
@ -9,7 +9,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/ethereum/eth-go/ethlog"
|
"github.com/ethereum/eth-go/ethlog"
|
||||||
"github.com/ethereum/eth-go/ethvm"
|
"github.com/ethereum/eth-go/vm"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -95,7 +95,7 @@ func Init() {
|
|||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if VmType >= int(ethvm.MaxVmTy) {
|
if VmType >= int(vm.MaxVmTy) {
|
||||||
log.Fatal("Invalid VM type ", VmType)
|
log.Fatal("Invalid VM type ", VmType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/ethereum/eth-go/ethchain"
|
"github.com/ethereum/eth-go/ethchain"
|
||||||
"github.com/ethereum/eth-go/ethstate"
|
"github.com/ethereum/eth-go/ethstate"
|
||||||
"github.com/ethereum/eth-go/ethutil"
|
"github.com/ethereum/eth-go/ethutil"
|
||||||
"github.com/ethereum/eth-go/ethvm"
|
"github.com/ethereum/eth-go/vm"
|
||||||
"github.com/ethereum/go-ethereum/utils"
|
"github.com/ethereum/go-ethereum/utils"
|
||||||
"gopkg.in/qml.v1"
|
"gopkg.in/qml.v1"
|
||||||
)
|
)
|
||||||
@ -20,7 +20,7 @@ type DebuggerWindow struct {
|
|||||||
engine *qml.Engine
|
engine *qml.Engine
|
||||||
lib *UiLib
|
lib *UiLib
|
||||||
|
|
||||||
vm *ethvm.DebugVm
|
vm *vm.DebugVm
|
||||||
Db *Debugger
|
Db *Debugger
|
||||||
|
|
||||||
state *ethstate.State
|
state *ethstate.State
|
||||||
@ -37,7 +37,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
|
|||||||
|
|
||||||
win := component.CreateWindow(nil)
|
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)
|
w.Db = NewDebugger(w)
|
||||||
|
|
||||||
return w
|
return w
|
||||||
@ -133,9 +133,9 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
|
|||||||
|
|
||||||
block := self.lib.eth.BlockChain().CurrentBlock
|
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)
|
env := utils.NewEnv(state, block, account.Address(), value)
|
||||||
vm := ethvm.NewDebugVm(env)
|
vm := vm.NewDebugVm(env)
|
||||||
vm.Dbg = self.Db
|
vm.Dbg = self.Db
|
||||||
|
|
||||||
self.vm = vm
|
self.vm = vm
|
||||||
@ -250,13 +250,13 @@ type storeVal struct {
|
|||||||
Key, Value string
|
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)
|
self.main.Logln("break on instr:", pc)
|
||||||
|
|
||||||
return self.halting(pc, op, mem, stack, stateObject)
|
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)
|
return self.halting(pc, op, mem, stack, stateObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ func (self *Debugger) BreakPoints() []int64 {
|
|||||||
return self.breakPoints
|
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("setInstruction", pc)
|
||||||
d.win.Root().Call("clearMem")
|
d.win.Root().Call("clearMem")
|
||||||
d.win.Root().Call("clearStack")
|
d.win.Root().Call("clearStack")
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"bitbucket.org/kardianos/osext"
|
"bitbucket.org/kardianos/osext"
|
||||||
"github.com/ethereum/eth-go/ethlog"
|
"github.com/ethereum/eth-go/ethlog"
|
||||||
"github.com/ethereum/eth-go/ethvm"
|
"github.com/ethereum/eth-go/vm"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -106,7 +106,7 @@ func Init() {
|
|||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if VmType >= int(ethvm.MaxVmTy) {
|
if VmType >= int(vm.MaxVmTy) {
|
||||||
log.Fatal("Invalid VM type ", VmType)
|
log.Fatal("Invalid VM type ", VmType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user