func TestGenesisBlock(t *testing.T) {
	var buf bytes.Buffer
	err := MainNetParams.GenesisBlock.Serialize(&buf)
	if err != nil {
		t.Fatalf("TestGenesisBlock: %v", err)
	}
	if !bytes.Equal(buf.Bytes(), genesisBlockBytes) {
		t.Fatalf("TestGenesisBlock: Genesis block does not appear valid - "+
			"got %v, want %v", spew.Sdump(buf.Bytes()),
			spew.Sdump(genesisBlockBytes))
	}
	hash := MainNetParams.GenesisBlock.BlockHash()
	if !MainNetParams.GenesisHash.IsEqual(&hash) {
		t.Fatalf("TestGenesisBlock: Genesis block hash does not "+
			"appear valid - got %v, want %v", spew.Sdump(hash),
			spew.Sdump(MainNetParams.GenesisHash))
	}
	blockSize := uint32(MainNetParams.GenesisBlock.SerializeSize())
	headerSize := MainNetParams.GenesisBlock.Header.Size
	if blockSize != headerSize {
		t.Fatalf("TestGenesisBlock size value: %v does not match the "+
			"header size value %v", blockSize, headerSize)
	}
}
TestGenesisBlock tests the genesis block of the main network for validity by
checking the encoded bytes and hashes.
package chaincfg
import (
	"bytes"
	"testing"
	"github.com/davecgh/go-spew/spew"
)