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

Error Handling and Consumer Interface #62

Open
1 of 4 tasks
ControlCplusControlV opened this issue Dec 6, 2022 · 0 comments
Open
1 of 4 tasks

Error Handling and Consumer Interface #62

ControlCplusControlV opened this issue Dec 6, 2022 · 0 comments

Comments

@ControlCplusControlV
Copy link
Contributor

ControlCplusControlV commented Dec 6, 2022

Currently there are numerous unsafe unwrap()s everywhere, the the codebase should be refactor like such

  • - Remove all assert conditions, and instead return a result with an error matching what condition check failed. (So debugging isn't 64 != 39, but invalid root length, etc)
  • - Use contextual specific errors for internal functions (ie SerializationError on internal conversion functions) then on public facing errors wrap them in VerkleError with an all encompassing error. (This saves on passing an enum on every return in memory, and only for public functions where it is needed)
  • - Refactor use of .try_into().unwrap() with either safety comments, or more robust conversions
  • - Handle Option returns to either return a Result or safety comments if assumptions can be made
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

1 participant