prysm-pulse/beacon-chain/core/blocks/block_test.go
terence tsao 273871940c Test code in different packages (#3710)
* Moved a few packagesXXX to test_XXX

* Gaz
2019-10-04 15:41:09 +08:00

22 lines
441 B
Go

package blocks_test
import (
"bytes"
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
)
func TestGenesisBlock_InitializedCorrectly(t *testing.T) {
stateHash := []byte{0}
b1 := blocks.NewGenesisBlock(stateHash)
if b1.ParentRoot == nil {
t.Error("genesis block missing ParentHash field")
}
if !bytes.Equal(b1.StateRoot, stateHash) {
t.Error("genesis block StateRootHash32 isn't initialized correctly")
}
}