Skip to content

Commit

Permalink
rpc: answer with zero-length when there are no registered validators
Browse files Browse the repository at this point in the history
There is a huge difference between
   "result" : [],
and
   "result" : null,
  • Loading branch information
roman-khimov committed Aug 10, 2020
1 parent f287681 commit 6e252fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rpc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ func (s *Server) getValidators(_ request.Params) (interface{}, *response.Error)
if err != nil {
return nil, response.NewRPCError("can't get enrollments", "", err)
}
var res []result.Validator
var res = make([]result.Validator, 0)
for _, v := range enrollments {
res = append(res, result.Validator{
PublicKey: *v.Key,
Expand Down

0 comments on commit 6e252fb

Please sign in to comment.