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

feat: add CMD parse-genesis #257

Merged
merged 33 commits into from
Dec 13, 2021
Merged

Conversation

huichiaotsou
Copy link
Contributor

@huichiaotsou huichiaotsou commented Nov 8, 2021

Description

Closes: #246
Note: forbole/juno#30 and forbole/juno#31 will have to be merged

Add new command bdjuno parse-genesis to parse the genesis.json file

  • users can specify which module in the genesis they would like to parse
  • re-implemented HandleGenesis of staking mod to be run without a running node
  • removed log.Debug() from HandleGenesis methods as parse-genesis is executed off a running node, avoiding log like:
{"level":"debug","module":"auth","time":"2021-11-16T15:28:37+08:00","message":"parsing genesis"}
{"level":"debug","module":"bank","time":"2021-11-16T15:28:39+08:00","message":"parsing genesis"}

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@huichiaotsou huichiaotsou changed the title feat: add new command parse-genesis feat: add CMD parse-genesis Nov 16, 2021
@RiccardoM
Copy link
Contributor

Before reviewing this, can you please fix the linting and tests @huichiaotsou? Also, when ready, can you mark this PR as ready for review?

@huichiaotsou huichiaotsou marked this pull request as ready for review November 22, 2021 09:56
@huichiaotsou
Copy link
Contributor Author

Before reviewing this, can you please fix the linting and tests @huichiaotsou? Also, when ready, can you mark this PR as ready for review?

Hi @RiccardoM , I have changed it to ready for review. For the linter and test errors, it's because in juno I did 2 slight modification in order to separate parse cmd and parse genesis cmd, so I think those PR should be reviewed and merged first.

Copy link
Contributor

@MonikaCat MonikaCat left a comment

Choose a reason for hiding this comment

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

LGTM, tested locally with #266

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2021

Codecov Report

❗ No coverage uploaded for pull request base (v2/cosmos/stargate@89f8774). Click here to learn what that means.
The diff coverage is n/a.

@@                  Coverage Diff                  @@
##             v2/cosmos/stargate     #257   +/-   ##
=====================================================
  Coverage                      ?   50.58%           
=====================================================
  Files                         ?       19           
  Lines                         ?     1870           
  Branches                      ?        0           
=====================================================
  Hits                          ?      946           
  Misses                        ?      796           
  Partials                      ?      128           

Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

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

I think there is a lot of code duplication here that is not necessary

cmd/parse-genesis/parseGenesis.go Outdated Show resolved Hide resolved
cmd/parse-genesis/utils/utils.go Outdated Show resolved Hide resolved
modules/auth/handle_genesis.go Show resolved Hide resolved
cmd/parse-genesis/parseGenesis.go Outdated Show resolved Hide resolved
@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Dec 13, 2021
@mergify mergify bot merged commit 0068193 into v2/cosmos/stargate Dec 13, 2021
@mergify mergify bot deleted the v2/aaron/parse_genesis_cmd branch December 13, 2021 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add command to parse genesis
4 participants