Skip to content

feat(registry): add unit tests for registry contract lookup caching c…#676

Open
quickweb-stack wants to merge 1 commit into
ceejaylaboratory:mainfrom
quickweb-stack:feature/issue-574-add-unit-tests-for-registry-contrac
Open

feat(registry): add unit tests for registry contract lookup caching c…#676
quickweb-stack wants to merge 1 commit into
ceejaylaboratory:mainfrom
quickweb-stack:feature/issue-574-add-unit-tests-for-registry-contrac

Conversation

@quickweb-stack

Copy link
Copy Markdown

Close: #574

Summary of Changes

  1. Created backend/src/services/registry.service.ts : This service handles registry contract lookups with multi-level caching (in-memory L1 and Redis L2) using the existing AdvancedCacheService . Key features include:

    • getContract() : Retrieves contract info with cache-aside pattern
    • getAddress() : Gets just the contract address
    • getVersion() : Gets just the contract version
    • isRegistered() / isActive() : Check contract status
    • invalidateContractCache() / invalidateAllCache() : Cache invalidation methods
  2. Created backend/src/services/registry.service.test.ts : Unit tests for all the service methods, mocks dependencies like AdvancedCacheService and stellarService .

  3. Updated backend/src/config/env.ts : Added support for REGISTRY_CONTRACT_ID environment variable to configure the registry contract address.
    Now you can use registryService to look up contract information from the registry with caching!

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@quickweb-stack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@quickweb-stack

Copy link
Copy Markdown
Author

Done, Close: #676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Unit Tests for Registry Contract Lookup Caching

1 participant