aboutsummaryrefslogtreecommitdiffstats
path: root/vm_test.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2014-01-03 06:02:24 +0800
committerobscuren <obscuren@obscura.com>2014-01-03 06:02:24 +0800
commit9df4c745119b3ed10a7ad17887e8dd9cac249af7 (patch)
tree8ae82afaf78a225d685a146a4cc67a77d3ca773d /vm_test.go
parent5b3d4fae6e03e5471a10c653fc0b016cc5e5dcfa (diff)
downloadgo-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.gz
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.bz2
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.lz
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.xz
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.tar.zst
go-tangerine-9df4c745119b3ed10a7ad17887e8dd9cac249af7.zip
WIP rewrite vm
Diffstat (limited to 'vm_test.go')
-rw-r--r--vm_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/vm_test.go b/vm_test.go
new file mode 100644
index 000000000..d0bcda2ca
--- /dev/null
+++ b/vm_test.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "fmt"
+ "testing"
+ _"encoding/hex"
+)
+
+
+func TestVm(t *testing.T) {
+ db, _ := NewMemDatabase()
+ Db = db
+
+ tx := NewTransaction("\x00", 20, []string{
+ "PSH 10",
+ })
+
+ block := CreateBlock("", 0, "", "", 0, 0, "", []*Transaction{tx})
+ db.Put(block.Hash(), block.MarshalRlp())
+
+ bm := NewBlockManager()
+ bm.ProcessBlock( block )
+ tx1 := &Transaction{}
+ tx1.UnmarshalRlp([]byte(block.state.Get(tx.recipient)))
+ fmt.Println(tx1)
+}
+