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

Migrate x/genutil to use TxConfig #6734

Merged
merged 44 commits into from
Jul 25, 2020
Merged

Migrate x/genutil to use TxConfig #6734

merged 44 commits into from
Jul 25, 2020

Conversation

blushi
Copy link
Contributor

@blushi blushi commented Jul 15, 2020

Description

ref: #6213 , #5917

x/genutil/client/cli covered as part of #6717


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.

  • 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.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

This was referenced Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #6734 into master will increase coverage by 1.33%.
The diff coverage is 61.44%.

@@            Coverage Diff             @@
##           master    #6734      +/-   ##
==========================================
+ Coverage   60.22%   61.55%   +1.33%     
==========================================
  Files         389      509     +120     
  Lines       25361    31525    +6164     
==========================================
+ Hits        15274    19406    +4132     
- Misses       8919    10610    +1691     
- Partials     1168     1509     +341     

@blushi blushi requested a review from aaronc July 16, 2020 15:30
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but I have a question why we're passing explicitly txJSONDecoder and txBinaryEncoder (and not just txGenerator)

x/genutil/module.go Outdated Show resolved Hide resolved
simapp/app.go Outdated Show resolved Hide resolved
@aaronc aaronc mentioned this pull request Jul 21, 2020
9 tasks
@aaronc
Copy link
Member

aaronc commented Jul 22, 2020

lgtm, but I have a question why we're passing explicitly txJSONDecoder and txBinaryEncoder (and not just txGenerator)

I explained this to @blushi. The reason why is that we may get amino json and need to convert to protobuf binary. TxConfig isn't really intended to be used for the purpose.

simapp/amino.go Outdated Show resolved Hide resolved
simapp/simd/cmd/testnet.go Outdated Show resolved Hide resolved
@aaronc aaronc self-assigned this Jul 24, 2020
@aaronc aaronc added A:automerge Automatically merge PR once all prerequisites pass. C:x/genutil genutil module issues labels Jul 24, 2020
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. Caught one piece that isn't migrated.

x/genutil/types/genesis_state.go Outdated Show resolved Hide resolved
simapp/simd/cmd/testnet.go Outdated Show resolved Hide resolved
@aaronc aaronc changed the title Migrate x/genutil to use TxGenerator Migrate x/genutil to use TxConfig Jul 24, 2020
@mergify mergify bot merged commit f59df68 into master Jul 25, 2020
@mergify mergify bot deleted the marie/5917-x-genutil branch July 25, 2020 08:10
mergify bot pushed a commit that referenced this pull request Jul 27, 2020
* Migrate pieces of x/genutil missed in 6734

* Fix tests

* Fix lint

* Add test
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* Update genutil collect and gentx to use TxGenerator

* Remove print statement

* Use Tx in genutil DeliverGenTxs

* Use Tx in genutil genesis_state

* Use Tx in ValidateGenesis

* Use amino txJSONDecoder and txBinaryEncoder in genutil InitGenesis

* Use TxConfig in place of TxGenerator

* Add gentx tests

* Remove commented line

* Test fixes

* Apply suggestions from code review

Co-authored-by: Alexander Bezobchuk <[email protected]>

* Fixes

* Fixes

* Fixes

* Fixes

* Remove unneeded test case (doesn't apply to proto marshaling)

* linting

* Refactor to use new TxEncodingConfig interface in genutil module

* Replace golang/protobuf with gogo/protobuf package

* Use TxEncodingConfig in InitTestnet

* Remove old amino.go file

* Use TxJSONDecoder in genutil ValidateGenesis

* Add parameter to ValidateGenesis to resolve the tx JSON decoder issue

* Address review feedback

Co-authored-by: Jack Zampolin <[email protected]>
Co-authored-by: Aaron Craelius <[email protected]>
Co-authored-by: Aaron Craelius <[email protected]>
Co-authored-by: Alexander Bezobchuk <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:x/genutil genutil module issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants