-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Creating this issue as a paper trail.
Poorly organised notes:
- Currently, most of the generated data model types are plain objects. Some "special", manually written types are represented as classes, like
Json,Timestamp,AccountId. This isn't consistent. - Due to most types being plain objects, when you want to encode something, you have to write
getCodec(AccountId).encode(accountId). Making all types as classes would allow putting codecs into their prototypes, allowing to doaccountId.encode()instead. - For sorted structures, there is an
Ordtype, and it is most convenient to put on the prototype of the objects. Since there are currently almost none, you have to passOrdcodecs alongside somewhere. - There was some problem with representation of
HashOf<T>andSignatureOf<T>with the current model, which could be solved with the class-based approach. - However, it is not clear how to represent discriminated unions with classes. Could be ugly.
Metadata
Metadata
Assignees
Labels
No labels