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 ...@@ -278,6 +278,15 @@ func (self *StateTransition) Eval(msg *ethstate.Message, script []byte, context
ret, _, err = callerClosure.Call(vm, self.tx.Data) 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 return
} }
......
...@@ -245,6 +245,7 @@ func (self *StateObject) Copy() *StateObject { ...@@ -245,6 +245,7 @@ func (self *StateObject) Copy() *StateObject {
stateObject.InitCode = ethutil.CopyBytes(self.InitCode) stateObject.InitCode = ethutil.CopyBytes(self.InitCode)
stateObject.storage = self.storage.Copy() stateObject.storage = self.storage.Copy()
stateObject.gasPool.Set(self.gasPool) stateObject.gasPool.Set(self.gasPool)
stateObject.remove = self.remove
return stateObject return stateObject
} }
...@@ -271,6 +272,11 @@ func (c *StateObject) Init() Code { ...@@ -271,6 +272,11 @@ func (c *StateObject) Init() Code {
return c.InitCode return c.InitCode
} }
// To satisfy ClosureRef
func (self *StateObject) Object() *StateObject {
return self
}
// Debug stuff // Debug stuff
func (self *StateObject) CreateOutputForDiff() { func (self *StateObject) CreateOutputForDiff() {
fmt.Printf("%x %x %x %x\n", self.Address(), self.State.Root(), self.Balance.Bytes(), self.Nonce) fmt.Printf("%x %x %x %x\n", self.Address(), self.State.Root(), self.Balance.Bytes(), self.Nonce)
......
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
type ClosureRef interface { type ClosureRef interface {
ReturnGas(*big.Int, *big.Int) ReturnGas(*big.Int, *big.Int)
Address() []byte Address() []byte
Object() *ethstate.StateObject
GetStorage(*big.Int) *ethutil.Value GetStorage(*big.Int) *ethutil.Value
SetStorage(*big.Int, *ethutil.Value) SetStorage(*big.Int, *ethutil.Value)
} }
......
...@@ -145,6 +145,7 @@ const ( ...@@ -145,6 +145,7 @@ const (
CREATE = 0xf0 CREATE = 0xf0
CALL = 0xf1 CALL = 0xf1
RETURN = 0xf2 RETURN = 0xf2
POST = 0xf3
// 0x70 range - other // 0x70 range - other
LOG = 0xfe // XXX Unofficial LOG = 0xfe // XXX Unofficial
...@@ -438,6 +439,7 @@ var OpCodes = map[string]byte{ ...@@ -438,6 +439,7 @@ var OpCodes = map[string]byte{
"CREATE": 0xf0, "CREATE": 0xf0,
"CALL": 0xf1, "CALL": 0xf1,
"RETURN": 0xf2, "RETURN": 0xf2,
"POST": 0xf3,
// 0x70 range - other // 0x70 range - other
"LOG": 0xfe, "LOG": 0xfe,
......
This diff is collapsed.
package eth package eth
import ( import (
//natpmp "code.google.com/p/go-nat-pmp"
"fmt" "fmt"
"net" "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