diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
commit | cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007 (patch) | |
tree | ab28c518bd1b78f6b8ac8b241951ad161cb268a9 /vm/vm.go | |
parent | 21fd31dad8bc6e0291ca405314b516670333c707 (diff) | |
parent | c6af5f0a275608ea6c797ef826e6090885f24eac (diff) | |
download | dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.gz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.bz2 dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.lz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.xz dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.zst dexon-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.zip |
Merge branch 'develop' into jsonrpc
Conflicts:
rpc/ws/server.go
Diffstat (limited to 'vm/vm.go')
-rw-r--r-- | vm/vm.go | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -510,13 +510,13 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I case GASPRICE: stack.Push(context.Price) - self.Printf(" => %v", context.Price) + self.Printf(" => %x", context.Price) // 0x40 range case BLOCKHASH: num := stack.Pop() - n := U256(new(big.Int).Sub(self.env.BlockNumber(), ethutil.Big257)) + n := new(big.Int).Sub(self.env.BlockNumber(), ethutil.Big257) if num.Cmp(n) > 0 && num.Cmp(self.env.BlockNumber()) < 0 { stack.Push(ethutil.BigD(self.env.GetHash(num.Uint64()))) } else { @@ -634,6 +634,8 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I continue } + self.Printf(" ~> false") + case JUMPDEST: case PC: stack.Push(big.NewInt(int64(pc))) @@ -641,6 +643,8 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I stack.Push(big.NewInt(int64(mem.Len()))) case GAS: stack.Push(context.Gas) + + self.Printf(" => %x", context.Gas) // 0x60 range case CREATE: @@ -651,6 +655,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I gas = new(big.Int).Set(context.Gas) addr []byte ) + self.Endl() context.UseGas(context.Gas) ret, suberr, ref := self.env.Create(context, nil, input, gas, price, value) @@ -671,7 +676,6 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I stack.Push(ethutil.BigD(addr)) - self.Printf(" (*) %x", addr) } // Debug hook @@ -679,8 +683,6 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I self.Dbg.SetCode(context.Code) } case CALL, CALLCODE: - self.Endl() - gas := stack.Pop() // Pop gas and value of the stack. value, addr := stack.Popn() @@ -689,6 +691,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I // Pop return size and offset retSize, retOffset := stack.Popn() + address := ethutil.Address(addr.Bytes()) + self.Printf(" => %x", address).Endl() + // Get the arguments from the memory args := mem.Get(inOffset.Int64(), inSize.Int64()) @@ -697,9 +702,9 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I err error ) if op == CALLCODE { - ret, err = self.env.CallCode(context, addr.Bytes(), args, gas, price, value) + ret, err = self.env.CallCode(context, address, args, gas, price, value) } else { - ret, err = self.env.Call(context, addr.Bytes(), args, gas, price, value) + ret, err = self.env.Call(context, address, args, gas, price, value) } if err != nil { |