-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: add support for optional parameters in nano contract serializer/deserializer #647
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #647 +/- ##
===========================================
+ Coverage 62.01% 79.63% +17.61%
===========================================
Files 77 77
Lines 5826 5838 +12
Branches 1210 1227 +17
===========================================
+ Hits 3613 4649 +1036
+ Misses 2116 1172 -944
+ Partials 97 17 -80 ☔ View full report in Codecov by Sentry. |
@@ -22,6 +22,12 @@ class Deserializer { | |||
* @inner | |||
*/ | |||
deserializeFromType(value: Buffer, type: string): any { | |||
if (type.endsWith('?')) { |
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.
Do we have a list of types or modifiers?
If so I think we should add a link to it with the see tag.
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.
Another alternative to a @see
tag, since we're using Typescript on this repository, would be to add a type for the type
parameter.
It's a developer-friendly way to have this information always at hand, and static code validation, on compatible IDEs.
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.
As we discussed in private, we currently don't have this documentation link. Also, the list of possible types is not static, so the documentation link is better.
I created an issue so we can track this when we have the documentation link. #649
@@ -22,6 +22,12 @@ class Deserializer { | |||
* @inner | |||
*/ | |||
deserializeFromType(value: Buffer, type: string): any { | |||
if (type.endsWith('?')) { |
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.
Another alternative to a @see
tag, since we're using Typescript on this repository, would be to add a type for the type
parameter.
It's a developer-friendly way to have this information always at hand, and static code validation, on compatible IDEs.
0e52dbd
to
10c0691
Compare
10c0691
to
fdea37f
Compare
Acceptance Criteria
Note: Unfortunately, we currently don't have any blueprints with optional parameters, so we can't test this in the integration tests, thus only unit tests were added.
Security Checklist