Skip to content

fix(types): invalid error msg when verifying val power in genesis doc#476

Merged
lklimek merged 4 commits intov0.10-devfrom
fix-genesis-checks
Oct 12, 2022
Merged

fix(types): invalid error msg when verifying val power in genesis doc#476
lklimek merged 4 commits intov0.10-devfrom
fix-genesis-checks

Conversation

@lklimek
Copy link
Collaborator

@lklimek lklimek commented Oct 10, 2022

Issue being fixed or feature implemented

Genesis doc verification returns ambiguous error msg when validator power is invalid:

json: cannot unmarshal string into Go struct field genesisDocJSON.validators of type int64

What was done?

Improved error handling to include more detailed error:

cannot unmarshal string into Go struct field genesisValidatorJSON.power of type int64

Fixed unit tests to better detect various types of parsing errors. Previously, any error in provided payload would mark the test as green, while it should detect specific errors.

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek lklimek added this to the v0.10.0 milestone Oct 10, 2022
@lklimek lklimek changed the base branch from v0.9-dev to v0.10-dev October 10, 2022 15:28
Copy link
Collaborator

@shotonoff shotonoff left a comment

Choose a reason for hiding this comment

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

🚀

@lklimek lklimek merged commit a01432a into v0.10-dev Oct 12, 2022
@lklimek lklimek deleted the fix-genesis-checks branch October 12, 2022 15:11
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