New VM
This commit is contained in:
+3
-4
@@ -20,7 +20,7 @@ type DebuggerWindow struct {
|
||||
engine *qml.Engine
|
||||
lib *UiLib
|
||||
|
||||
vm *ethvm.Vm
|
||||
vm *ethvm.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.Vm{}}
|
||||
w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: ðvm.DebugVm{}}
|
||||
w.Db = NewDebugger(w)
|
||||
|
||||
return w
|
||||
@@ -135,8 +135,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
|
||||
|
||||
callerClosure := ethvm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice)
|
||||
env := utils.NewEnv(state, block, account.Address(), value)
|
||||
vm := ethvm.New(env)
|
||||
vm.Verbose = true
|
||||
vm := ethvm.NewDebugVm(env)
|
||||
vm.Dbg = self.Db
|
||||
|
||||
self.vm = vm
|
||||
|
||||
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/user"
|
||||
"path"
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
|
||||
"bitbucket.org/kardianos/osext"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethvm"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -35,6 +37,7 @@ var (
|
||||
ConfigFile string
|
||||
DebugFile string
|
||||
LogLevel int
|
||||
VmType int
|
||||
)
|
||||
|
||||
// flags specific to gui client
|
||||
@@ -78,6 +81,7 @@ func Init() {
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
|
||||
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
|
||||
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
|
||||
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)")
|
||||
@@ -101,4 +105,8 @@ func Init() {
|
||||
flag.StringVar(&AssetPath, "asset_path", defaultAssetPath(), "absolute path to GUI assets directory")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if VmType >= int(ethvm.MaxVmTy) {
|
||||
log.Fatal("Invalid VM type ", VmType)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ func run() error {
|
||||
// precedence: code-internal flag default < config file < environment variables < command line
|
||||
Init() // parsing command line
|
||||
|
||||
config := utils.InitConfig(ConfigFile, Datadir, "ETH")
|
||||
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
|
||||
|
||||
utils.InitDataDir(Datadir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user