Skip to content

Add capped, paginated verifier management - #253

Open
holystrings wants to merge 1 commit into
DelegoLabs:mainfrom
holystrings:feat/116-capped-paginated-verifiers
Open

Add capped, paginated verifier management#253
holystrings wants to merge 1 commit into
DelegoLabs:mainfrom
holystrings:feat/116-capped-paginated-verifiers

Conversation

@holystrings

Copy link
Copy Markdown

Summary

Caps the Verifiers set with MAX_VERIFIERS and adds offset/limit
pagination, closing off unbounded storage growth from add_verifier
and unbounded read cost from get_verifiers.

Changes

  • MAX_VERIFIERS: u32 = 50
  • add_verifier rejects new entries at capacity with the new
    MarketplaceError::VerifierLimitReached
  • New get_verifiers_page(offset: u32, limit: u32) -> VerifierPage
    returns a correct slice plus total and next_offset (None once
    exhausted)
  • get_verifiers(env) -> Vec<Verifier> is left unchanged for
    source-compat — it's called internally by add_verifier,
    remove_verifier, and merchant verification, so this avoids
    touching those paths

Testing

  • add_verifier_rejects_when_at_capacity — fills to MAX_VERIFIERS,
    confirms the next add is rejected
  • get_verifiers_page_returns_correct_slice — asserts items, total,
    and next_offset across a multi-page walk
  • get_verifiers_page_offset_beyond_total_returns_empty — boundary case
  • cargo test (full existing suite) and cargo clippy --all-targets -- -D warnings pass

Acceptance criteria

  • Cap enforced on add
  • Paginated read returns correct slices
  • Existing tests still pass

Closes #116

Caps the Verifiers set at MAX_VERIFIERS (50); add_verifier now rejects
new entries at capacity with VerifierLimitReached. Adds a paginated
get_verifiers_page(offset, limit) -> VerifierPage. The existing
get_verifiers(env) -> Vec<Verifier> is left unchanged for source-compat
with its existing internal callers.

Closes DelegoLabs#116
@drips-wave

drips-wave Bot commented Sep 4, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: e0b839db-4622-4d1e-a6c3-aad17089369c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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 capped, paginated verifier management

1 participant