Skip to content
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 shouldLimit method of HbarLimitService #2887

Conversation

victor-yanev
Copy link
Contributor

@victor-yanev victor-yanev commented Aug 27, 2024

Description:

Adds a skeleton for the HbarLimitService and implements the shouldLimit method.

NOTE: IP address limiting will be handled in a separate PR after #2867 is merged

Related issue(s):

Fixes #2865

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@victor-yanev victor-yanev added enhancement New feature or request P1 labels Aug 27, 2024
@victor-yanev victor-yanev added this to the 0.55.0 milestone Aug 27, 2024
@victor-yanev victor-yanev self-assigned this Aug 27, 2024
@victor-yanev victor-yanev changed the title feat: Create skeleton for HbarLimitService feat: Implement HbarLimitService#shouldLimit Aug 27, 2024
@victor-yanev victor-yanev changed the title feat: Implement HbarLimitService#shouldLimit feat: Implement shouldLimit method of HbarLimitService Aug 27, 2024
@victor-yanev victor-yanev marked this pull request as ready for review August 27, 2024 10:31
@victor-yanev victor-yanev linked an issue Aug 27, 2024 that may be closed by this pull request
Copy link

@ebadiere ebadiere merged commit 712d7e8 into add-hbar-limit-subscription-repository Aug 27, 2024
15 of 19 checks passed
@ebadiere ebadiere deleted the 2865-Create-Hbar-Limit-service-skeleton branch August 27, 2024 17:09
ebadiere pushed a commit that referenced this pull request Aug 27, 2024
* 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]>
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
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HBAR Rate Limit Redesign] Implement shouldLimit
3 participants