prysmaticlabs / prysm

Functions prefixed with Get should return a value RVV-A0006
Anti-pattern
Major
7 days ago9 months old
function 'GetValidatorBalances' seems to be a getter but it does not return any result
239}
240
241// GetValidatorBalances returns a filterable list of validator balances.
242func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) {243	ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidatorBalances")
244	defer span.End()
245
function 'GetValidator' seems to be a getter but it does not return any result
174}
175
176// GetValidator returns a validator specified by state and id or public key along with status and balance.
177func (s *Server) GetValidator(w http.ResponseWriter, r *http.Request) {178	ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidator")
179	defer span.End()
180
function 'GetValidators' seems to be a getter but it does not return any result
 25)
 26
 27// GetValidators returns filterable list of validators with their balance, status and index.
 28func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { 29	ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidators")
 30	defer span.End()
 31
function 'getBlockV2Json' seems to be a getter but it does not return any result
 146}
 147
 148// getBlockV2Json returns the JSON-serialized version of the beacon block for given block ID.
 149func (s *Server) getBlockV2Json(ctx context.Context, w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { 150	result, err := s.getBlockResponseBodyJson(ctx, blk)
 151	if err != nil {
 152		httputil.HandleError(w, "Error processing request: "+err.Error(), http.StatusInternalServerError)
function 'getBlockV2Ssz' seems to be a getter but it does not return any result
 113}
 114
 115// getBlockV2Ssz returns the SSZ-serialized version of the beacon block for given block ID.
 116func (s *Server) getBlockV2Ssz(w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock) { 117	result, err := s.getBlockResponseBodySsz(blk)
 118	if err != nil {
 119		httputil.HandleError(w, "Could not get signed beacon block: "+err.Error(), http.StatusInternalServerError)