prysmaticlabs / prysm

Unused code SCC-U1000
Bug risk
Major
5 occurrences in this check
245}
246
247// hasCoverage returns true if a given coverage is found in attestations list.
248func (al attList) hasCoverage(coverage bitfield.Bitlist) (bool, error) {249	for _, att := range al {
250		x, err := att.GetAggregationBits().Xor(coverage)
251		if err != nil {
func attList.selectComplementUsingKeys is unused
224}
225
226// selectComplementUsingKeys returns only items with keys that are NOT specified.
227func (al attList) selectComplementUsingKeys(keys []int) attList {228	foundInKeys := func(key int) bool {
229		for i := 0; i < len(keys); i++ {
230			if keys[i] == key {
215}
216
217// selectUsingKeys returns only items with specified keys.
218func (al attList) selectUsingKeys(keys []int) attList {219	filtered := make([]interfaces.Attestation, len(keys))
220	for i, key := range keys {
221		filtered[i] = al[key]
210}
211
212// merge combines two attestation lists into one.
213func (al attList) merge(al1 attList) attList {214	return append(al, al1...)
215}
216
121}
122
123// aggregate returns list as an aggregated attestation.
124func (al attList) aggregate(coverage bitfield.Bitlist) (*ethpb.Attestation, error) {125	if len(al) < 2 {
126		return nil, errors.Wrap(ErrInvalidAttestationCount, "cannot aggregate")
127	}