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

refactor(x/ecocredit): consistent use of id, key, and abbreviation #1021

Merged
merged 17 commits into from
Apr 19, 2022

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Apr 14, 2022

Description

Closes: #992

This pull request updates id in state proto to key and applies consistent use of id, key, and abbreviation.


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 requested review from aaronc and technicallyty and removed request for aaronc April 14, 2022 17:09
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #1021 (fdc79d6) into master (f23e20a) will decrease coverage by 0.28%.
The diff coverage is 68.21%.

@@            Coverage Diff             @@
##           master    #1021      +/-   ##
==========================================
- Coverage   49.20%   48.91%   -0.29%     
==========================================
  Files         225      225              
  Lines       23408    23429      +21     
==========================================
- Hits        11517    11461      -56     
- Misses      10638    10720      +82     
+ Partials     1253     1248       -5     
Flag Coverage Δ
experimental-codecov 48.80% <68.21%> (-0.28%) ⬇️
stable-codecov 41.68% <68.21%> (-0.28%) ⬇️

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

proto/regen/ecocredit/v1/events.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/state.proto Outdated Show resolved Hide resolved
proto/regen/ecocredit/v1/state.proto Outdated Show resolved Hide resolved
@ryanchristo ryanchristo changed the title refactor(x/ecocredit): consistent use of id, name, and abbreviation refactor(x/ecocredit): consistent use of id and abbreviation Apr 16, 2022
@ryanchristo ryanchristo changed the title refactor(x/ecocredit): consistent use of id and abbreviation refactor(x/ecocredit): consistent use of id, key, and abbreviation Apr 17, 2022
Comment on lines +57 to +58
// credit_type_abbrev is the abbreviation of the credit type.
string credit_type_abbrev = 5;
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should be using a credit_type_key here as well but opened a separate issue (#1030) because that would require additional refactoring and this pull request is already pretty large.

@ryanchristo ryanchristo marked this pull request as ready for review April 18, 2022 01:18
Comment on lines +133 to 136
// batch_denom is the unique identifier of the credit batch formed from the
// project id, the batch sequence number, and the start and end date of the
// credit batch.
string batch_denom = 4;
Copy link
Member Author

Choose a reason for hiding this comment

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

This could also simply be denom rather than batch_denom. Opened #1031.

Copy link
Contributor

Choose a reason for hiding this comment

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

dewit

@ryanchristo
Copy link
Member Author

Any ideas why this is producing a group module error in the experimental simulation tests? This pull request does not make any changes to the group module. Maybe @aleem1314 you have an idea?

panic: group accounts: unique constraint violation

https://github.com/regen-network/regen-ledger/runs/6067693726?check_suite_focus=true

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

LGTM! highly in favor of the batch_denom -> denom change!!

Comment on lines +133 to 136
// batch_denom is the unique identifier of the credit batch formed from the
// project id, the batch sequence number, and the start and end date of the
// credit batch.
string batch_denom = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

dewit

@ryanchristo ryanchristo merged commit 7ec6a35 into master Apr 19, 2022
@ryanchristo ryanchristo deleted the ryan/992-id-name-abbrev branch April 19, 2022 05:32
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.

Consistent use of id, name, and abbreviation
4 participants