Skip to content

Add NOT_IMPLEMENTED handling test + docs clarity for WHITELIST access requirements #203

Description

@Lakes41

Difficulty: Intermediate
Type: Documentation / Test

Background: validateAccessRequirement() in src/contracts/contractHelpers.ts explicitly throws GuildPassError(NOT_IMPLEMENTED) for WHITELIST-type requirements, with a code comment explaining it needs an external allow-list source not yet available.

Problem: This is a real, currently-unsupported feature that a consumer could easily stumble into (since WHITELIST is a valid AccessRequirement.type in the type system and documented as one of four supported types in docs/api-reference.md), but there's no test asserting the exact, current failure mode, and the docs don't clearly flag it as unsupported today (tracked separately as an Advanced protocol-design issue in this same batch).

Expected outcome: A test locking in the current NOT_IMPLEMENTED behavior (so a future accidental regression — e.g. someone "fixing" it by silently returning false instead of throwing — is caught), and a clear callout in docs/api-reference.md/docs/sdk-guide.md marking WHITELIST on-chain validation as not yet supported, with a pointer to the SIWE-based or off-chain client.access.checkAccess() API as the current recommended approach for whitelist-style gating.

Suggested implementation: Add the missing test in tests/contracts.test.ts asserting validateAccessRequirement with type: 'WHITELIST' rejects with GuildPassErrorCode.NOT_IMPLEMENTED; add a "Known limitations" callout box to the relevant docs page.

Acceptance criteria:

  • Test explicitly covers the WHITELIST unsupported path.
  • Docs clearly state current limitation and recommended workaround.

Likely affected files: tests/contracts.test.ts, docs/api-reference.md, docs/sdk-guide.md.

Labels: documentation, tests, good first issue, GrantFox OSS, Maybe Rewarded, Official Campaign | FWC26


🟥 ADVANCED (30)

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsdocumentationDocumentation improvements, additions, or correctionsgood first issueGood for newcomersteststests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions