forked from mirror/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
504 B
25 lines
504 B
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())
|
|
}
|
|
|