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

Implement MarshalJSON for Coins Type #4454

Merged
merged 4 commits into from
May 31, 2019

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented May 31, 2019

When coins are nil, they are JSON encoded as null in responses which is a bad UX for API and client consumers. This PR implements a custom JSON marshaler that encodes nil coins as []. Decoding remains unchanged and behavior is left intact.

closes: #4259

/cc @vikmeup


  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added a relevant changelog entry: clog add [section] [stanza] [message]

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented May 31, 2019

Codecov Report

Merging #4454 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4454      +/-   ##
==========================================
+ Coverage   54.63%   54.69%   +0.05%     
==========================================
  Files         250      250              
  Lines       16061    16065       +4     
==========================================
+ Hits         8775     8786      +11     
+ Misses       6641     6634       -7     
  Partials      645      645
Impacted Files Coverage Δ
types/coin.go 90.49% <100%> (+0.85%) ⬆️
x/mock/app.go 61.49% <0%> (+1.24%) ⬆️
types/codec.go 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9969ef9...5f14d85. Read the comment docs.

@alexanderbez
Copy link
Contributor Author

@vikmeup We'll get this in the next point release v0.34.7.

@alexanderbez alexanderbez merged commit 6ec9b26 into master May 31, 2019
@alexanderbez alexanderbez deleted the bez/4259-coins-json-null-encoding branch May 31, 2019 15:16
@kolya182
Copy link

@alexanderbez Thank you for fixing it, but RPC still returns wrong https://stargate.cosmos.network/auth/accounts/cosmos1633n6ga6zee5nz2uhtsn5urug8qzxthmz85ne9

@alexanderbez
Copy link
Contributor Author

That's because we haven't included it in a release yet @kolya182. We will soon :)

@kolya182
Copy link

@alexanderbez Do you have ETA for soon ?

@alexanderbez
Copy link
Contributor Author

@kolya182 end of next week.

@kolya182
Copy link

kolya182 commented Jun 24, 2019

@kolya182 end of next week.

How about now ?

@kolya182
Copy link

kolya182 commented Jul 4, 2019

@alexanderbez How about this week ?

@alexanderbez
Copy link
Contributor Author

alexanderbez commented Jul 5, 2019

@kolya182 yes, we're going to be cutting a RC today. I anticipate we'll have a full release next week 👍

Sorry for any inconvenience.

@kolya182
Copy link

@alexanderbez Will you roll out update to https://github.com/cosmos/gaia repo ?

@alexanderbez
Copy link
Contributor Author

@kolya182 SDK v0.36.0-rc1 and Gaia v1.0.0-rc1 have been cut. If the testnet operates smoothly, I anticipate we'll have a final release next week. Sorry for the delay!

@kolya182
Copy link

kolya182 commented Aug 2, 2019

@alexanderbez
Copy link
Contributor Author

@kolya182 stargate is pointing to mainnet, not the testnet (which is running the latest version).

@kolya182
Copy link

kolya182 commented Aug 5, 2019

@kolya182 stargate is pointing to mainnet, not the testnet (which is running the latest version).

When mainnet ?

@alexanderbez
Copy link
Contributor Author

When mainnet ?

https://www.mintscan.io/proposals/13

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 this pull request may close these issues.

[ICS20] Balance endpoint returns null for empty balance account
4 participants