aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-03 00:55:45 +0800
committerobscuren <geffobscura@gmail.com>2015-03-03 00:55:45 +0800
commit200f66537cdf21a69ddda74eedfee30c14fb6ba6 (patch)
tree02861804635a9e132b3d5a17e464e361950af21f /vm
parent0823254c3bc2560f8e0dd6f19d05f471f8af94f4 (diff)
downloadgo-tangerine-200f66537cdf21a69ddda74eedfee30c14fb6ba6.tar.gz
go-tangerine-200f66537cdf21a69ddda74eedfee30c14fb6ba6.tar.zst
go-tangerine-200f66537cdf21a69ddda74eedfee30c14fb6ba6.zip
updated tests
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 791718fb2..e3b7df329 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -34,7 +34,7 @@ func New(env Environment) *Vm {
lt = LogTyDiff
}
- return &Vm{debug: false, env: env, logTy: lt, Recoverable: true}
+ return &Vm{debug: true, env: env, logTy: lt, Recoverable: true}
}
func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) {
@@ -56,8 +56,6 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
err = fmt.Errorf("%v", r)
- } else {
- fmt.Println(me.(*state.StateObject).Storage())
}
}()
}
@@ -668,7 +666,6 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
}
addr = ref.Address()
- fmt.Printf("CREATE %X\n", addr)
stack.Push(ethutil.BigD(addr))
}
@@ -860,6 +857,8 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo
// Stack Check, memory resize & gas phase
switch op {
+ case PUSH1, PUSH2, PUSH3, PUSH4, PUSH5, PUSH6, PUSH7, PUSH8, PUSH9, PUSH10, PUSH11, PUSH12, PUSH13, PUSH14, PUSH15, PUSH16, PUSH17, PUSH18, PUSH19, PUSH20, PUSH21, PUSH22, PUSH23, PUSH24, PUSH25, PUSH26, PUSH27, PUSH28, PUSH29, PUSH30, PUSH31, PUSH32:
+ gas.Set(GasFastestStep)
case SWAP1, SWAP2, SWAP3, SWAP4, SWAP5, SWAP6, SWAP7, SWAP8, SWAP9, SWAP10, SWAP11, SWAP12, SWAP13, SWAP14, SWAP15, SWAP16:
n := int(op - SWAP1 + 2)
stack.require(n)
@@ -897,11 +896,12 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo
g = GasStorageMod
}
gas.Set(g)
- newMemSize = calcMemSize(stack.Peek(), u256(32))
case MLOAD:
newMemSize = calcMemSize(stack.Peek(), u256(32))
case MSTORE8:
newMemSize = calcMemSize(stack.Peek(), u256(1))
+ case MSTORE:
+ newMemSize = calcMemSize(stack.Peek(), u256(32))
case RETURN:
newMemSize = calcMemSize(stack.Peek(), stack.data[stack.Len()-2])
case SHA3: