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 RelayLegacyDto to zod #1362

Merged
merged 3 commits into from
Apr 5, 2024
Merged

Migrate RelayLegacyDto to zod #1362

merged 3 commits into from
Apr 5, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Apr 4, 2024

Summary

This migrates the validation of RelayLegacyDto to zod.

Changes

  • Remove RelayLegacyDtoValidationPipe and associated schemas.
  • Add test-covered RelayLegacyDtoSchema and infer types from it.
  • Propagate type requirements.

@iamacook iamacook self-assigned this Apr 4, 2024
@iamacook iamacook marked this pull request as ready for review April 4, 2024 11:50
@iamacook iamacook requested a review from a team as a code owner April 4, 2024 11:50
@coveralls
Copy link

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8567936424

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 93.154%

Totals Coverage Status
Change from base Build 8551817285: -0.004%
Covered Lines: 6497
Relevant Lines: 6722

💛 - Coveralls

@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Apr 5, 2024
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

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

🚀

},
required: ['chainId', 'to', 'data'],
};
export const RelayLegacyDtoSchema = z.object({
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: to move the schema closer to the entity. In this case to src/routes/relay/entities/relay.legacy.dto.entity.ts (I think it helps with code navigation – less jumps).

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved in 0893309.

@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Apr 5, 2024
@iamacook iamacook requested a review from fmrsabino April 5, 2024 09:49
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

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

🚀

@iamacook iamacook merged commit ecbacf5 into main Apr 5, 2024
16 checks passed
@iamacook iamacook deleted the relay-legacy-schema-zod branch April 5, 2024 09:57
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.

3 participants