Skip to content
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

Find proper types #35

Closed
GregTheGreek opened this issue Nov 26, 2018 · 5 comments
Closed

Find proper types #35

GregTheGreek opened this issue Nov 26, 2018 · 5 comments

Comments

@GregTheGreek
Copy link
Member

GregTheGreek commented Nov 26, 2018

We need to find proper typescript types for (or write them ourselves):

  • [ x ] uint's
  • [ x ] bits
  • [ x ] hash32

David's library should do the trick for uints. As for hash32 bits and bytes unsure.

@Mikerah
Copy link
Contributor

Mikerah commented Nov 26, 2018

These types are not "native" types in any programming language as in most programming languages that are being used for sharding have to check inputs and outputs and define these types themselves. If you look at the ssz codebase (https://github.com/ChainSafeSystems/ssz-js), this is what was done.

Note that hash32, in particular, is effectively bytes but with some caveats. Again, look through the ssz code.

@ansermino
Copy link
Member

I have been experimenting with how we can enforce these types in typescript here. it's really just a wrapper for BigNumber that enforces size. Still early days but I think a construct like this is achievable and could make our lives easy. It could also be extensible for types like hash32.

@aunyks
Copy link
Contributor

aunyks commented Dec 20, 2018

May seem ugly but I think an alias to Array<Boolean> would suffice for a Bits type.

@GregTheGreek
Copy link
Member Author

@aunyks were discussing this in the currently open pr

@GregTheGreek
Copy link
Member Author

I think we can close this per #62 which is now closed?

@GregTheGreek GregTheGreek added this to In progress in Phase0 Dec 31, 2018
Phase0 automation moved this from In progress to Done Jan 18, 2019
@GregTheGreek GregTheGreek moved this from In progress to Done in Integration of TypeScript Jan 18, 2019
wemeetagain added a commit that referenced this issue Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

4 participants