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

genesis: Ensure there are no duplicate accounts in genesis file #2275

Merged
merged 5 commits into from
Sep 8, 2018

Conversation

ValarDragon
Copy link
Contributor

This also contains a light refactor of genesis state parsing, so that
the tests file didn't duplicate a lot of this code.

Handles one of the items in #2229. This is also the only test that verifies any of the genesis file code AFAIK (albeit not much)

  • 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/) - n/a

  • Added entries in PENDING.md with issue #

  • 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)

This also contains a light refactor of genesis state parsing, so that
the tests file didn't duplicate a lot of this code.
// TODO: Ensure all state machine parameters are in genesis (#1704)
func GaiaValidateGenesisState(cdc *wire.Codec, genesisState GenesisState) (err error) {
err = validateGenesisStateAccounts(genesisState.Accounts)
if err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this is kind of weird, I left this like this, as there will be more tests here as more todo's are completed.

@codecov
Copy link

codecov bot commented Sep 8, 2018

Codecov Report

Merging #2275 into develop will increase coverage by 0.08%.
The diff coverage is 51.21%.

@@             Coverage Diff             @@
##           develop    #2275      +/-   ##
===========================================
+ Coverage    63.74%   63.83%   +0.08%     
===========================================
  Files          140      140              
  Lines         8645     8666      +21     
===========================================
+ Hits          5511     5532      +21     
+ Misses        2755     2754       -1     
- Partials       379      380       +1

@cwgoes
Copy link
Contributor

cwgoes commented Sep 8, 2018

@ValarDragon Looks like there's a merge conflict now.

@ValarDragon
Copy link
Contributor Author

Conflict fixed!

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

utACK, we should add more tests in the future

@cwgoes cwgoes merged commit 1a70020 into develop Sep 8, 2018
@cwgoes cwgoes deleted the dev/validate_genesis_file branch September 8, 2018 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants