Skip to content

feat(contract): CT-12 BatchRevocationEndpoint & CT-13 DocumentExistenceCheckEndpoint#592

Merged
mftee merged 2 commits into
CodeGirlsInc:mainfrom
Ibinola:feat/ct-12-ct-13-batch-revoke-and-exists-check
Jun 26, 2026
Merged

feat(contract): CT-12 BatchRevocationEndpoint & CT-13 DocumentExistenceCheckEndpoint#592
mftee merged 2 commits into
CodeGirlsInc:mainfrom
Ibinola:feat/ct-12-ct-13-batch-revoke-and-exists-check

Conversation

@Ibinola

@Ibinola Ibinola commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements two new contract endpoints


CT-13 — DocumentExistenceCheckEndpoint (closes #545)

Route: GET /exists/:hash

  • Returns { exists: bool, cached: bool } only — no transaction details
  • Checks Redis cache first (same key used by /verify endpoint)
  • Falls back to Stellar verify_hash on cache miss
  • Caches positive results with no TTL (document existence is permanent)
  • Caches negative results with a 60-second TTL
  • Returns 400 for invalid hash format via HashValidator::validate_sha256
  • Implementation: contract/src/module/exists/mod.rs

CT-12 — BatchRevocationEndpoint (closes #544)

Route: POST /revoke/batch

  • Accepts a JSON array of up to 20 RevokeRequest objects (document_hash, reason, revoked_by)
  • Returns 400 if the array is empty or exceeds 20 items
  • Processes all revocations concurrently using tokio::join_all
  • Each item in the response contains: document_hash, success, tx_hash (on success), error (on failure)
  • Partial success is allowed — a failed item does not abort others
  • Duplicate / already-revoked hashes are reported as per-item errors
  • Implementation: contract/src/module/batch_revoke/mod.rs

Testing

  • cargo build passes cleanly with no warnings or errors.

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@Ibinola is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

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

@Ibinola Ibinola force-pushed the feat/ct-12-ct-13-batch-revoke-and-exists-check branch from 88d4fa7 to 38374e3 Compare June 26, 2026 12:48
@mftee mftee merged commit 9c76c90 into CodeGirlsInc:main Jun 26, 2026
4 of 5 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.

[CT-13] Build DocumentExistenceCheckEndpoint [CT-12] Build BatchRevocationEndpoint

2 participants