2019-10-04 07:41:09 +00:00
|
|
|
package blocks_test
|
2018-12-01 22:09:12 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-10-04 07:41:09 +00:00
|
|
|
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
2021-09-23 15:23:37 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
|
2021-09-23 18:53:46 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/testing/assert"
|
2018-12-01 22:09:12 +00:00
|
|
|
)
|
|
|
|
|
2019-04-10 06:52:06 +00:00
|
|
|
func TestGenesisBlock_InitializedCorrectly(t *testing.T) {
|
2020-08-27 18:13:32 +00:00
|
|
|
stateHash := bytesutil.PadTo([]byte{0}, 32)
|
2019-10-04 07:41:09 +00:00
|
|
|
b1 := blocks.NewGenesisBlock(stateHash)
|
2019-04-10 06:52:06 +00:00
|
|
|
|
2020-08-08 19:06:04 +00:00
|
|
|
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")
|
2019-04-10 06:52:06 +00:00
|
|
|
}
|