mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-06 22:23:56 -05:00
* Add Gloas protobuf definitions with spec tests Add Gloas state fields to beacon state implementation * Remove shared field for pending payment * Radek's feedback * Potuz feedback * use slice concat * Fix comment * Fix concat * Fix comment * Fix correct index
23 lines
563 B
Go
23 lines
563 B
Go
package stateutil
|
|
|
|
import (
|
|
"github.com/OffchainLabs/prysm/v7/encoding/ssz"
|
|
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// BuilderPendingPaymentsRoot computes the merkle root of a slice of BuilderPendingPayment.
|
|
func BuilderPendingPaymentsRoot(slice []*ethpb.BuilderPendingPayment) ([32]byte, error) {
|
|
roots := make([][32]byte, len(slice))
|
|
|
|
for i, payment := range slice {
|
|
r, err := payment.HashTreeRoot()
|
|
if err != nil {
|
|
return [32]byte{}, err
|
|
}
|
|
|
|
roots[i] = r
|
|
}
|
|
|
|
return ssz.MerkleizeVector(roots, uint64(len(roots))), nil
|
|
}
|