Skip to content

feat: persist and serve attestations via repository and cache layer#368

Merged
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
Vivian-04:feature/wire-attestations-endpoint
May 29, 2026
Merged

feat: persist and serve attestations via repository and cache layer#368
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
Vivian-04:feature/wire-attestations-endpoint

Conversation

@Vivian-04
Copy link
Copy Markdown
Contributor

PR #321 [Backend] Wire attestations endpoint to repository and remove empty-array placeholder in app.ts

Summary

Wires the public attestation API to the real repository/cache/outbox path instead of the placeholder handlers in src/app.ts.

Changes

  • Mounts src/routes/attestations.ts from src/app.ts.
  • Adds repository-backed paginated list support with accurate totals.
  • Uses read-through attestation cache for list reads and invalidates cache after writes.
  • Persists new attestations in a transaction and emits an attestation.created outbox event.
  • Handles duplicate attestations with 409.
  • Normalizes Ethereum addresses before repository/cache use.
  • Validates payload size for key and value.
  • Documents the endpoints in docs/api.md and docs/openapi.yaml.
  • Extends route/cache/schema/envelope coverage for create, pagination, duplicates, normalization, and cache invalidation.

Verification

Passing focused verification:

npx.cmd vitest run tests/routes/attestations.test.ts src/services/__tests__/attestationCacheService.test.ts src/schemas/attestations.test.ts src/__tests__/envelopeContract.test.ts

Result: 4 passed, 46 tests passed.

Repo-wide verification still has unrelated existing failures:

  • npm.cmd run test fails in env config, member mocks, API key/webhook audit logs, bulk verification, rate limit, and Horizon listener tests.
  • npm.cmd run build fails on unrelated TypeScript errors across Soroban retry types, config timeout fields, outbox metrics, webhook repository interface, audit/service types, key manager types, and other existing modules.

The attestation-related webhook event typing issue was fixed by adding attestation.created and attestation.revoked to WebhookEventType.

Closes #321

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Vivian-04 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Baskarayelu Baskarayelu merged commit 3299a01 into CredenceOrg:main May 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Wire attestations endpoint to repository and remove empty-array placeholder in app.ts

2 participants