prysm-pulse/beacon-chain/core/blocks/genesis_test.go

18 lines
548 B
Go
Raw Normal View History

package blocks_test
2018-12-01 22:09:12 +00:00
import (
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/testing/assert"
2018-12-01 22:09:12 +00:00
)
func TestGenesisBlock_InitializedCorrectly(t *testing.T) {
stateHash := bytesutil.PadTo([]byte{0}, 32)
b1 := blocks.NewGenesisBlock(stateHash)
assert.NotNil(t, b1.Block.ParentRoot, "Genesis block missing ParentHash field")
assert.DeepEqual(t, b1.Block.StateRoot, stateHash, "Genesis block StateRootHash32 isn't initialized correctly")
}