Add arithmetic dispatch errors. (#8726)

* Add arithmetic dispatch errors.

* Replace custom overflow errors.

* Replace custom underflow and division by zero errors.

* Replace overflow/underflow in token error.

* Add token and arithmetic errors in dispatch error equality test.

* Trigger CI.
This commit is contained in:
Shaun Wang
2021-05-10 20:14:02 +12:00
committed by GitHub
parent 655ebc95fb
commit 2a38b23062
12 changed files with 88 additions and 60 deletions
+1 -3
View File
@@ -140,7 +140,7 @@ pub use types::*;
use sp_std::{prelude::*, borrow::Borrow};
use sp_runtime::{
RuntimeDebug, TokenError, traits::{
RuntimeDebug, TokenError, ArithmeticError, traits::{
AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, Bounded,
StoredMapError,
}
@@ -326,8 +326,6 @@ pub mod pallet {
BadWitness,
/// Minimum balance should be non-zero.
MinBalanceZero,
/// A mint operation lead to an overflow.
Overflow,
/// No provider reference exists to allow a non-zero balance of a non-self-sufficient asset.
NoProvider,
/// Invalid metadata given.