func DNWTestBlockchainFunctions(t *testing.T) {
	chain, teardownFunc, err := bc.SetupTestChain("validateunittests", bc.SimNetParams)
	if err != nil {
		t.Errorf("Failed to setup chain instance: %v", err)
		return
	}
	defer teardownFunc()
	genesisBlock := bc.SimNetParams.GenesisBlock
	err = chain.CheckConnectBlock(hcashutil.NewBlock(genesisBlock), false)
	if err == nil {
		t.Errorf("CheckConnectBlock: Did not receive expected error")
	}
	filename := filepath.Join("testdata/", "hcash0to168.tar.bz2")
	fi, err := os.Open(filename)
	if err != nil {
		t.Errorf("Unable to open %s: %v", filename, err)
	}
	bcStream := bzip2.NewReader(fi)
	defer fi.Close()
	bcBuf := new(bytes.Buffer)
	bcBuf.ReadFrom(bcStream)
	bcDecoder := gob.NewDecoder(bcBuf)
	blockChain := make(map[int64][]byte)
	if err := bcDecoder.Decode(&blockChain); err != nil {
		t.Errorf("error decoding test blockchain: %v", err.Error())
	}
	for i := 1; i <= 168; i++ {
		bl, err := hcashutil.NewBlockFromBytes(blockChain[int64(i)])
		if err != nil {
			t.Errorf("NewBlockFromBytes error: %v", err.Error())
		}
		_, _, err = chain.ProcessBlock(bl, bc.BFNone)
		if err != nil {
			t.Fatalf("ProcessBlock error at height %v: %v", i, err.Error())
		}
	}
	val, err := chain.TicketPoolValue()
	if err != nil {
		t.Errorf("Failed to get ticket pool value: %v", err)
	}
	expectedVal := hcashutil.Amount(3495091704)
	if val != expectedVal {
		t.Errorf("Failed to get correct result for ticket pool value; "+
			"want %v, got %v", expectedVal, val)
	}
	a, _ := hcashutil.DecodeAddress("SsbKpMkPnadDcZFFZqRPY8nvdFagrktKuzB")
	hs, err := chain.TicketsWithAddress(a)
	if err != nil {
		t.Errorf("Failed to do TicketsWithAddress: %v", err)
	}
	expectedLen := 223
	if len(hs) != expectedLen {
		t.Errorf("Failed to get correct number of tickets for "+
			"TicketsWithAddress; want %v, got %v", expectedLen, len(hs))
	}
	totalSubsidy := chain.TotalSubsidy()
	expectedSubsidy := int64(35783267326630)
	if expectedSubsidy != totalSubsidy {
		t.Errorf("Failed to get correct total subsidy for "+
			"TotalSubsidy; want %v, got %v", expectedSubsidy,
			totalSubsidy)
	}
}
TestBlockchainFunction tests the various blockchain API to ensure proper
functionality.
DOESN'T WORK YET
package blockchain_test
import (
	"bytes"
	"compress/bzip2"
	"encoding/gob"
	"os"
	"path/filepath"
	"testing"
	bc "github.com/HcashOrg/hcashd/blockchain"
	"github.com/HcashOrg/hcashutil"
)