prysmaticlabs / prysm

Method modifies receiver RVV-B0006
Bug risk
Major
16 days ago3 years old
suspicious assignment to a by-value method receiver
  99// MarshalText returns a text byte representation of Uint256.
 100func (s Uint256) MarshalText() ([]byte, error) {
 101	if s.Int == nil {
 102		s.Int = big.NewInt(0) 103	}
 104	if !math.IsValidUint256(s.Int) {
 105		return nil, errors.Wrapf(errInvalidUint256, "value=%s", s.Int)
suspicious assignment to a by-value method receiver
  49// SSZBytes creates an ssz-style (little-endian byte slice) representation of the Uint256.
  50func (s Uint256) SSZBytes() []byte {
  51	if s.Int == nil {
  52		s.Int = big.NewInt(0)  53	}
  54	if !math.IsValidUint256(s.Int) {
  55		return []byte{}
suspicious assignment to a by-value method receiver
183}
184
185func (b batch) withRetryableError(err error) batch {
186	b.err = err187	return b.withState(batchErrRetryable)
188}
189
suspicious assignment to a by-value method receiver
177}
178
179func (b batch) withPeer(p peer.ID) batch {
180	b.blockPid = p181	backfillBatchTimeWaiting.Observe(float64(time.Since(b.scheduled).Milliseconds()))
182	return b
183}
suspicious assignment to a by-value method receiver
172		log.WithFields(b.logFields()).Debug("Backfill batch imported")
173	}
174	b.state = s
175	b.seq += 1176	return b
177}
178