From 75cd9cd2de315f8680ff6a382e9b3bd48e17ecad Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 12 Jan 2015 14:40:40 +0100 Subject: updated tests --- core/execution.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'core') diff --git a/core/execution.go b/core/execution.go index 43f4b58fb..1057089f1 100644 --- a/core/execution.go +++ b/core/execution.go @@ -13,7 +13,6 @@ type Execution struct { env vm.Environment address, input []byte Gas, price, value *big.Int - SkipTransfer bool } func NewExecution(env vm.Environment, address, input []byte, gas, gasPrice, value *big.Int) *Execution { @@ -43,14 +42,12 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret from, to := env.State().GetStateObject(caller.Address()), env.State().GetOrNewStateObject(self.address) // Skipping transfer is used on testing for the initial call - if !self.SkipTransfer { - err = env.Transfer(from, to, self.value) - if err != nil { - caller.ReturnGas(self.Gas, self.price) - - err = fmt.Errorf("Insufficient funds to transfer value. Req %v, has %v", self.value, from.Balance) - return - } + err = env.Transfer(from, to, self.value) + if err != nil { + caller.ReturnGas(self.Gas, self.price) + + err = fmt.Errorf("insufficient funds to transfer value. Req %v, has %v", self.value, from.Balance()) + return } snapshot := env.State().Copy() -- cgit