-
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: Add repositories for the redesigned hbar limiter #2870
Merged
ebadiere
merged 27 commits into
2866-add-hbar-limit-entities
from
add-hbar-limit-subscription-repository
Aug 27, 2024
Merged
feat: Add repositories for the redesigned hbar limiter #2870
ebadiere
merged 27 commits into
2866-add-hbar-limit-entities
from
add-hbar-limit-subscription-repository
Aug 27, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>
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]>
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]>
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]>
…ription-repository Signed-off-by: Victor Yanev <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2866-add-hbar-limit-entities #2870 +/- ##
================================================================
+ Coverage 82.70% 83.43% +0.73%
================================================================
Files 47 38 -9
Lines 3457 2922 -535
Branches 731 615 -116
================================================================
- Hits 2859 2438 -421
+ Misses 371 289 -82
+ Partials 227 195 -32
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
* feat: Create skeleton for `HbarLimitService` Signed-off-by: Victor Yanev <[email protected]> * test: add hbarLimitService.spec.ts Signed-off-by: Victor Yanev <[email protected]> --------- Signed-off-by: Victor Yanev <[email protected]>
|
e9fd7b5
into
2866-add-hbar-limit-entities
12 of 13 checks passed
victor-yanev
added a commit
that referenced
this pull request
Aug 28, 2024
…2883) * feat: Add entities for the redesigned hbar limiter Signed-off-by: Victor Yanev <[email protected]> * feat: Add repositories for the redesigned hbar limiter (#2870) * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <[email protected]> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <[email protected]> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <[email protected]> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <[email protected]> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <[email protected]> * chore: remove redundant return Signed-off-by: Victor Yanev <[email protected]> * chore: use custom errors Signed-off-by: Victor Yanev <[email protected]> * chore: use `CacheService` instead of directly using redis client Signed-off-by: Victor Yanev <[email protected]> * fix: build Signed-off-by: Victor Yanev <[email protected]> * fix: conflicting redis port in tests Signed-off-by: Victor Yanev <[email protected]> * chore: do not reconnect client before each test Signed-off-by: Victor Yanev <[email protected]> * chore: rename entities Signed-off-by: Victor Yanev <[email protected]> * chore: add EthAddressPlan entity and repository Signed-off-by: Victor Yanev <[email protected]> * chore: remove redundant interface Signed-off-by: Victor Yanev <[email protected]> * chore: extend tests for redisCache and cacheService Signed-off-by: Victor Yanev <[email protected]> * chore: fix useless tests in cacheService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * chore: small fix in cacheService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * chore: add UML diagram Signed-off-by: Victor Yanev <[email protected]> * chore: simplify UML-diagram.md Signed-off-by: Victor Yanev <[email protected]> * chore: rename entities Signed-off-by: Victor Yanev <[email protected]> * fix: cacheService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * fix: in-memory redis server port in ethAddressPlanRepository.spec.ts Signed-off-by: Victor Yanev <[email protected]> * fix: revert unneeded changes in cacheService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * feat: Implement `shouldLimit` method of `HbarLimitService` (#2887) * feat: Create skeleton for `HbarLimitService` Signed-off-by: Victor Yanev <[email protected]> * test: add hbarLimitService.spec.ts 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]> * chore: address comments Signed-off-by: Victor Yanev <[email protected]> * chore: rename specs to match the names of the repositories Signed-off-by: Victor Yanev <[email protected]> * chore: use uuidV4 for mocked data in hbarLimitService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * test: extend hbarLimitService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * test: remove duplicated tests in hbarLimitService.spec.ts Signed-off-by: Victor Yanev <[email protected]> * chore: add types to jsdocs where missing Signed-off-by: Victor Yanev <[email protected]> --------- Signed-off-by: Victor Yanev <[email protected]> Signed-off-by: Victor Yanev <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces repositories for managing spending plans for HBAR rate limiting and managing links between ETH addresses and a spending plan (IP address limiting could also be added the same way by adding
IpAddressPlan
andIpAddressPlanRepository
).Changes
Repositories:
HbarLimitPlanRepository
: Provides methods to create, retrieve, and manage HBAR limit plans, including:findById
findByIdWithDetails
create
checkExistsAndActive
getSpendingHistory
addAmountToSpendingHistory
getSpentToday
addAmountToSpentToday
EthAddressPlanRepository
: Provides methods to manage Ethereum address plans, including:findByAddress
save
delete
Testing
HbarLimitPlanRepository
andEthAddressPlanRepository
to ensure proper functionality.Related issue(s):
Fixes #2869
Notes
Checklist