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

Fix x/genutil ExportGenesis #5775

Merged
merged 2 commits into from
Mar 10, 2020
Merged

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Mar 10, 2020

Closes: #5765

Description

Fix x/genutil ExportGenesis as to not return null, but instead default genesis state ([]), so on export, genesis validation should pass.


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

This was referenced Mar 10, 2020
@alexanderbez alexanderbez added the A:automerge Automatically merge PR once all prerequisites pass. label Mar 10, 2020
func (am AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONMarshaler) json.RawMessage {
return nil
func (am AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONMarshaler) json.RawMessage {
return am.DefaultGenesis(cdc)
Copy link

Choose a reason for hiding this comment

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

Shouldn't ExportGenesis return the list of GenTxs if exists, instead of the default state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, since this is for exporting state. In other words, we already have initiated and bootstrapped the chain, so we don't need genesis txs to do so.

@codecov
Copy link

codecov bot commented Mar 10, 2020

Codecov Report

Merging #5775 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5775   +/-   ##
=======================================
  Coverage   35.91%   35.91%           
=======================================
  Files         341      341           
  Lines       34745    34745           
=======================================
  Hits        12478    12478           
  Misses      21023    21023           
  Partials     1244     1244
Impacted Files Coverage Δ
x/genutil/module.go 0% <0%> (ø) ⬆️

@alexanderbez alexanderbez merged commit c0a8b25 into master Mar 10, 2020
@alexanderbez alexanderbez deleted the bez/5765-fix-genutil-gen-export branch March 10, 2020 14:41
alexanderbez added a commit that referenced this pull request Mar 10, 2020
alexanderbez added a commit that referenced this pull request Mar 24, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with null genutil when exporting state
3 participants