You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In scale_info::PortableRegistry we can obtain the path of composite and variant types. This isn't relevant for normal encoding and decoding, but may be useful in a couple of other scenarios:
If I make a custom type with custom encoding/decoding in order to mirror some Substrate type, I may want to be able to check in the EncodeAsType/DecodeAsType impls that the target type has the expected name (ie is likely to have led to the same custom encoding/decoding).
I may want to be able to return the target type name/path in errors.
This information is not mandatory and so I think it should be optional whether a TypeResolver implementation provides it or not (ie for V14 types, we can always provide it, but for older types it may be easier if the user doesn't have to provide such information.
The text was updated successfully, but these errors were encountered:
In
scale_info::PortableRegistry
we can obtain the path of composite and variant types. This isn't relevant for normal encoding and decoding, but may be useful in a couple of other scenarios:EncodeAsType
/DecodeAsType
impls that the target type has the expected name (ie is likely to have led to the same custom encoding/decoding).This information is not mandatory and so I think it should be optional whether a
TypeResolver
implementation provides it or not (ie for V14 types, we can always provide it, but for older types it may be easier if the user doesn't have to provide such information.The text was updated successfully, but these errors were encountered: