mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
525c818672
* remove ssz cache * gaz * lint * analyze more * fix
25 lines
777 B
Go
25 lines
777 B
Go
package stateutil
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"github.com/prysmaticlabs/prysm/encoding/ssz"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// Eth1Root computes the HashTreeRoot Merkleization of
|
|
// a BeaconBlockHeader struct according to the eth2
|
|
// Simple Serialize specification.
|
|
func Eth1Root(hasher ssz.HashFn, eth1Data *ethpb.Eth1Data) ([32]byte, error) {
|
|
if eth1Data == nil {
|
|
return [32]byte{}, errors.New("nil eth1 data")
|
|
}
|
|
return Eth1DataRootWithHasher(hasher, 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)
|
|
}
|