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
SCALE requires the destination data structure to be known before decoding. This isn't a problem when we deal with initialised Result, VaryingDataType and VaryingDataTypeSlice instances.
The issue is when Result, VaryingDataType and VaryingDataTypeSlice are used as attributes in structs. The zero case for the Result, VaryingDataType and VaryingDataTypeSlice have not been intialized with their associated value types, which causes a decode error.
The proposed solution is to allow for shadowing (custom types) of Result, VaryingDataType and VaryingDataTypeSlice, and to utilise the constructor pattern (ex. func NewMyResult() *NewResult) which will be called by the scale decoding process to initialise these special types. In the event that there is no constructor defined in the package we could throw a friendly error to notify the developer.
Task summary
Result
,VaryingDataType
andVaryingDataTypeSlice
instances.Result
,VaryingDataType
andVaryingDataTypeSlice
are used as attributes in structs. The zero case for theResult
,VaryingDataType
andVaryingDataTypeSlice
have not been intialized with their associated value types, which causes a decode error.Result
,VaryingDataType
andVaryingDataTypeSlice
, and to utilise the constructor pattern (ex.func NewMyResult() *NewResult
) which will be called by the scale decoding process to initialise these special types. In the event that there is no constructor defined in the package we could throw a friendly error to notify the developer.Specification reference
Other information and links
The text was updated successfully, but these errors were encountered: