aboutsummaryrefslogtreecommitdiffstats
path: root/core/execution.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-12 21:40:40 +0800
committerobscuren <geffobscura@gmail.com>2015-01-12 21:40:40 +0800
commit75cd9cd2de315f8680ff6a382e9b3bd48e17ecad (patch)
tree7bd375c116a705862dfa8a0e32b49e634733d60d /core/execution.go
parent00348756bce00c2d19f16ce8df5eff7a62f5cfc6 (diff)
downloaddexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar.gz
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar.bz2
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar.lz
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar.xz
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.tar.zst
dexon-75cd9cd2de315f8680ff6a382e9b3bd48e17ecad.zip
updated tests
Diffstat (limited to 'core/execution.go')
-rw-r--r--core/execution.go15
1 files changed, 6 insertions, 9 deletions
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()