2014-01-01 06:36:48 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2014-01-02 16:02:24 -06:00
|
|
|
// This will eventually go away
|
|
|
|
var Db *MemDatabase
|
|
|
|
|
2014-01-01 06:36:48 -06:00
|
|
|
func Testing() {
|
2014-01-02 16:02:24 -06:00
|
|
|
db, _ := NewMemDatabase()
|
|
|
|
Db = db
|
|
|
|
|
2014-01-01 06:36:48 -06:00
|
|
|
bm := NewBlockManager()
|
|
|
|
|
|
|
|
tx := NewTransaction("\x00", 20, []string{
|
2014-01-02 16:02:24 -06:00
|
|
|
"PSH 10",
|
2014-01-01 06:36:48 -06:00
|
|
|
})
|
|
|
|
txData := tx.MarshalRlp()
|
|
|
|
|
|
|
|
copyTx := &Transaction{}
|
|
|
|
copyTx.UnmarshalRlp(txData)
|
|
|
|
|
|
|
|
tx2 := NewTransaction("\x00", 20, []string{"SET 10 6", "LD 10 10"})
|
|
|
|
|
2014-01-02 16:02:24 -06:00
|
|
|
blck := CreateTestBlock([]*Transaction{tx2, tx})
|
2014-01-01 06:36:48 -06:00
|
|
|
|
|
|
|
bm.ProcessBlock( blck )
|
|
|
|
|
2014-01-02 16:02:24 -06:00
|
|
|
fmt.Println("GenesisBlock:", GenisisBlock, "hash", string(GenisisBlock.Hash()))
|
2014-01-01 06:36:48 -06:00
|
|
|
}
|