Skip to content

feat(certificate): batch export certificates for ZIP download - #517

Merged
LaGodxy merged 4 commits into
StarkMindsHQ:mainfrom
blessingernest54:feature/batch-certificate-zip-download
Jun 9, 2026
Merged

feat(certificate): batch export certificates for ZIP download#517
LaGodxy merged 4 commits into
StarkMindsHQ:mainfrom
blessingernest54:feature/batch-certificate-zip-download

Conversation

@blessingernest54

@blessingernest54 blessingernest54 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Closes #398


Description

Allow administrators to download multiple certificates as a ZIP file.

Changes

  • types.rs: Added BatchExportEntry struct bundling certificate + compliance + revocation metadata + suggested filename
  • lib.rs: Added batch_export_certificates (section 14) — admin-only, accepts up to 100 cert IDs, returns Vec<BatchExportEntry>, emits BatchCompleted event
  • test.rs: 5 tests covering happy path, missing cert skipping, revocation metadata, empty list error, and non-admin rejection

Acceptance Criteria

  • Batch download functional — batch_export_certificates returns all requested certs in one call
  • ZIP integrity — each entry includes filename field for client-side ZIP assembly; cert_id available for deduplication
  • <1GB file sizes — enforced via MAX_BATCH_SIZE = 100 cap

Notes

ZIP generation is an off-chain concern; the contract returns structured data that the admin client packages into a ZIP archive.

- Add BatchExportEntry type with certificate, compliance, revocation, and filename fields
- Add batch_export_certificates function (admin-only, max 100 certs)
- Emits BatchCompleted event with succeeded/failed counts
- Add 5 tests covering happy path, missing certs, revocation metadata, empty list, and non-admin access
@drips-wave

drips-wave Bot commented Apr 25, 2026

Copy link
Copy Markdown

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

blessingernest54 and others added 3 commits April 25, 2026 13:18
- Add OptionalCompliance/OptionalRevocation wrapper enums to replace
  Option<ComplianceRecord>/Option<RevocationRecord> in BatchExportEntry
  (Soroban #[contracttype] does not support Option<CustomType>)
- Remove invalid 'use soroban_sdk::format' import (not exported in v22)
- Use String::from_str for filename instead of format! macro
- Remove .unwrap() calls on Soroban client Vec return values in tests
- Fix test assertion to use enum variant match instead of .is_some()
@LaGodxy
LaGodxy merged commit f7d8075 into StarkMindsHQ:main Jun 9, 2026
1 check failed
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.

Feature: Implement Certificate Batch Download

2 participants