-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Typesafe library #99
Typesafe library #99
Conversation
bce2882
to
13a4ac4
Compare
36b30f8
to
13ad350
Compare
The issue is that the signature is different between fixed-length and variable-length types. A different approach could be to cast |
Seems we already did similar here in #110 https://github.com/ChainSafe/ssz/pull/110/files#diff-f7dbd702062a823eb1050e5721c8802d7d613821a719d69da838bc0760cef64bR594-R596 Pushed a few commits on top to fix conflicts and type errors |
conflicts |
@wemeetagain Can you take a look? |
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.
🚀 LGTM, we should link against lodestar and ensure there's no critical errors
PR got fucked with conflicts 😅 @wemeetagain do you think it's worth it to pursue this? |
Implemented with #223 |
Those two changes have surfaced many issues which I've resolved as many as possiible. @wemeetagain I don't know how to handle the function calls that you do with null such as
ssz/src/types/composite/abstract.ts
Line 103 in 36b30f8
please take a look and find a solution accepted by the Typescript compiler.
This PR also enforces correct types for ContainerType fields and ArrayType element type. See this test as an example of what compiles and what doesn't now
https://github.com/ChainSafe/ssz/blob/36b30f8916/test/unit/eth2Types.test.ts
Replaced the toHexString and fromHexString for simpler alternatives that are