-
Couldn't load subscription status.
- Fork 26
fix: Change type of data to be optional #117
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
Conversation
ESLint Summary View Full Report
Report generated by eslint-plus-action |
|
Wait, so does it come as an actual null or undefined, or no field at all? |
src/types/decoded-data.ts
Outdated
| to: string | ||
| value: string | ||
| data: string | ||
| data?: string |
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.
It should be explicitly string | null.
The types that are marked as optional, if they are not defined, they don't appear in the JSON at all, so it's different in those cases.
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.
dataDecoded is also marked as optional but is actually returned as null in the CGW and TxService response. Is it possible to see which fields will appear in the JSON and which won't?
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.
There are mistakes in the types apparently. I hope the new Nest.js CGW will have exportable types.
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.
I changed it to be null instead.
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.
👍
What it solves
Part of #1890
valueDecoded.datacan be null and should be reflected in the type.Examples
Transaction where
datais null:Tx Service: https://safe-transaction-goerli.safe.global/api/v1/multisig-transactions/0x4383f5cbddee358aa1e44023874ba63b751df6ba445c494d5799ddc48eeb42ae/
CGW: https://safe-client.safe.global/v1/chains/5/transactions/multisig_0x7a9af6Ef9197041A5841e84cB27873bEBd3486E2_0x4383f5cbddee358aa1e44023874ba63b751df6ba445c494d5799ddc48eeb42ae