-
Notifications
You must be signed in to change notification settings - Fork 103
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!: Record retirement location for ecocredit module (#328) #384
Conversation
Codecov Report
@@ Coverage Diff @@
## master #384 +/- ##
==========================================
- Coverage 61.08% 59.85% -1.23%
==========================================
Files 51 56 +5
Lines 3325 3403 +78
==========================================
+ Hits 2031 2037 +6
- Misses 1030 1102 +72
Partials 264 264
Flags with carried forward coverage won't be shown. Click here to find out more. |
f74b52e
to
7780fc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, lgtm overall. I'm just not 100% certain we can use the github.com/TheBookPeople/iso3166 library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, see small comments and follow-up on the ISO 3166 validation.
Also need to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add the location validation logic to the Msg.ValidateBasic
methods
d93d6bb
to
8a03ae6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments, but pre-approving. Thanks @ruhatch !
if err != nil { | ||
return err | ||
} | ||
|
||
if !retiredUnits.IsZero() { | ||
err = validateLocation(iss.RetirementLocation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blushi @clevinson do we always require a valid location? Could someone retire credits without providing a location theoretically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, this should be required as long as credits get retired
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blushi is it worth a final check with Ron?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! lgtm
Description
Closes: #328
This PR introduces retirement locations for ecocredits. The retirement location is the location of the beneficiary or buyer of the retired credits. It is a string of the form
<country-code>[-<sub-national-code>[-<postal-code>]]
, with the first two fields conforming to the ISO 3166-2 standard. The location is emitted during retirement events and can therefore be tracked by an indexer.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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change