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
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
shawntabrizi opened this issue
Apr 6, 2021
· 2 comments
· Fixed by #8726
Labels
Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Almost any pallet dealing with numbers will be checking at some point for overflows / underflows in their math.
Each pallet that wants to do that will need to write a custom Error into their pallet for that.
I think Overflow is generic enough that it could fit into the DispatchError enum, and thus be accessible to all pallets without any extra code.
To complete this issue, all existing uses of custom Overflow or Underflow errors should be replaced with DispatchError::Overflow
The text was updated successfully, but these errors were encountered:
shawntabrizi
added
Z1-easy
Can be fixed primarily by duplicating and adapting code by an intermediate coder
Z6-mentor
An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
labels
Apr 6, 2021
If overflow/underflow has an static str, it would be easier to tell which part could overflow. It's helpful when a dispatchable call has multiple overflow/underflow checks for different data.
I think a DispatchError::Arithmetic(ArithmeticError) might be more generic, to handle all common calculation errors, including overflow/underflow, division by zero etc.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Almost any pallet dealing with numbers will be checking at some point for overflows / underflows in their math.
Each pallet that wants to do that will need to write a custom Error into their pallet for that.
I think
Overflow
is generic enough that it could fit into theDispatchError
enum, and thus be accessible to all pallets without any extra code.To complete this issue, all existing uses of custom
Overflow
orUnderflow
errors should be replaced withDispatchError::Overflow
The text was updated successfully, but these errors were encountered: