You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Currently there are numerous unsafe
unwrap()
s everywhere, the the codebase should be refactor like suchassert
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)SerializationError
on internal conversion functions) then on public facing errors wrap them inVerkleError
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).try_into().unwrap()
with either safety comments, or more robust conversionsOption
returns to either return a Result or safety comments if assumptions can be madeThe text was updated successfully, but these errors were encountered: