mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
24 lines
706 B
Go
24 lines
706 B
Go
package stateutil
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// Eth1Root computes the HashTreeRoot Merkleization of
|
|
// a BeaconBlockHeader struct according to the eth2
|
|
// Simple Serialize specification.
|
|
func Eth1Root(eth1Data *ethpb.Eth1Data) ([32]byte, error) {
|
|
if eth1Data == nil {
|
|
return [32]byte{}, errors.New("nil eth1 data")
|
|
}
|
|
return Eth1DataRootWithHasher(eth1Data)
|
|
}
|
|
|
|
// Eth1DataVotesRoot computes the HashTreeRoot Merkleization of
|
|
// a list of Eth1Data structs according to the eth2
|
|
// Simple Serialize specification.
|
|
func Eth1DataVotesRoot(eth1DataVotes []*ethpb.Eth1Data) ([32]byte, error) {
|
|
return Eth1DatasRoot(eth1DataVotes)
|
|
}
|