mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
Error handling to beacon chain gossip (#7132)
This commit is contained in:
parent
b8eaf78b17
commit
beb97784d4
@ -99,7 +99,9 @@ func DecodeDynamicList[T Unmarshaler](bytes []byte, start, end, max uint32) ([]T
|
||||
return nil, ErrBadOffset
|
||||
}
|
||||
objs[i] = objs[i].Clone().(T)
|
||||
objs[i].DecodeSSZ(buf[currentOffset:endOffset])
|
||||
if err := objs[i].DecodeSSZ(buf[currentOffset:endOffset]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
currentOffset = endOffset
|
||||
}
|
||||
return objs, nil
|
||||
@ -121,7 +123,9 @@ func DecodeStaticList[T Unmarshaler](bytes []byte, start, end, bytesPerElement u
|
||||
objs := make([]T, elementsNum)
|
||||
for i := range objs {
|
||||
objs[i] = objs[i].Clone().(T)
|
||||
objs[i].DecodeSSZ(buf[i*int(bytesPerElement):])
|
||||
if err := objs[i].DecodeSSZ(buf[i*int(bytesPerElement):]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return objs, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user