aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm_env.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm_env.go')
-rw-r--r--core/vm_env.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/vm_env.go b/core/vm_env.go
index 7b9a1a0f9..0fab4a090 100644
--- a/core/vm_env.go
+++ b/core/vm_env.go
@@ -51,10 +51,11 @@ type VMEnv struct {
getHashFn func(uint64) common.Hash
// structured logging
logs []vm.StructLog
+ evm *vm.Vm
}
func NewEnv(state *state.StateDB, chain *BlockChain, msg Message, header *types.Header) *VMEnv {
- return &VMEnv{
+ env := &VMEnv{
chain: chain,
state: state,
header: header,
@@ -62,8 +63,11 @@ func NewEnv(state *state.StateDB, chain *BlockChain, msg Message, header *types.
typ: vm.StdVmTy,
getHashFn: GetHashFn(header.ParentHash, chain),
}
+ env.evm = vm.EVM(env)
+ return env
}
+func (self *VMEnv) Vm() *vm.Vm { return self.evm }
func (self *VMEnv) Origin() common.Address { f, _ := self.msg.From(); return f }
func (self *VMEnv) BlockNumber() *big.Int { return self.header.Number }
func (self *VMEnv) Coinbase() common.Address { return self.header.Coinbase }