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(template): scaffold genesis validation tests #1489

Merged
merged 24 commits into from
Aug 26, 2021

Conversation

lumtis
Copy link
Contributor

@lumtis lumtis commented Aug 19, 2021

When a module is scaffolded with starport s module a file x/.../types/genesis_test.go is created for genesis validation tests

This file contains a initial test that is the default genesis must be valid

Additional test cases are automatically added for the following command:

  • map: check there cannot be duplicated index in the genesis
  • list: check there cannot be duplicated id in the genesis and count must be higher than the biggest id

genesis_test.go is created with the above command if it doesn't exist for compatibility with older scaffolded module

@lumtis lumtis linked an issue Aug 19, 2021 that may be closed by this pull request
@lumtis lumtis marked this pull request as ready for review August 19, 2021 19:06
@lumtis lumtis requested a review from Pantani August 25, 2021 16:54
Pantani
Pantani previously approved these changes Aug 25, 2021
@fadeev
Copy link
Contributor

fadeev commented Aug 26, 2021

Didn't mean to dismiss your review @Pantani 😬 just added a line to the changelog.

fadeev
fadeev previously approved these changes Aug 26, 2021
Copy link
Contributor

@fadeev fadeev left a comment

Choose a reason for hiding this comment

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

Looks great! 💪

@lumtis lumtis requested review from fadeev and Pantani August 26, 2021 09:59
@lumtis
Copy link
Contributor Author

lumtis commented Aug 26, 2021

@fadeev @Pantani I dismissed your reviews, I had to fix a small issue with IBC (IBC module need PortID in genesis state for a valid genesis)

@lumtis lumtis merged commit 19a2fc4 into develop Aug 26, 2021
@lumtis lumtis deleted the feat/genesis-validate-tests branch August 26, 2021 15:20
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* Initialize test template

* Add placeholder

* Genesis test patch

* map test case

* Small fix

* list genesis tests

* Small fix

* Template fixes

* lint template

* Lint

* Small fix template

* Small fix template

* Valid case tests

* Lint

* docs: update changelog

* Fix issue with ibc

Co-authored-by: Danilo Pantani <danpantani@gmail.com>
Co-authored-by: Denis Fadeev <denis@fadeev.org>
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.

Template: Add types/genesis_test.go
3 participants