Skip to content

Replace the placeholder checkpoint test with real coverage #191

Closed

Description

@Miracle656

Background

src/__tests__/checkpoint.test.ts asserts nothing about behaviour. Every case constructs a TypeScript interface literal and checks the fields it just assigned — it("should define BatchMetadata interface correctly"). It exercises no runtime code.

Meanwhile src/indexer/checkpoint.ts holds the real logic (isBatchProcessed, the transactional commit at :60-140) and has zero importers, so the "exactly-once ingest" feature from closed issue #101 is untested dead code that still counts toward the coverage gate.

Acceptance criteria

  • Behavioural tests against a mocked prisma: a fresh batch inserts and advances the checkpoint; a replayed batchId is a no-op; a failed insert rolls back so the checkpoint does not advance
  • The vacuous interface-shape cases are removed
  • commitBatch and isBatchProcessed are actually executed — visible in the coverage report, where they are currently at zero
  • The PR states in one line that the module is still not wired into startIndexer()

Drips Wave · Complexity: Easy · 100 points


How this repo is laid out

Wraith is a Soroban incoming-transfer indexer: it fills the gap Horizon leaves for SAC/SEP-41 token events by recipient address. Roughly 14k lines under src/, REST + GraphQL + WebSocket, Postgres via Prisma, deployed on Render.

  • Unit tests are jest (src/**/__tests__, tests/*.test.ts), with a coverage gate.
  • Integration tests are vitest (tests/integration/, vitest.integration.config.ts, Docker).
  • Don't mix the two runners in one file.

Known state of main before you start

tsc --noEmit and the unit suite are green. The Integration tests CI job is red, and so is Load test — both predate this batch. Open PRs #177 and #178 address them. If the integration job is red when you open a PR, that is not your fault; say so in the PR and carry on.

Four modules are shipped, closed as done, and imported by nothing: src/indexer/checkpoint.ts, src/ingest/reorg.ts, src/middleware/opa.ts, and src/api/candles.ts + src/workers/ohlc-refresh.ts. So the live indexer today has no reorg handling and no atomic checkpointing, despite both features being closed. Two issues below start unpicking that — don't assume a closed issue means a wired feature.

Ground rules

  • Every PR needs a test that fails before the change and passes after, unless the issue says otherwise.
  • Don't widen a Prometheus label to something unbounded — addresses and contract ids must never become label values.
  • Nothing may log or return a raw database error, a connection string, or a provider URL.
  • Don't reformat a file you're changing. A diff that is 90% whitespace hides the 10% that matters.


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. N-otorious commented on Sep 24, 2026

    @N-otorious
    Contributor

    @N-otorious has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Would like to work on this issue, assign it to me please.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @N-otorious to this issue.

  2. Gojv-byte commented on Sep 27, 2026

    @Gojv-byte

    @Gojv-byte has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello maintainer, please lemme take on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Gojv-byte to this issue.

  3. boalambo commented on Sep 27, 2026

    @boalambo
    Contributor

    @boalambo has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello maintainer, I would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @boalambo to this issue.

  4. drips-wave commented on Sep 29, 2026

    @drips-wave

    Congratulations, @N-otorious! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @N-otorious: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  5. drips-wave commented on Oct 18, 2026

    @drips-wave

    This issue has been completed by @N-otorious as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @N-otorious: You earned 100 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions