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
|
|
|
|
2023-03-17 18:52:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/blocks"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/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
|
|
|
}
|