Join the discussion on Telegram
Why this matters
backend/src/services/indexerService.ts exports getIndexerStatus, resetIndexer, replayFromLedger. These are admin-facing and destructive (resetIndexer drops the cursor; replayFromLedger triggers a re-poll), but I don't see direct unit-test coverage for them in backend/tests/.
The functions are small and mockable (they only touch prisma.indexerState and sorobanEventWorker.triggerPoll).
Acceptance criteria
Files to touch
- new
backend/tests/indexer-service.test.ts
Out of scope
Join the discussion on Telegram
Why this matters
backend/src/services/indexerService.tsexportsgetIndexerStatus,resetIndexer,replayFromLedger. These are admin-facing and destructive (resetIndexer drops the cursor; replayFromLedger triggers a re-poll), but I don't see direct unit-test coverage for them inbackend/tests/.The functions are small and mockable (they only touch
prisma.indexerStateandsorobanEventWorker.triggerPoll).Acceptance criteria
backend/tests/indexer-service.test.tsprisma.indexerState(Vitest module mock) andsorobanEventWorkergetIndexerStatusreturns lagSeconds=-1 when no state row, returns lagSeconds=>0 when a row exists;resetIndexer(0)upserts the row with lastCursor=null;replayFromLedgercalls resetIndexer then triggerPollFiles to touch
backend/tests/indexer-service.test.tsOut of scope
services/soroban-indexer.service.ts([Backend] Remove duplicate legacy indexer running alongside SorobanEventWorker #451)