aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object_test.go
blob: 1db01a537303fa956b22e20601ca8a709ac31048 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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())
}