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): update basket date criteria via governance #1864

Merged
merged 6 commits into from
Mar 28, 2023

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Mar 27, 2023

Description

Ref: #1855

This pull request adds MsgUpdateDateCriteria as a governance message (i.e. only the gov module account is authorized to execute this message). In order to maintain parity with standards defined and updated outside the protocol, a network-wide governance proposal to update basket date criteria should be possible without requiring a software upgrade.

Manual Testing: https://hackmd.io/ji82m-zHSKqz3FgxHJkQ6A


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)

Comment on lines -78 to -79
s.baseStore, err = baseapi.NewStateStore(s.db)
assert.NilError(t, err)
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated but noticed that we initialize base store twice in test setup.

@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #1864 (e964ece) into main (7cba83a) will increase coverage by 0.01%.
The diff coverage is 80.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1864      +/-   ##
==========================================
+ Coverage   73.24%   73.26%   +0.01%     
==========================================
  Files         230      232       +2     
  Lines       13706    13746      +40     
==========================================
+ Hits        10039    10071      +32     
- Misses       2934     2941       +7     
- Partials      733      734       +1     
Impacted Files Coverage Δ
...credit/basket/types/v1/msg_update_date_criteria.go 72.22% <72.22%> (ø)
...cocredit/basket/keeper/msg_update_date_criteria.go 85.71% <85.71%> (ø)
x/ecocredit/basket/types/v1/codec.go 100.00% <100.00%> (ø)

Amount: sdkMath.NewInt(100),
}
s.classID = testClassID
s.creditTypeAbbrev = "C"
s.creditTypePrecision = 6
s.batchDenom = "C01-001-20200101-20210101-001"
s.basketDenom = "eco.uC.NCT"
s.basketDenom = testBasketDenom
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated but we were receiving a lint warning for duplication.

@ryanchristo ryanchristo marked this pull request as ready for review March 27, 2023 20:55
@ryanchristo ryanchristo requested a review from a team March 27, 2023 20:55
@ryanchristo ryanchristo added the backport/v5.1.x backport to release/v5.1.x branch label Mar 27, 2023
@ryanchristo
Copy link
Member Author

Manual Testing: https://hackmd.io/ji82m-zHSKqz3FgxHJkQ6A

@ryanchristo ryanchristo mentioned this pull request Mar 27, 2023
27 tasks
Copy link
Member

@clevinson clevinson left a comment

Choose a reason for hiding this comment

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

Just read over the code and implementation looks good to me.

Is there expectation that we'll want to make use of this functionality outside of the potential immediate context of NCT? Would be nice to understand that use case to make sure we're handling this in the most appropriate way for any potential long term usage of this functionality.

@ryanchristo
Copy link
Member Author

ryanchristo commented Mar 28, 2023

Is there expectation that we'll want to make use of this functionality outside of the potential immediate context of NCT? Would be nice to understand that use case to make sure we're handling this in the most appropriate way for any potential long term usage of this functionality.

My assumption is that baskets will in most cases have standards that define them and standards are subject to change. Such changes should require a network-wide governance proposal but not a coordinated software upgrade, i.e. they are separate from software improvements and fixes. Whether this will be used outside the immediate context of NCT is more so a question of whether baskets will be used. If so, I think this will be used again when standards are adjusted.

@ryanchristo ryanchristo merged commit ce80e15 into main Mar 28, 2023
@ryanchristo ryanchristo deleted the ryan/msg-update-basket branch March 28, 2023 15:15
mergify bot pushed a commit that referenced this pull request Mar 28, 2023
ryanchristo added a commit that referenced this pull request Mar 28, 2023
#1864) (#1865)

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/v5.1.x backport to release/v5.1.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants