-
Notifications
You must be signed in to change notification settings - Fork 77
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: Implement HbarLimitService#addExpense
#2902
Conversation
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
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 couple of nits, but I have a more general question.
I assume based on the description of issue #2896 that the plan will be to simply swap out the old HBar Rate Limiter with the new HBar Rate Limiter in the sdkClient.ts
. If that is the case what happens if the Tier 3 general users are limited to 10K HBar per day, and a given partner is limited to 20K per day, and the general users use up all of the 10K budget before the partner has used up all of their allocated 20K. Is the partner rate limited as well, even though the partner may have only used up 12K Hbar that day?
Should we have a test for this?
I have also been thinking about this, but I couldn't come up with something else than eliminating the total daily limit and only keeping the tiered limits per user/partner, let's discuss it on the parking lot today. |
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # package-lock.json
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
|
🚨 Memory Leak Detected 🚨A potential memory leak has been detected in the test titled Details📊 Memory Leak Detection Report 📊 GC Type: Scavenge Heap Statistics (before vs after executing the test):
Heap Space Statistics (before vs after executing the test):
RecommendationsPlease investigate the memory allocations in this test, focusing on objects that are not being properly deallocated. |
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.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2902 +/- ##
==========================================
+ Coverage 83.48% 83.71% +0.22%
==========================================
Files 55 55
Lines 3676 3715 +39
Branches 765 770 +5
==========================================
+ Hits 3069 3110 +41
+ Misses 367 365 -2
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Description
This PR implements the
addExpense
method in theHbarLimitService
class and adds corresponding unit tests. The changes include:addExpense
method to handle expense addition for ETH addresses.addExpense
method to ensure correct functionality.HbarLimitService
to improve test coverage.Changes
Implementation of
addExpense
Method:Unit Tests:
addExpense
method to cover various scenarios, including:HbarLimitService
to ensure comprehensive test coverage.Related Issues
Fixes #2901
Notes for Reviewer