Skip to content

Add SEP-0002 compliance tests for the federation endpoint - #629

Merged
Abdulazeem-code merged 1 commit into
Abdulazeem-code:mainfrom
Tijesunimi004:test/federation-sep0002-compliance
Aug 29, 2026
Merged

Add SEP-0002 compliance tests for the federation endpoint#629
Abdulazeem-code merged 1 commit into
Abdulazeem-code:mainfrom
Tijesunimi004:test/federation-sep0002-compliance

Conversation

@Tijesunimi004

Copy link
Copy Markdown
Contributor

What changed

Adds stellar-payment-platform/tests/federation-compliance.test.js, a dedicated contract test suite for GET /federation covering SEP-0002 response shapes. No production code is touched.

Coverage

  • type=name lookups: 200 responses with stellar_address / account_id, default-to-name when type is omitted, bare-username domain normalization, and the built-in registry fallback.
  • type=id lookups: 200 responses with a name-shaped stellar_address and the queried account_id, plus case-insensitive address matching.
  • memo_type / memo: passthrough for text, id, and hash memos on both name and id lookups, and full omission of both fields when no memo is configured.
  • Error responses: 404 for unknown name/id, 400 for missing or blank q, and 400 for unsupported lookup types (txid, forward, and arbitrary values).
  • Headers: application/json content-type on success and error responses, and ETag / If-None-Match 304 handling.

Notes

  • The platform implements type=name and type=id; SEP-0002's txid and forward are not implemented and are rejected as invalid input, which the tests assert.
  • Error bodies use the platform envelope { success: false, error: { code, message } } rather than SEP-0002's bare { error }; the suite checks the message via body.error.message. This is documented in a header comment in the test file.

Closes #604

Covers GET /federation contract behaviour: type=name and type=id
lookups, memo_type/memo passthrough for text/id/hash memos, the
not-found and invalid-input error responses, and JSON content-type
and ETag handling.
Copilot AI lite review requested due to automatic review settings August 29, 2026 13:52
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Tijesunimi004 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

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Tijesunimi004 is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Abdulazeem-code
Abdulazeem-code merged commit df2061c into Abdulazeem-code:main Aug 29, 2026
8 of 10 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.

Add contract tests for the federation protocol (SEP-0002 compliance)

3 participants