aboutsummaryrefslogtreecommitdiffstats
path: root/testing.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2014-01-01 20:36:48 +0800
committerobscuren <obscuren@obscura.com>2014-01-01 20:36:48 +0800
commit5da78427d0d5910c2ea0c0fc6ca84078f327e933 (patch)
tree8d704316190b98f061281db32d058802988e09c6 /testing.go
parent52952e274d791991c6c368d135234068968981bc (diff)
downloadgo-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar.gz
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar.bz2
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar.lz
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar.xz
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.tar.zst
go-tangerine-5da78427d0d5910c2ea0c0fc6ca84078f327e933.zip
Added db query interface and moved memory database
Diffstat (limited to 'testing.go')
-rw-r--r--testing.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing.go b/testing.go
new file mode 100644
index 000000000..5d0b818a9
--- /dev/null
+++ b/testing.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "fmt"
+)
+
+func Testing() {
+ bm := NewBlockManager()
+
+ tx := NewTransaction("\x00", 20, []string{
+ "SET 10 6",
+ "LD 10 10",
+ "LT 10 1 20",
+ "SET 255 7",
+ "JMPI 20 255",
+ "STOP",
+ "SET 30 200",
+ "LD 30 31",
+ "SET 255 22",
+ "JMPI 31 255",
+ "SET 255 15",
+ "JMP 255",
+ })
+ txData := tx.MarshalRlp()
+
+ copyTx := &Transaction{}
+ copyTx.UnmarshalRlp(txData)
+
+ tx2 := NewTransaction("\x00", 20, []string{"SET 10 6", "LD 10 10"})
+
+ blck := CreateBlock([]*Transaction{tx2, tx})
+
+ bm.ProcessBlock( blck )
+
+ fmt.Println("GenesisBlock:", GenisisBlock, "hashed", GenisisBlock.Hash())
+}