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

Migrate Collectible to zod #1260

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Migrate Collectible to zod #1260

merged 8 commits into from
Mar 11, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Mar 6, 2024

Summary

This migrates the validation of Collectible to zod.

Changes

  • Removes CollectiblesValidator and associated schema
  • Adds CollectibleSchema and infers type(s) from it
  • Propagate required changes in codebase
  • Update associated tests

@iamacook iamacook self-assigned this Mar 6, 2024
@iamacook iamacook marked this pull request as ready for review March 6, 2024 12:35
@iamacook iamacook requested a review from a team as a code owner March 6, 2024 12:35
@coveralls
Copy link

coveralls commented Mar 6, 2024

Pull Request Test Coverage Report for Build 8230500960

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 5 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 93.414%

Files with Coverage Reduction New Missed Lines %
src/routes/transactions/entities/tests/human-description.builder.ts 2 80.0%
Totals Coverage Status
Change from base Build 8230049871: -0.02%
Covered Lines: 6406
Relevant Lines: 6625

💛 - Coveralls

@iamacook iamacook marked this pull request as draft March 7, 2024 08:54
@iamacook iamacook marked this pull request as ready for review March 7, 2024 11:39
tokenSymbol: z.string(),
logoUri: z.string(),
id: z.string(),
// AJV remnant - do not use format: 'uri' as it fails on some payloads that should be considered valid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: do you think the AJV reference is needed? We could just comment out that we don't enforce URL validation here, wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the comment in 01237f5 but I think we should revisit this in the future. If we can make the schemas stricter, it would be beneficial.

@iamacook iamacook merged commit 37cdc9b into main Mar 11, 2024
16 checks passed
@iamacook iamacook deleted the zod-collectible-validation branch March 11, 2024 16:09
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.

None yet

3 participants