plugeth/testing.go

33 lines
613 B
Go
Raw Normal View History

package main
import (
"fmt"
)
2014-01-02 22:02:24 +00:00
// This will eventually go away
var Db *MemDatabase
func Testing() {
2014-01-02 22:02:24 +00:00
db, _ := NewMemDatabase()
Db = db
bm := NewBlockManager()
2014-01-05 19:41:01 +00:00
tx := NewTransaction("\x00", 20, []string{"PUSH"})
txData := tx.MarshalRlp()
2014-01-05 19:41:01 +00:00
fmt.Printf("%q\n", txData)
copyTx := &Transaction{}
copyTx.UnmarshalRlp(txData)
2014-01-05 19:15:13 +00:00
fmt.Println(tx)
fmt.Println(copyTx)
tx2 := NewTransaction("\x00", 20, []string{"SET 10 6", "LD 10 10"})
2014-01-02 22:02:24 +00:00
blck := CreateTestBlock([]*Transaction{tx2, tx})
bm.ProcessBlock( blck )
2014-01-02 22:02:24 +00:00
fmt.Println("GenesisBlock:", GenisisBlock, "hash", string(GenisisBlock.Hash()))
}