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

API Discussion #9

Closed
kevaundray opened this issue Aug 15, 2019 · 3 comments
Closed

API Discussion #9

kevaundray opened this issue Aug 15, 2019 · 3 comments

Comments

@kevaundray
Copy link
Collaborator

  • In the external tests, for simplicity we use unwrap , the idiomatic way would be to use ? with a from trait for different types of Error enums.

  • Currently, we allow users to do hash.add(input) however because we can only have a limited amount of inputs, we must return a Result, in case they add more than width-1 scalars. A simpler API would be to just ask the user input a vec![input1, input2,] which would reduce the number of error enums. We could also have both approaches, in case the user does not know all of the inputs before they need to hash and does not want to create temporary values.

  • One possible change that could be made is to create two structs, one for the solid impl and another for gadget impl, however this will cause a lot of code duplication. Currently, there is one struct and a user will call a struct to indicate whether they want the gadget version or the solid impl

@kevaundray
Copy link
Collaborator Author

The first point is more of a nice to have as they are just external tests.

Second point; may just be inevitable unless we only allow users to add input as a vector which is not that user-friendly and will force the user to create a temporary vector if they have another use-case

@kevaundray
Copy link
Collaborator Author

Third point is being discussed in #12

@CPerezz
Copy link
Contributor

CPerezz commented Apr 15, 2020

This is no longer up-to-date with the status of the repo.

@CPerezz CPerezz closed this as completed Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants