mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-29 22:51:03 +00:00
Remove IncRefError, DecRefError and StoredMapError (#9384)
All of them are a subset of `DispatchError` anyway, no need to have special errors IMHO.
This commit is contained in:
@@ -516,15 +516,6 @@ impl From<crate::traits::BadOrigin> for DispatchError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<crate::traits::StoredMapError> for DispatchError {
|
||||
fn from(e: crate::traits::StoredMapError) -> Self {
|
||||
match e {
|
||||
crate::traits::StoredMapError::ConsumerRemaining => Self::ConsumerRemaining,
|
||||
crate::traits::StoredMapError::NoProviders => Self::NoProviders,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Description of what went wrong when trying to complete an operation on a token.
|
||||
#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
|
||||
@@ -152,25 +152,6 @@ impl From<BadOrigin> for &'static str {
|
||||
}
|
||||
}
|
||||
|
||||
/// Error that can be returned by our impl of `StoredMap`.
|
||||
#[derive(Encode, Decode, RuntimeDebug)]
|
||||
pub enum StoredMapError {
|
||||
/// Attempt to create map value when it is a consumer and there are no providers in place.
|
||||
NoProviders,
|
||||
/// Attempt to anull/remove value when it is the last provider and there is still at
|
||||
/// least one consumer left.
|
||||
ConsumerRemaining,
|
||||
}
|
||||
|
||||
impl From<StoredMapError> for &'static str {
|
||||
fn from(e: StoredMapError) -> &'static str {
|
||||
match e {
|
||||
StoredMapError::NoProviders => "No providers",
|
||||
StoredMapError::ConsumerRemaining => "Consumer remaining",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An error that indicates that a lookup failed.
|
||||
#[derive(Encode, Decode, RuntimeDebug)]
|
||||
pub struct LookupError;
|
||||
|
||||
Reference in New Issue
Block a user