Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement attestation validator #30

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Conversation

bitbeckers
Copy link
Contributor

Implements the AttestationValidator class to perform a deeper validation EAS attestations according to our spec. Attestation should at least contain a chainID and contractAddress for a chain and contract that we support. The tokenID in the attestaion should point to an hypercert claimID.

To support these schemas, the SchemaValidator has been split into an Ajv and Zod validator. Additionally, utils/tokenIds.ts has been added to validate the value of a tokenID.

Tests have been updated accordingly.

Implements the AttestationValidator class to perform a deeper validation
EAS attestations according to our spec. Attestation should at least
contain a chainID and contractAddress for a chain and contract that we
support. The tokenID in the attestaion should point to an hypercert
claimID.

To support these schemas, the SchemaValidator has been split into an Ajv
and Zod validator. Additionally, utils/tokenIds.ts has been added to
validate the value of a tokenID.

Tests have been updated accordingly.
@bitbeckers bitbeckers added the enhancement New feature or request label Feb 3, 2025
@bitbeckers bitbeckers self-assigned this Feb 3, 2025
Copy link

github-actions bot commented Feb 3, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 78.77% (🎯 78%) 1080 / 1371
🟢 Statements 78.77% (🎯 78%) 1080 / 1371
🟢 Functions 78.37% (🎯 78%) 87 / 111
🟢 Branches 85.32% (🎯 85%) 250 / 293
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/constants.ts 100% 100% 100% 100%
src/types/client.ts 100% 100% 100% 100%
src/utils/tokenIds.ts 86.66% 80% 100% 86.66% 45-46
src/validator/base/SchemaValidator.ts 100% 83.33% 100% 100%
src/validator/validators/AttestationValidator.ts 100% 100% 100% 100%
src/validator/validators/MetadataValidator.ts 100% 90.9% 100% 100%
src/validator/validators/PropertyValidator.ts 88.23% 93.75% 100% 88.23% 25-32
Generated in workflow #24 for commit c746381 by the Vitest Coverage Report Action

@bitbeckers bitbeckers linked an issue Feb 3, 2025 that may be closed by this pull request
@bitbeckers bitbeckers merged commit 8921cc3 into develop Feb 3, 2025
2 checks passed
@bitbeckers bitbeckers deleted the feat/attestation_validator branch February 3, 2025 21:41
@bitbeckers
Copy link
Contributor Author

🎉 This PR is included in version 2.5.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add attestation validators for know attestation types
1 participant