-
Notifications
You must be signed in to change notification settings - Fork 60
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 Contract
to zod
#1261
Migrate Contract
to zod
#1261
Conversation
.then((c) => new AddressInfo(c.address, c.displayName, c.logoUri)); | ||
.then( | ||
(c) => | ||
new AddressInfo(c.address, c.displayName, c.logoUri ?? undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In accordance with the potential null
, this needs to fallback to undefined
as AddessInfo
only accepts string | undefined
as a logoUri
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdyt about leaving a TODO to change the AddressInfo
constructor to accept string | null
as a logoUri
in a different PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've added a comment in ea4c64b.
Pull Request Test Coverage Report for Build 8236190961Details
💛 - Coveralls |
.then((c) => new AddressInfo(c.address, c.displayName, c.logoUri)); | ||
.then( | ||
(c) => | ||
new AddressInfo(c.address, c.displayName, c.logoUri ?? undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdyt about leaving a TODO to change the AddressInfo
constructor to accept string | null
as a logoUri
in a different PR?
Summary
This migrates the validation of
Contract
tozod
.Changes
ContractsValidator
and associated schemaContractSchema
and infers type from it