aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-13 06:26:58 +0800
committerobscuren <geffobscura@gmail.com>2015-03-13 06:26:58 +0800
commit80592f244da3f7323b7fa3e75a17c8e37c97fe8d (patch)
treec003c01b819355eaaada7a93dbb28e578c7fb95c /vm
parent3a88da578fc25843308e02ebc3c1d5c431f81820 (diff)
downloadgo-tangerine-80592f244da3f7323b7fa3e75a17c8e37c97fe8d.tar.gz
go-tangerine-80592f244da3f7323b7fa3e75a17c8e37c97fe8d.tar.zst
go-tangerine-80592f244da3f7323b7fa3e75a17c8e37c97fe8d.zip
more obvious failure for ethtest
Diffstat (limited to 'vm')
-rw-r--r--vm/environment.go2
-rw-r--r--vm/vm.go2
2 files changed, 3 insertions, 1 deletions
diff --git a/vm/environment.go b/vm/environment.go
index 5b4d6c8f0..69832241f 100644
--- a/vm/environment.go
+++ b/vm/environment.go
@@ -36,10 +36,12 @@ type Account interface {
SubBalance(amount *big.Int)
AddBalance(amount *big.Int)
Balance() *big.Int
+ Address() []byte
}
// generic transfer method
func Transfer(from, to Account, amount *big.Int) error {
+ //fmt.Printf(":::%x::: %v < %v\n", from.Address(), from.Balance(), amount)
if from.Balance().Cmp(amount) < 0 {
return errors.New("Insufficient balance in account")
}
diff --git a/vm/vm.go b/vm/vm.go
index ec6d04703..a818ac47d 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -380,7 +380,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
// 0x20 range
case SHA3:
- size, offset := stack.pop(), stack.pop()
+ offset, size := stack.pop(), stack.pop()
data := crypto.Sha3(mem.Get(offset.Int64(), size.Int64()))
stack.push(ethutil.BigD(data))