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): update location to jurisdiction #1020

Merged
merged 15 commits into from
Apr 19, 2022

Conversation

technicallyty
Copy link
Contributor

@technicallyty technicallyty commented Apr 13, 2022

Description

  • changes usages of location to jurisdiction

Closes: #1012


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)

@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #1020 (ad45eaa) into master (b46c384) will not change coverage.
The diff coverage is 56.02%.

@@           Coverage Diff           @@
##           master    #1020   +/-   ##
=======================================
  Coverage   48.93%   48.93%           
=======================================
  Files         225      225           
  Lines       23442    23442           
=======================================
  Hits        11472    11472           
+ Misses      10724    10722    -2     
- Partials     1246     1248    +2     
Flag Coverage Δ
experimental-codecov 48.81% <56.02%> (-0.01%) ⬇️
stable-codecov 41.73% <56.02%> (+0.02%) ⬆️

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

@technicallyty technicallyty marked this pull request as ready for review April 14, 2022 00:39
@technicallyty technicallyty added the Type: Refactor A code change that neither fixes a bug nor adds a feature label Apr 14, 2022
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

Looks like Location is still showing up in a few places.

x/ecocredit/msgs.go Show resolved Hide resolved
x/ecocredit/msgs.go Show resolved Hide resolved
x/ecocredit/msgs.go Show resolved Hide resolved
x/ecocredit/msgs.go Show resolved Hide resolved
x/ecocredit/msgs.go Show resolved Hide resolved
x/ecocredit/server/core/send.go Outdated Show resolved Hide resolved
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm seeing "location" in a few comments and test cases that would be nice to update. Pre-approving.

  • x/ecocredit/core/msg_create_batch_test.go
  • x/ecocredit/core/msg_mint_batch_credits.go
  • x/ecocredit/core/msg_retire_test.go
  • x/ecocredit/server/core/retire.go

@ryanchristo
Copy link
Member

Also looks like another case of random string used in message validation tests causing a race condition:

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

Resolved with #1018 when you have a chance to review.

@ryanchristo ryanchristo changed the title refactor: location -> jurisdiction refactor(x/ecocredit): update location to jurisdiction Apr 17, 2022
@ryanchristo
Copy link
Member

ryanchristo commented Apr 19, 2022

I think some of these should just be jurisdiction rather than project_jurisdiction or retirement_jurisdiction. I think it would be safe to change the following:

  • ProjectInfo should use jurisdiction rather than project_jurisdiction.
  • MsgCreateProject should use jurisdiction rather than project_jurisdiction.

I added #1036 to track other changes that we may want to consider but the two changes listed above might be nice to include within this pull request.

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

Reviewed API changes primarily and those LGTM

proto/regen/ecocredit/v1/tx.proto Outdated Show resolved Hide resolved
// of the retired credits. This must be provided if retired_amount is
// positive. It is a string of the form <country-code>[-<sub-national-code>[
// <postal-code>]], with the first two fields conforming to ISO 3166-2, and
// postal-code being up to 64 alphanumeric characters.
Copy link
Member

Choose a reason for hiding this comment

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

It's maybe not a good idea to duplicate all these docs

@technicallyty technicallyty merged commit 20852fc into master Apr 19, 2022
@technicallyty technicallyty deleted the ty/1012-jurisdiction branch April 19, 2022 23:02
@ryanchristo
Copy link
Member

ryanchristo commented Apr 20, 2022

I think some of these should just be jurisdiction rather than project_jurisdiction or retirement_jurisdiction. I think it would be safe to change the following:

ProjectInfo should use jurisdiction rather than project_jurisdiction.
MsgCreateProject should use jurisdiction rather than project_jurisdiction.

I added #1036 to track other changes that we may want to consider but the two changes listed above might be nice to include within this pull request.

It looks like the above changes are the only changes necessary needed for #1036 and would have been nice to include here. Also would have been nice to address the proto documentation suggestion aaron made. Let's make sure are addressing suggestions before merging in the future.

@ryanchristo ryanchristo removed this from the v4.0 - Llangorse Upgrade milestone Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use "jurisdiction" for projects and retirement
3 participants