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

LCD Rest API returning unreadable bonded amount #1359

Closed
7768 opened this issue Jun 25, 2018 · 6 comments
Closed

LCD Rest API returning unreadable bonded amount #1359

7768 opened this issue Jun 25, 2018 · 6 comments
Labels
Projects

Comments

@7768
Copy link
Contributor

7768 commented Jun 25, 2018

To reproduce:

  1. gaiacli advanced rest-server
  2. Go to localhost:1317/stake/validators or ~$ curl http://localhost:1317/stake/validators | jq
  3. You see something silly:

image

The root cause seems to be from MarshalJSON of PoolShares. See https://github.com/cosmos/cosmos-sdk/blob/develop/x/stake/client/rest/query.go#L172

@ebuchman ebuchman added this to To do in UX on CLI via automation Jun 25, 2018
@ValarDragon
Copy link
Contributor

ValarDragon commented Jun 28, 2018

Seems to be fixed on develop:

[{"owner":"cosmosvaladdr1af7e7gn4ksk29xaaj00wwyq93fh90u6k3rvyx3",
"pub_key":"cosmosvalpub1zcjduc3qlxd89kg8x6wn95q0u2ps7j0nu4uva6ue69qk75gsrczfhlv5qvrsj9j6zx",
"revoked":false,"pool_shares":{"status":2,"amount":"100"},"delegator_shares":"100",
"description":{"moniker":"foo","identity":"","website":"","details":""},
"bond_height":0,"bond_intra_tx_counter":0,"proposer_reward_pool":null,
"commission":"0","commission_max":"0","commission_change_rate":"0",
"commission_change_today":"0","prev_bonded_shares":"0"}]

(This was on a clean install), did you do anything else to get that strange output? If not, then this may have been fixed by the unbonding PR.

@7768
Copy link
Contributor Author

7768 commented Jun 28, 2018

I just tested on develop:

$ gaiacli version
0.20.0-dev-473ac4a3

And I can reproduce the same problem when connected to gaia-6002.
For instance:
image

A lot of validators are partially slashed, which is why you see the ugly fractions. If the numbers are whole integers, they look fine.

See this related ticket: #1354

@ValarDragon
Copy link
Contributor

Oh I see. Didn't notice the slash there.

@rigelrozanski
Copy link
Contributor

Yeah this should probably be resolved by using human readable output for rationals

@rigelrozanski
Copy link
Contributor

(but not with the JSON output, I reckon we want all those digits in this situation)

@ebuchman ebuchman added this to To do in Current Iteration via automation Jul 11, 2018
@ebuchman ebuchman removed this from To do in Current Iteration Jul 25, 2018
@rigelrozanski
Copy link
Contributor

This issue will be addressed by switching to decimal in #1807

UX on CLI automation moved this from To do to Done Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
UX on CLI
  
Done
Development

No branches or pull requests

3 participants