pallet assets: Fix errors (#4118)

`LiveAsset` is an error to be returned when an asset is not supposed to
be live.
And `AssetNotLive` is an error to be returned when an asset is supposed
to be live, I don't think frozen qualifies as live.
This commit is contained in:
gui
2024-04-16 03:45:44 +09:00
committed by GitHub
parent 0c9ad5306c
commit a8f4f4f00f
5 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -491,7 +491,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let d = Asset::<T, I>::get(&id).ok_or(Error::<T, I>::Unknown)?;
ensure!(
d.status == AssetStatus::Live || d.status == AssetStatus::Frozen,
Error::<T, I>::AssetNotLive
Error::<T, I>::IncorrectStatus
);
let actual = Self::decrease_balance(id.clone(), target, amount, f, |actual, details| {