-
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
refactor(x/ecocredit): move empty string validation into utils.go #1317
Conversation
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.
Thanks for the contribution! Looks like a good start.
The issue was not very specific so my apologies. Although the parse error previously being used in the utility functions is defined in the ecocredit module, it is registered as an sdk error.
ErrParseFailure = sdkerrors.Register(ModuleName, 2, "parse error")
I think this error still makes sense to use for invalid format, and we should avoid using sdkerrors.ErrInvalidRequest
within the utility functions given the utility functions may be used outside the context of a request.
I've added a note to an issue proposing guidelines for better use of sdk errors, which is currently being used to track examples until those guidelines are written (#1147 (comment)). I left an example in the issue and some initial review comments below to point out how parse error and invalid request might be used together.
Codecov Report
@@ Coverage Diff @@
## master #1317 +/- ##
==========================================
+ Coverage 77.50% 77.56% +0.06%
==========================================
Files 221 220 -1
Lines 16160 16009 -151
==========================================
- Hits 12524 12417 -107
+ Misses 2621 2589 -32
+ Partials 1015 1003 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
|
hey @ryanchristo 👋 i made another pass at this and pushed a new commit. i have still only done the refactoring work for |
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.
This looks good to me. The added scenario is a duplicate but otherwise I think this is ready if you want to open a separate pull request to address basket and marketplace utils.
@ryanchristo I do like the idea of merging this and then addressing the other locations in separate PRs. because i may not have the time this week to handle the others. should we open new separate issues? or favor keeping #1245 open and adding a todo list? |
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 to me. Thanks for the contribution!
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.
👍🏻
Description
Ref: #1245
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