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
Mostly places where you expect infallible code ( basically places where comments such as "cannot happen" , "should not happen", "it is safe because of previous condition" are found,)
Eg.
defensive_ok_or
defensive_saturating_add
etc.
This would be helpful in following way:
it panics on debug_assertion, which means if you reach this error in tests, it panics.
it logs error in production using runtime logging system. Which might help detecting potential problems.
The text was updated successfully, but these errors were encountered:
Consider using defensive traits
https://github.com/paritytech/substrate/blob/master/frame/support/src/traits/misc.rs
where it would be appropriate and helpful.
Mostly places where you expect infallible code ( basically places where comments such as "cannot happen" , "should not happen", "it is safe because of previous condition" are found,)
Eg.
This would be helpful in following way:
The text was updated successfully, but these errors were encountered: