-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Make JSONMarshaler methods require proto.Message #7054
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7054 +/- ##
==========================================
- Coverage 54.53% 54.50% -0.03%
==========================================
Files 566 566
Lines 38727 38752 +25
==========================================
+ Hits 21119 21122 +3
- Misses 15884 15900 +16
- Partials 1724 1730 +6 |
…rie/6982-json-marshaler-proto
This pull request introduces 2 alerts when merging fa96cfe into c25b3b9 - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a big PR, I didn't review everything yet, will continue after lunch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting to all of this @blushi ! This is a massive and complex PR. And much needed IMHO.
I also didn't make it all the through in this review, but I think I get the general gist of what's needed next.
REST and legacy querier changes look correct.
We don't want to use legacy amino at all with simulation I believe.
Also, we don't want to use amino in CLI tests except when PrintOutputLegacy
is used. In all other cases we want to use JSONMarshaler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Here are the last couple of pieces that didn't make sense to me.
The biggest one is why are we using encoding/json for GenesisStates? Is it because they simple enough that JSONMarshaler.Marshal() == json.Marshal()
in those cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm! I'm happy to merge this (one last small nit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Co-authored-by: Federico Kunze <[email protected]>
Co-authored-by: Federico Kunze <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blushi Feel free to put automerge on when you're happy with this PR
I still need to fix some issues after merging |
* Make JSONMarshaler require proto.Message * Use &msg with MarshalJSON * Use *LegacyAmino in queriers instead of JSONMarshaler * Revert ABCIMessageLogs String() and coins tests * Use LegacyAmino in client/debug and fix subspace tests * Use LegacyAmino in all legacy queriers and adapt simulation * Make AminoCodec implement Marshaler and some godoc fixes * Test fixes * Remove unrelevant comment * Use TxConfig.TxJSONEncoder * Use encoding/json in genutil cli migrate/validate genesis cmds * Address simulation related comments * Use JSONMarshaler in cli tests * Use proto.Message as respType in cli tests * Use tmjson for tm GenesisDoc * Update types/module/simulation.go Co-authored-by: Federico Kunze <[email protected]> * Update types/module/module_test.go Co-authored-by: Federico Kunze <[email protected]> * Add godoc comments * Remove unused InsertKeyJSON * Fix tests Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Federico Kunze <[email protected]>
* Make JSONMarshaler require proto.Message * Use &msg with MarshalJSON * Use *LegacyAmino in queriers instead of JSONMarshaler * Revert ABCIMessageLogs String() and coins tests * Use LegacyAmino in client/debug and fix subspace tests * Use LegacyAmino in all legacy queriers and adapt simulation * Make AminoCodec implement Marshaler and some godoc fixes * Test fixes * Remove unrelevant comment * Use TxConfig.TxJSONEncoder * Use encoding/json in genutil cli migrate/validate genesis cmds * Address simulation related comments * Use JSONMarshaler in cli tests * Use proto.Message as respType in cli tests * Use tmjson for tm GenesisDoc * Update types/module/simulation.go Co-authored-by: Federico Kunze <[email protected]> * Update types/module/module_test.go Co-authored-by: Federico Kunze <[email protected]> * Add godoc comments * Remove unused InsertKeyJSON * Fix tests Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Federico Kunze <[email protected]>
Description
closes: #6982
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes