mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-07 22:54:17 -05:00
update ssz generated files (#15700)
This commit is contained in:
@@ -795,6 +795,107 @@ func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the SyncCommittee object
|
||||
func (s *SyncCommittee) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the SyncCommittee object to a target array
|
||||
func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
if size := len(s.Pubkeys); size != 512 {
|
||||
err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512)
|
||||
return
|
||||
}
|
||||
for ii := 0; ii < 512; ii++ {
|
||||
if size := len(s.Pubkeys[ii]); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Pubkeys[ii]...)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if size := len(s.AggregatePubkey); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.AggregatePubkey...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the SyncCommittee object
|
||||
func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 24624 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
s.Pubkeys = make([][]byte, 512)
|
||||
for ii := 0; ii < 512; ii++ {
|
||||
if cap(s.Pubkeys[ii]) == 0 {
|
||||
s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48]))
|
||||
}
|
||||
s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if cap(s.AggregatePubkey) == 0 {
|
||||
s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624]))
|
||||
}
|
||||
s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object
|
||||
func (s *SyncCommittee) SizeSSZ() (size int) {
|
||||
size = 24624
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the SyncCommittee object
|
||||
func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(s)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher
|
||||
func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
{
|
||||
if size := len(s.Pubkeys); size != 512 {
|
||||
err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512)
|
||||
return
|
||||
}
|
||||
subIndx := hh.Index()
|
||||
for _, i := range s.Pubkeys {
|
||||
if len(i) != 48 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
hh.PutBytes(i)
|
||||
}
|
||||
hh.Merkleize(subIndx)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if size := len(s.AggregatePubkey); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.AggregatePubkey)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the BeaconStateAltair object
|
||||
func (b *BeaconStateAltair) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(b)
|
||||
@@ -1585,107 +1686,6 @@ func (b *BeaconStateAltair) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the SyncCommittee object
|
||||
func (s *SyncCommittee) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the SyncCommittee object to a target array
|
||||
func (s *SyncCommittee) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
if size := len(s.Pubkeys); size != 512 {
|
||||
err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512)
|
||||
return
|
||||
}
|
||||
for ii := 0; ii < 512; ii++ {
|
||||
if size := len(s.Pubkeys[ii]); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.Pubkeys[ii]", size, 48)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.Pubkeys[ii]...)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if size := len(s.AggregatePubkey); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48)
|
||||
return
|
||||
}
|
||||
dst = append(dst, s.AggregatePubkey...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the SyncCommittee object
|
||||
func (s *SyncCommittee) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 24624 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
s.Pubkeys = make([][]byte, 512)
|
||||
for ii := 0; ii < 512; ii++ {
|
||||
if cap(s.Pubkeys[ii]) == 0 {
|
||||
s.Pubkeys[ii] = make([]byte, 0, len(buf[0:24576][ii*48:(ii+1)*48]))
|
||||
}
|
||||
s.Pubkeys[ii] = append(s.Pubkeys[ii], buf[0:24576][ii*48:(ii+1)*48]...)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if cap(s.AggregatePubkey) == 0 {
|
||||
s.AggregatePubkey = make([]byte, 0, len(buf[24576:24624]))
|
||||
}
|
||||
s.AggregatePubkey = append(s.AggregatePubkey, buf[24576:24624]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object
|
||||
func (s *SyncCommittee) SizeSSZ() (size int) {
|
||||
size = 24624
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the SyncCommittee object
|
||||
func (s *SyncCommittee) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(s)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SyncCommittee object with a hasher
|
||||
func (s *SyncCommittee) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'Pubkeys'
|
||||
{
|
||||
if size := len(s.Pubkeys); size != 512 {
|
||||
err = ssz.ErrVectorLengthFn("--.Pubkeys", size, 512)
|
||||
return
|
||||
}
|
||||
subIndx := hh.Index()
|
||||
for _, i := range s.Pubkeys {
|
||||
if len(i) != 48 {
|
||||
err = ssz.ErrBytesLength
|
||||
return
|
||||
}
|
||||
hh.PutBytes(i)
|
||||
}
|
||||
hh.Merkleize(subIndx)
|
||||
}
|
||||
|
||||
// Field (1) 'AggregatePubkey'
|
||||
if size := len(s.AggregatePubkey); size != 48 {
|
||||
err = ssz.ErrBytesLengthFn("--.AggregatePubkey", size, 48)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(s.AggregatePubkey)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the SyncAggregatorSelectionData object
|
||||
func (s *SyncAggregatorSelectionData) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(s)
|
||||
|
||||
@@ -1851,6 +1851,88 @@ func (b *BuilderBidCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the HistoricalSummary object
|
||||
func (h *HistoricalSummary) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(h)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the HistoricalSummary object to a target array
|
||||
func (h *HistoricalSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if size := len(h.BlockSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, h.BlockSummaryRoot...)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if size := len(h.StateSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, h.StateSummaryRoot...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the HistoricalSummary object
|
||||
func (h *HistoricalSummary) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 64 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if cap(h.BlockSummaryRoot) == 0 {
|
||||
h.BlockSummaryRoot = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
h.BlockSummaryRoot = append(h.BlockSummaryRoot, buf[0:32]...)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if cap(h.StateSummaryRoot) == 0 {
|
||||
h.StateSummaryRoot = make([]byte, 0, len(buf[32:64]))
|
||||
}
|
||||
h.StateSummaryRoot = append(h.StateSummaryRoot, buf[32:64]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the HistoricalSummary object
|
||||
func (h *HistoricalSummary) SizeSSZ() (size int) {
|
||||
size = 64
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the HistoricalSummary object
|
||||
func (h *HistoricalSummary) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(h)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the HistoricalSummary object with a hasher
|
||||
func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if size := len(h.BlockSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(h.BlockSummaryRoot)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if size := len(h.StateSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(h.StateSummaryRoot)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the BeaconStateCapella object
|
||||
func (b *BeaconStateCapella) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(b)
|
||||
@@ -2755,88 +2837,6 @@ func (b *BeaconStateCapella) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the HistoricalSummary object
|
||||
func (h *HistoricalSummary) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(h)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the HistoricalSummary object to a target array
|
||||
func (h *HistoricalSummary) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if size := len(h.BlockSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, h.BlockSummaryRoot...)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if size := len(h.StateSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, h.StateSummaryRoot...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the HistoricalSummary object
|
||||
func (h *HistoricalSummary) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 64 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if cap(h.BlockSummaryRoot) == 0 {
|
||||
h.BlockSummaryRoot = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
h.BlockSummaryRoot = append(h.BlockSummaryRoot, buf[0:32]...)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if cap(h.StateSummaryRoot) == 0 {
|
||||
h.StateSummaryRoot = make([]byte, 0, len(buf[32:64]))
|
||||
}
|
||||
h.StateSummaryRoot = append(h.StateSummaryRoot, buf[32:64]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the HistoricalSummary object
|
||||
func (h *HistoricalSummary) SizeSSZ() (size int) {
|
||||
size = 64
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the HistoricalSummary object
|
||||
func (h *HistoricalSummary) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(h)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the HistoricalSummary object with a hasher
|
||||
func (h *HistoricalSummary) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'BlockSummaryRoot'
|
||||
if size := len(h.BlockSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BlockSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(h.BlockSummaryRoot)
|
||||
|
||||
// Field (1) 'StateSummaryRoot'
|
||||
if size := len(h.StateSummaryRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateSummaryRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(h.StateSummaryRoot)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the LightClientBootstrapCapella object
|
||||
func (l *LightClientBootstrapCapella) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(l)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user