mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +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:
@@ -29,7 +29,7 @@ impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> f
|
||||
}
|
||||
}
|
||||
|
||||
fn try_mutate_exists<R, E: From<StoredMapError>>(
|
||||
fn try_mutate_exists<R, E: From<DispatchError>>(
|
||||
id_who: &(T::AssetId, T::AccountId),
|
||||
f: impl FnOnce(&mut Option<T::Extra>) -> Result<R, E>,
|
||||
) -> Result<R, E> {
|
||||
@@ -46,11 +46,11 @@ impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> f
|
||||
if let Some(ref mut account) = maybe_account {
|
||||
account.extra = extra;
|
||||
} else {
|
||||
Err(StoredMapError::NoProviders)?;
|
||||
Err(DispatchError::NoProviders)?;
|
||||
}
|
||||
} else {
|
||||
// They want to delete it. Let this pass if the item never existed anyway.
|
||||
ensure!(maybe_account.is_none(), StoredMapError::ConsumerRemaining);
|
||||
ensure!(maybe_account.is_none(), DispatchError::ConsumerRemaining);
|
||||
}
|
||||
Ok(r)
|
||||
})
|
||||
|
||||
@@ -141,10 +141,7 @@ pub use types::*;
|
||||
use sp_std::{prelude::*, borrow::Borrow, convert::TryInto};
|
||||
use sp_runtime::{
|
||||
TokenError, ArithmeticError,
|
||||
traits::{
|
||||
AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, Bounded,
|
||||
StoredMapError,
|
||||
}
|
||||
traits::{AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, Bounded}
|
||||
};
|
||||
use codec::HasCompact;
|
||||
use frame_support::{ensure, dispatch::{DispatchError, DispatchResult}};
|
||||
|
||||
Reference in New Issue
Block a user