Merge branch 'develop' into poc8

This commit is contained in:
obscuren
2014-12-19 00:19:02 +01:00
7 changed files with 13 additions and 49 deletions

View File

@ -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 {

View File

@ -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) {