-
Notifications
You must be signed in to change notification settings - Fork 30
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
Implement SCALE encoding and serde deserialization #19
Conversation
/// The string type. | ||
type String: Serialize + PartialEq + Eq + PartialOrd + Ord + Clone + core::fmt::Debug; |
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.
While I like the overall idea I think it is better in this case to opt-into KISS (keep it simple stupid) and instead convert all &'static str
simply into String
. The &'static str
was used in the beginning when we did not need deserialization in ink!. Now that we want to support Substrate we need it. However, if we do not generate metadata in any performance critical code section we don't need to opt-in for maximum performance and can instead opt-into simple code.
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've removed the OwnedForm
now, but kept MetaForm
as & 'static str
, and changed CompactForm
to String
. Let me know what you think.
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.
changes LGTM now
Potentially in future reintroduce OwnedForm #19 (comment)
Closes #4 (rel type-metadata/type-metadata#38).
Introduces
OwnedForm
andRegistryReadOnly
to allow SCALE decoding and JSON deserialization.scale
andserde
, maybe decoding specific forno_std