Skip to content

Add end-to-end contract-to-API test coverage #17

@Lakes41

Description

@Lakes41

Summary

Add an end-to-end test path that proves a contract membership event can result in an API access decision.

Current Behaviour

Contract tests and backend code exist separately. There is no test that validates the integration boundary between MembershipNFT, contract ABI helpers, database state, the policy engine, and the access API.

Expected Behaviour

The repository should include at least one deterministic integration scenario that starts with contract-like membership data and ends with a successful or denied API access decision.

Suggested Implementation

Use Foundry tests for contract behaviour and TypeScript integration tests for decoded fixture events. Generate or maintain event fixtures from the Solidity contract, apply them to the database through the indexer or sync service, then call the Fastify route with app.inject().

Files or Areas Likely Affected

  • contracts/test/MembershipNFT.t.sol
  • packages/contracts/src/index.ts
  • apps/access-api/src/workers/
  • apps/access-api/src/**/*.test.ts
  • apps/access-api/prisma/
  • README.md

Acceptance Criteria

  • Test fixtures are derived from or aligned with MembershipNFT events
  • Event ingestion creates expected wallet and membership records
  • API access checks reflect the ingested membership state
  • Suspended or expired memberships produce deny decisions
  • Tests can run locally without a live public chain

Additional Notes

This can depend on the on-chain event indexing issue, but should remain focused on regression coverage rather than worker implementation details.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions