Commit 3f904bf3 authored by obscuren's avatar obscuren

Implemented POST

parent cdbc3ecc
......@@ -278,6 +278,15 @@ func (self *StateTransition) Eval(msg *ethstate.Message, script []byte, context
ret, _, err = callerClosure.Call(vm, self.tx.Data)
if err == nil {
// Execute POSTs
for e := vm.Queue().Front(); e != nil; e = e.Next() {
msg := e.Value.(*ethvm.Message)
msg.Exec(transactor)
}
}
return
}
......
......@@ -245,6 +245,7 @@ func (self *StateObject) Copy() *StateObject {
stateObject.InitCode = ethutil.CopyBytes(self.InitCode)
stateObject.storage = self.storage.Copy()
stateObject.gasPool.Set(self.gasPool)
stateObject.remove = self.remove
return stateObject
}
......@@ -271,6 +272,11 @@ func (c *StateObject) Init() Code {
return c.InitCode
}
// To satisfy ClosureRef
func (self *StateObject) Object() *StateObject {
return self
}
// Debug stuff
func (self *StateObject) CreateOutputForDiff() {
fmt.Printf("%x %x %x %x\n", self.Address(), self.State.Root(), self.Balance.Bytes(), self.Nonce)
......
......@@ -12,6 +12,7 @@ import (
type ClosureRef interface {
ReturnGas(*big.Int, *big.Int)
Address() []byte
Object() *ethstate.StateObject
GetStorage(*big.Int) *ethutil.Value
SetStorage(*big.Int, *ethutil.Value)
}
......
......@@ -145,6 +145,7 @@ const (
CREATE = 0xf0
CALL = 0xf1
RETURN = 0xf2
POST = 0xf3
// 0x70 range - other
LOG = 0xfe // XXX Unofficial
......@@ -438,6 +439,7 @@ var OpCodes = map[string]byte{
"CREATE": 0xf0,
"CALL": 0xf1,
"RETURN": 0xf2,
"POST": 0xf3,
// 0x70 range - other
"LOG": 0xfe,
......
This diff is collapsed.
package eth
import (
//natpmp "code.google.com/p/go-nat-pmp"
"fmt"
"net"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment