Skip to content

[Backend] claimable.service: remove no-op clearCache() and 'cachedAt as any' type hole #547

@ogazboiz

Description

@ogazboiz

Telegram: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

backend/src/services/claimable.service.ts has two small cleanups:

  1. clearCache() is an empty method with a comment saying cache is handled by redis/MemoryCache — it does nothing but is publicly exported on the service, which is misleading to callers expecting it to clear cached claimable values.
  2. On a cache hit the method returns { ...cachedEntry, cached: true, cachedAt: metadata?.createdAt } as any. The cachedAt field isn't declared on ClaimableAmountResult, and the as any defeats type-checking on the return shape.

Acceptance criteria

  • Either implement clearCache() (delete matching keys via cache.del) or remove the method and its references
  • Add cachedAt?: string to ClaimableAmountResult (or drop the field) and remove the as any cast
  • claimable.service.test.ts still passes

Files to touch

  • backend/src/services/claimable.service.ts

Out of scope

  • Cache TTL behaviour.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksgood first issueGood for newcomersrefactorRefactoring existing code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions