No longer store script directly in the state tree

This commit is contained in:
obscuren
2014-05-20 11:19:07 +02:00
parent a2fb265563
commit fd19142c0d
11 changed files with 70 additions and 52 deletions

View File

@ -0,0 +1,25 @@
package ethchain
import (
"fmt"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethutil"
"testing"
)
func TestSync(t *testing.T) {
ethutil.ReadConfig("", ethutil.LogStd)
db, _ := ethdb.NewMemDatabase()
state := NewState(ethutil.NewTrie(db, ""))
contract := NewContract([]byte("aa"), ethutil.Big1, ZeroHash256)
contract.script = []byte{42}
state.UpdateStateObject(contract)
state.Sync()
object := state.GetStateObject([]byte("aa"))
fmt.Printf("%x\n", object.Script())
}