aboutsummaryrefslogtreecommitdiffstats
path: root/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'testing.go')
-rw-r--r--testing.go23
1 files changed, 9 insertions, 14 deletions
diff --git a/testing.go b/testing.go
index 5d0b818a9..07e8c362f 100644
--- a/testing.go
+++ b/testing.go
@@ -4,22 +4,17 @@ import (
"fmt"
)
+// This will eventually go away
+var Db *MemDatabase
+
func Testing() {
+ db, _ := NewMemDatabase()
+ Db = db
+
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",
+ "PSH 10",
})
txData := tx.MarshalRlp()
@@ -28,9 +23,9 @@ func Testing() {
tx2 := NewTransaction("\x00", 20, []string{"SET 10 6", "LD 10 10"})
- blck := CreateBlock([]*Transaction{tx2, tx})
+ blck := CreateTestBlock([]*Transaction{tx2, tx})
bm.ProcessBlock( blck )
- fmt.Println("GenesisBlock:", GenisisBlock, "hashed", GenisisBlock.Hash())
+ fmt.Println("GenesisBlock:", GenisisBlock, "hash", string(GenisisBlock.Hash()))
}