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

[ICS20] Balance endpoint returns null for empty balance account #4259

Closed
4 tasks
vikmeup opened this issue May 2, 2019 · 12 comments · Fixed by #4454
Closed
4 tasks

[ICS20] Balance endpoint returns null for empty balance account #4259

vikmeup opened this issue May 2, 2019 · 12 comments · Fixed by #4454
Assignees
Labels

Comments

@vikmeup
Copy link

vikmeup commented May 2, 2019

Summary of Bug

Current endpoint: https://stargate.cosmos.network/bank/balances/cosmos1nk2aalgqtr2tjraqzygtwq5t4dan2rtwvs5fhg
returns null response if the current address does not have any atoms on the account

Expect JSON result:

[
   {
      "denom": "uatom",
      "amount": "0"
   }
]

or

[]

Version

Latest running node on https://stargate.cosmos.network

Steps to Reproduce

curl https://stargate.cosmos.network/bank/balances/cosmos1nk2aalgqtr2tjraqzygtwq5t4dan2rtwvs5fhg

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez alexanderbez added this to the v0.35.0 milestone May 2, 2019
@alexanderbez alexanderbez self-assigned this May 2, 2019
@vikmeup
Copy link
Author

vikmeup commented May 3, 2019

@alexanderbez FYI, same issue for this endpoint: auth/accounts/cosmos1nk2aalgqtr2tjraqzygtwq5t4dan2rtwvs5fhg , coins returned as null

@alexanderbez
Copy link
Contributor

alexanderbez commented May 3, 2019

For accounts that do not exist, this has already been fixed! #4065 (I'll include this in the next point release)

With regards to coins, we're going to be implementing #4076 soon which will be a breaking API change.

For now may I suggest checking for null manually?

@alexanderbez alexanderbez removed this from the v0.35.0 milestone May 3, 2019
@kolya182
Copy link

kolya182 commented May 3, 2019

@kolya182
Copy link

kolya182 commented May 3, 2019

For now may I suggest checking for null manually?
Yes, we do it now.

@alexanderbez
Copy link
Contributor

alexanderbez commented May 3, 2019

@kolya182 yeah, the fix isn't released yet. That's why I stated "I'll include this in the next point release" 😄

I'll be sure to have this in for 0.34.4

@kolya182
Copy link

@alexanderbez
Copy link
Contributor

@kolya182 no, v0.34.4 doesn't include any "fix" for this. We saw no need to change the custom serialization of coins (ie. coins are nil in this case). We're going to be changing the serialization completely so wanted to keep that for the next major release.

@kolya182
Copy link

@alexanderbez RPC returns inconsistent balance for address https://www.mintscan.io/account/cosmos1rwh0cxa72d3yle3r4l8gd7vyphrmjy2kydpnje, here is a video https://drive.google.com/file/d/1jqyGXRLF2Dla2k4fIyCrbVapGuJ9KS0s/view?usp=sharing . Should i create another issue or this is related ?.

@alexanderbez
Copy link
Contributor

No @kolya182. The stargate API sits behind a load-balancer and the nodes it proxied requests to are behind/out of sync.

I'm not sure if stargate has resolved this, but maybe use a different public API for now.

/cc @faboweb

@kolya182
Copy link

kolya182 commented May 30, 2019

https://cosmosapi-mainnet.tokenlon.im/auth/accounts/cosmos1633n6ga6zee5nz2uhtsn5urug8qzxthmz85ne9

https://stargate.cosmos.network/auth/accounts/cosmos1633n6ga6zee5nz2uhtsn5urug8qzxthmz85ne9

{
    "type": "auth/Account",
    "value": {
        "address": "",
        "coins": null,
        "public_key": null,
        "account_number": "0",
        "sequence": "0"
    }
}

@alexanderbez
Copy link
Contributor

@kolya182 -- I'll have a PR up soon :)

@alexanderbez
Copy link
Contributor

Two different REST client providers.

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

Successfully merging a pull request may close this issue.

3 participants