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 DeleteSafeDelegateDto to zod #1314

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

iamacook
Copy link
Member

Summary

This migrates the validation of DeleteSafeDelegateDto to zod.

Changes

  • Remove DeleteSafeDelegateDtoValidationPipe and associated schemas.
  • Add test-covered DeleteSafeDelegateDtoSchema and infer type from it.
  • Propagate type requirements.
  • Update tests accordingly.

@iamacook iamacook self-assigned this Mar 15, 2024
@coveralls
Copy link

coveralls commented Mar 15, 2024

Pull Request Test Coverage Report for Build 8326533776

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 93.693%

Totals Coverage Status
Change from base Build 8298566985: 0.01%
Covered Lines: 6517
Relevant Lines: 6722

💛 - Coveralls

@iamacook iamacook marked this pull request as ready for review March 15, 2024 16:07
@iamacook iamacook requested a review from a team as a code owner March 15, 2024 16:07
expect(result.success).toBe(true);
});

it.each(['delegate' as const, 'safe' as const])(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: it.each<keyof DeleteSafeDelegateDto>

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 40242cf.

export const DeleteSafeDelegateDtoSchema = z.object({
delegate: AddressSchema,
safe: AddressSchema,
signature: z.string(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use the HexSchema here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 40242cf, with test.

@iamacook iamacook requested a review from fmrsabino March 18, 2024 12:23
@iamacook iamacook merged commit 7995e06 into main Mar 19, 2024
16 checks passed
@iamacook iamacook deleted the delete-safe-delegate-dto-zod branch March 19, 2024 09:43
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