-
Notifications
You must be signed in to change notification settings - Fork 75
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 <victor.yanev@limechain.tech>
victor-yanev
added
enhancement
New feature or request
P1
design
Design, pilot and prototyping exploration work
labels
Aug 22, 2024
victor-yanev
requested review from
AlfredoG87,
ebadiere,
lukelee-sl and
a team
as code owners
August 22, 2024 14:42
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
victor-yanev
changed the title
feat: add hbar limit entities and repository
feat: Add entities and repositories for the redesigned HbarLimiter
Aug 23, 2024
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
…ription-repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
victor-yanev
changed the base branch from
main
to
2866-add-hbar-limit-entities
August 27, 2024 08:50
victor-yanev
changed the title
feat: Add entities and repositories for the redesigned HbarLimiter
feat: Add repositories for the redesigned HbarLimiter
Aug 27, 2024
victor-yanev
changed the title
feat: Add repositories for the redesigned HbarLimiter
feat: Add repositories for the redesigned hbar limiter
Aug 27, 2024
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 <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
* feat: Create skeleton for `HbarLimitService` Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add hbarLimitService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Quality Gate passedIssues Measures |
ebadiere
merged commit Aug 27, 2024
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 <victor.yanev@limechain.tech> * feat: Add repositories for the redesigned hbar limiter (#2870) * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * feat: add hbar limit entities and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove redundant return Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: use custom errors Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: use `CacheService` instead of directly using redis client Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: build Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: conflicting redis port in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: do not reconnect client before each test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: rename entities Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add EthAddressPlan entity and repository Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove redundant interface Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: extend tests for redisCache and cacheService Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix useless tests in cacheService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: small fix in cacheService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add UML diagram Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: simplify UML-diagram.md Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: rename entities Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: cacheService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: in-memory redis server port in ethAddressPlanRepository.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: revert unneeded changes in cacheService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * feat: Implement `shouldLimit` method of `HbarLimitService` (#2887) * feat: Create skeleton for `HbarLimitService` Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add hbarLimitService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com> * chore: address comments Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: rename specs to match the names of the repositories Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: use uuidV4 for mocked data in hbarLimitService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extend hbarLimitService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: remove duplicated tests in hbarLimitService.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add types to jsdocs where missing Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com>
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