-
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(x/ecocredit): query all credit balances based on address #942
Conversation
Codecov Report
@@ Coverage Diff @@
## master #942 +/- ##
==========================================
+ Coverage 73.16% 73.18% +0.02%
==========================================
Files 196 197 +1
Lines 23153 23144 -9
==========================================
- Hits 16939 16938 -1
+ Misses 4932 4923 -9
- Partials 1282 1283 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
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. A couple minor suggestions.
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
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. I thought we wanted to do separate PR with proto only ;)
return nil, err | ||
} | ||
|
||
pg, err := ormutil.GogoPageReqToPulsarPageReq(req.Pagination) |
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.
not directly related to this PR, I think this function name should have "Slow" suffix.
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.
yeah that makes sense - it does call another slow
method under the hood
return nil, err | ||
} | ||
|
||
balances := make([]*core.BatchBalance, 0, 10) |
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.
why starting with cap = 10?
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 was thinking it might be good to add some arbitrary cap to avoid slice allocations. would you advise a smaller/bigger number or just not at all? maybe we could add a default
constant if we want to define a capacity?
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.
No idea what would be the most common one, that's why I asked ;) Maybe let's decrease to 8 and add a comment?
By default, go will double the capacity if it needs.
Description
ref: #167
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