WIP rewrite vm

This commit is contained in:
obscuren
2014-01-02 23:02:24 +01:00
parent 5b3d4fae6e
commit 9df4c74511
8 changed files with 150 additions and 36 deletions

View File

@ -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()))
}