-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Change "?" for "Option" for optional fields (#480)
# Motivation Using `?` is not the same as `Option`. With `?` the field is optional, but with `Option`, the field is mandatory, but the value can be `undefined`. This small distinction is important when we render the information of proposals in NNS Dapp. We convert the actions to camelcase and remove `[] | [T]`. If we use `?`, we might forget to convert it and it will never show up in NNS Dapp. By using `Option`, we make sure that the field will always we present in the converters. You can see the example in the `params`, `maxDirectParticipationIcpE8s` and `minDirectParticipationIcpE8s` fields for the (deprecated) `OpenSnsTokenSwap` proposal action that I had to change when I moved from `?` to `Option`. # Changes * Change the `?` in `types/governance_converters.ts` for `Option`. Only for the fields related to proposals. # Tests * Fix a converter after changes. # Todos - [x] Add entry to changelog (if necessary).
- Loading branch information
Showing
3 changed files
with
77 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters