Context
The indexer has no automated test, so regressions in event mapping go unnoticed.
Acceptance criteria
- Add a vitest suite that spins up Postgres (testcontainers or a
docker-compose service in CI), seeds a Cursor, feeds a fixture Soroban event, and asserts the resulting PaymentRequest row.
- Runs in CI (extend
.github/workflows/ci.yml with a Postgres service).
Technical notes
- Extract the mapping logic into a pure function
applyEvent(event) -> Prisma.Write so it is testable without a live RPC.
Testing
- New test file
src/indexer.test.ts.
Context
The indexer has no automated test, so regressions in event mapping go unnoticed.
Acceptance criteria
docker-composeservice in CI), seeds aCursor, feeds a fixture Soroban event, and asserts the resultingPaymentRequestrow..github/workflows/ci.ymlwith a Postgres service).Technical notes
applyEvent(event) -> Prisma.Writeso it is testable without a live RPC.Testing
src/indexer.test.ts.