From 9df4c745119b3ed10a7ad17887e8dd9cac249af7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 2 Jan 2014 23:02:24 +0100 Subject: WIP rewrite vm --- testing.go | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'testing.go') 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())) } -- cgit v1.2.3