Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/keys for empty keys return string instead of json #2470

Closed
4 tasks
faboweb opened this issue Oct 10, 2018 · 3 comments
Closed
4 tasks

/keys for empty keys return string instead of json #2470

faboweb opened this issue Oct 10, 2018 · 3 comments

Comments

@faboweb
Copy link
Contributor

faboweb commented Oct 10, 2018

Summary of Bug

if you query /keys and there are no keys yet, the LCD returns "[]" instead of the expected []

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@jackzampolin
Copy link
Member

Is this issue anywhere else? I.E. do we frequently return "[]" when there is an empty array?

@alexanderbez
Copy link
Contributor

It should be [] (even in other places where it's not)

@NodeGuy
Copy link
Contributor

NodeGuy commented Oct 24, 2018

Removing the following code fixes the bug:

// an empty list will be JSONized as null, but we want to keep the empty list
if len(infos) == 0 {
PostProcessResponse(w, cdc, "[]", indent)
return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants