core: Added EVM configuration options
The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
This commit is contained in:
committed by
Jeffrey Wilcke
parent
342ae7ce7d
commit
14013372ae
@ -28,8 +28,13 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
)
|
||||
|
||||
func init() {
|
||||
glog.SetV(0)
|
||||
}
|
||||
|
||||
func checkLogs(tlog []Log, logs vm.Logs) error {
|
||||
|
||||
if len(tlog) != len(logs) {
|
||||
@ -144,7 +149,7 @@ type Env struct {
|
||||
|
||||
vmTest bool
|
||||
|
||||
evm *vm.Vm
|
||||
evm *vm.EVM
|
||||
}
|
||||
|
||||
func NewEnv(state *state.StateDB) *Env {
|
||||
@ -174,12 +179,12 @@ func NewEnvFromMap(state *state.StateDB, envValues map[string]string, exeValues
|
||||
env.gasLimit = common.Big(envValues["currentGasLimit"])
|
||||
env.Gas = new(big.Int)
|
||||
|
||||
env.evm = vm.EVM(env)
|
||||
env.evm = vm.New(env, nil)
|
||||
|
||||
return env
|
||||
}
|
||||
|
||||
func (self *Env) Vm() *vm.Vm { return self.evm }
|
||||
func (self *Env) Vm() vm.Vm { return self.evm }
|
||||
func (self *Env) Origin() common.Address { return self.origin }
|
||||
func (self *Env) BlockNumber() *big.Int { return self.number }
|
||||
func (self *Env) Coinbase() common.Address { return self.coinbase }
|
||||
|
Reference in New Issue
Block a user