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

Push to PRD #26

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Push to PRD #26

wants to merge 17 commits into from

Conversation

bitbeckers
Copy link
Contributor

Releases updated validation methods and support for geoJSON in properties

Refactors the SDK validators to use classes instead of a single file
with repeating methods.

- Create base abstract SchemaValidator with AJV integration
- Implement specialized validators:
  - MetadataValidator with nested schema support
  - ClaimDataValidator for hypercert claims
  - AllowlistValidator for merkle tree entries
  - MerkleProofValidator for proof verification

- Add comprehensive test suite for all validators
- Maintain backwards compatibility through legacy API wrapper
- Improve error handling with structured ValidationError type
- Introduce ValidatorFactory for consistent instantiation
Add property validator that also specifically checks for geoJSONs. The
pattern should be scalable to multiple specific types of properties.

Updated the metadata validator to validate properties in metadata when
applicable.

Add and update test suite
Updates thresholds to represent current coverage
Copy link

github-actions bot commented Jan 26, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 78.67% (🎯 78%) 1081 / 1374
🟢 Statements 78.67% (🎯 78%) 1081 / 1374
🟢 Functions 77.67% (🎯 77%) 87 / 112
🟢 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/formatter.ts 97.84% 91.66% 100% 97.84% 105-106
src/utils/index.ts 100% 100% 100% 100%
src/utils/tokenIds.ts 86.66% 80% 100% 86.66% 45-46
src/validator/ValidatorFactory.ts 71.42% 100% 50% 71.42% 20-21, 28-29, 32-33
src/validator/index.ts 82% 84.61% 83.33% 82% 83-89, 122-123
src/validator/interfaces.ts 100% 100% 100% 100%
src/validator/base/SchemaValidator.ts 100% 83.33% 100% 100%
src/validator/validators/AllowListValidator.ts 100% 100% 100% 100%
src/validator/validators/AttestationValidator.ts 100% 100% 100% 100%
src/validator/validators/MerkleProofValidator.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 #29 for commit 17d246d by the Vitest Coverage Report Action

@bitbeckers
Copy link
Contributor Author

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

The release is available on:

Your semantic-release bot 📦🚀

fixes typo in geoJSON mime type. Bumps coverage threshold
@bitbeckers
Copy link
Contributor Author

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

The release is available on:

Your semantic-release bot 📦🚀

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
Copy link
Contributor Author

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

The release is available on:

Your semantic-release bot 📦🚀

exports utils for identifying hypercert tokenID and getting the claimId
from a fraction ID
@bitbeckers
Copy link
Contributor Author

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

The release is available on:

Your semantic-release bot 📦🚀

Expors validator factory to expose the custom validator classes
@bitbeckers
Copy link
Contributor Author

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

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
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

1 participant