Description
backend/src/stellar-service-integration/stellar-read-cache.ts and stellar-cache.decorator.ts implement a fully unit-tested read-through caching layer, but @CacheStellarRead is never applied to any method on StellarService (getTokenInfo, getFactoryState, getTransaction, etc.) — the caching layer is dead code and every read still hits the RPC directly.
Requirements and Context
- Apply the decorator only to genuinely cacheable, read-only methods
- Confirm cache invalidation behaves correctly once the decorator is actually exercised by real call sites
Suggested Execution
Branch: feat/integration-activate-stellar-read-cache
Implement Changes
- Apply
@CacheStellarRead to the appropriate read-only methods on StellarService (getTokenInfo, getFactoryState, getTransaction)
- Confirm the existing cache invalidation logic behaves correctly once real call sites are decorated
- Add a test asserting a repeated call within the cache window doesn't re-hit the RPC client
Test and Commit
Run npx vitest run src/__tests__/stellarReadCache.integration.test.ts — a repeated read within the cache window is served from cache instead of re-hitting the RPC client.
Example Commit Message
feat(backend): apply the read-through cache decorator to stellar service read methods
Closes #<issue>
Guidelines
- Branch from
main, open a PR back to main
- All new code must have corresponding tests
- Run
npm run lint and npm run test before pushing
- Follow existing naming conventions and file structure
- PR description must reference this issue number (e.g.,
Closes #<issue>)
- Keep commits atomic and use conventional commit format
Description
backend/src/stellar-service-integration/stellar-read-cache.tsandstellar-cache.decorator.tsimplement a fully unit-tested read-through caching layer, but@CacheStellarReadis never applied to any method onStellarService(getTokenInfo,getFactoryState,getTransaction, etc.) — the caching layer is dead code and every read still hits the RPC directly.Requirements and Context
Suggested Execution
Branch:
feat/integration-activate-stellar-read-cacheImplement Changes
@CacheStellarReadto the appropriate read-only methods onStellarService(getTokenInfo,getFactoryState,getTransaction)Test and Commit
Run
npx vitest run src/__tests__/stellarReadCache.integration.test.ts— a repeated read within the cache window is served from cache instead of re-hitting the RPC client.Example Commit Message
Guidelines
main, open a PR back tomainnpm run lintandnpm run testbefore pushingCloses #<issue>)