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(x/ecocredit): default values for new ORM params #1293

Merged
merged 4 commits into from
Jul 23, 2022

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Jul 21, 2022

Description

Closes: #1158

This pull request updates default genesis values to include a default credit type and a default allowed denom to make it easier for starting a local testnet and then testing against that local testnet.

In order to support a default allowed denom (a marketplace type), a separate genesis package was created in the root of the module directory (previously in core - was probably not the right place anyways). Import cycles were violated in module and in the root of the ecocredit module so a separate genesis package was the simplest solution.

Validation functions for class, class issuers, project, and batch were moved to respective type files for each within core.

Manual tests: https://hackmd.io/WYHeLuIQSKOnLlJVGsFVnw (including upgrade tests just to be sure this does not affect the upgrade although these changes only affect starting a new chain without a genesis file as they should).


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 (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • 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 state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@ryanchristo ryanchristo marked this pull request as ready for review July 21, 2022 23:40
@@ -0,0 +1,33 @@
package core
Copy link
Member Author

Choose a reason for hiding this comment

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

No changes here. Moved from core/genesis.go (and what is now genesis/genesis.go).

@@ -0,0 +1,33 @@
package core
Copy link
Member Author

Choose a reason for hiding this comment

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

No changes here. Moved from core/genesis.go (and what is now genesis/genesis.go).

@@ -0,0 +1,19 @@
package core
Copy link
Member Author

Choose a reason for hiding this comment

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

No changes here. Moved from core/genesis.go (and what is now genesis/genesis.go).

@@ -0,0 +1,33 @@
package core
Copy link
Member Author

Choose a reason for hiding this comment

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

No changes here. Moved from core/genesis.go (and what is now genesis/genesis.go).

@ryanchristo ryanchristo added the backport/v4.0.x backport to release/v4.0.x branch label Jul 22, 2022
Copy link
Contributor

@aleem1314 aleem1314 left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link

codecov bot commented Jul 23, 2022

Codecov Report

Merging #1293 (9fdbad4) into master (727d41a) will decrease coverage by 0.02%.
The diff coverage is 47.74%.

@@            Coverage Diff             @@
##           master    #1293      +/-   ##
==========================================
- Coverage   77.51%   77.48%   -0.03%     
==========================================
  Files         213      219       +6     
  Lines       16084    16128      +44     
==========================================
+ Hits        12467    12497      +30     
+ Misses       2613     2612       -1     
- Partials     1004     1019      +15     
Flag Coverage Δ
experimental-codecov 77.59% <47.74%> (-0.03%) ⬇️
stable-codecov 77.18% <47.74%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
x/ecocredit/core/params.go 58.13% <ø> (-5.13%) ⬇️
x/ecocredit/core/types_class_issuer.go 0.00% <0.00%> (ø)
x/ecocredit/core/types_batch.go 7.69% <7.69%> (ø)
x/ecocredit/core/types_class.go 9.09% <9.09%> (ø)
x/ecocredit/core/types_project.go 9.09% <9.09%> (ø)
x/ecocredit/server/basket/query_balance.go 55.55% <45.45%> (-22.23%) ⬇️
x/ecocredit/genesis/genesis.go 52.19% <57.14%> (ø)
x/ecocredit/module/module.go 59.15% <60.00%> (-1.17%) ⬇️
x/ecocredit/server/basket/query_balances.go 63.33% <66.66%> (-0.96%) ⬇️
x/ecocredit/server/basket/query_basket.go 57.57% <66.66%> (-0.49%) ⬇️
... and 8 more

@ryanchristo ryanchristo merged commit 9a49021 into master Jul 23, 2022
@ryanchristo ryanchristo deleted the ryan/1158-default-orm-params branch July 23, 2022 00:51
mergify bot pushed a commit that referenced this pull request Jul 23, 2022
* feat(x/ecocredit): default values for new ORM params

* fix comment

(cherry picked from commit 9a49021)
ryanchristo added a commit that referenced this pull request Jul 23, 2022
* feat(x/ecocredit): default values for new ORM params

* fix comment

(cherry picked from commit 9a49021)

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v4.0.x backport to release/v4.0.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default governance parameters for new ORM params
2 participants