aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/state_object_test.go')
-rw-r--r--ethchain/state_object_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/ethchain/state_object_test.go b/ethchain/state_object_test.go
new file mode 100644
index 000000000..1db01a537
--- /dev/null
+++ b/ethchain/state_object_test.go
@@ -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())
+}