WIP rewrite vm
This commit is contained in:
23
testing.go
23
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()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user