diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-19 07:18:52 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-19 07:18:52 +0800 |
commit | 59ef6e36931c980ba15babfb3680514635faebf6 (patch) | |
tree | 4c0b9b36a6419eb790171c82b86b19ecc1192d01 /core | |
parent | a7f4ade7114ee962110cb7c140e7ce7bd3f6664f (diff) | |
download | go-tangerine-59ef6e36931c980ba15babfb3680514635faebf6.tar.gz go-tangerine-59ef6e36931c980ba15babfb3680514635faebf6.tar.zst go-tangerine-59ef6e36931c980ba15babfb3680514635faebf6.zip |
Cleaned up objects
Diffstat (limited to 'core')
-rw-r--r-- | core/execution.go | 6 | ||||
-rw-r--r-- | core/vm_env.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/execution.go b/core/execution.go index 827e1ee0e..cd98746c4 100644 --- a/core/execution.go +++ b/core/execution.go @@ -16,8 +16,10 @@ type Execution struct { SkipTransfer bool } -func NewExecution(vm vm.VirtualMachine, address, input []byte, gas, gasPrice, value *big.Int) *Execution { - return &Execution{vm: vm, address: address, input: input, Gas: gas, price: gasPrice, value: value} +func NewExecution(env vm.Environment, address, input []byte, gas, gasPrice, value *big.Int) *Execution { + evm := vm.New(env, vm.DebugVmTy) + + return &Execution{vm: evm, address: address, input: input, Gas: gas, price: gasPrice, value: value} } func (self *Execution) Addr() []byte { diff --git a/core/vm_env.go b/core/vm_env.go index 0b6744972..ad63ecf9c 100644 --- a/core/vm_env.go +++ b/core/vm_env.go @@ -43,9 +43,7 @@ func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error { } func (self *VMEnv) vm(addr, data []byte, gas, price, value *big.Int) *Execution { - evm := vm.New(self, vm.DebugVmTy) - - return NewExecution(evm, addr, data, gas, price, value) + return NewExecution(self, addr, data, gas, price, value) } func (self *VMEnv) Call(me vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) { |