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
@ -42,7 +42,7 @@ type Env struct {
|
||||
|
||||
getHashFn func(uint64) common.Hash
|
||||
|
||||
evm *vm.Vm
|
||||
evm *vm.EVM
|
||||
}
|
||||
|
||||
// NewEnv returns a new vm.Environment
|
||||
@ -56,7 +56,15 @@ func NewEnv(cfg *Config, state *state.StateDB) vm.Environment {
|
||||
difficulty: cfg.Difficulty,
|
||||
gasLimit: cfg.GasLimit,
|
||||
}
|
||||
env.evm = vm.EVM(env)
|
||||
env.evm = vm.New(env, &vm.Config{
|
||||
Debug: cfg.Debug,
|
||||
EnableJit: !cfg.DisableJit,
|
||||
ForceJit: !cfg.DisableJit,
|
||||
|
||||
Logger: vm.LogConfig{
|
||||
Collector: env,
|
||||
},
|
||||
})
|
||||
|
||||
return env
|
||||
}
|
||||
@ -69,7 +77,7 @@ func (self *Env) AddStructLog(log vm.StructLog) {
|
||||
self.logs = append(self.logs, log)
|
||||
}
|
||||
|
||||
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