mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-20 12:45:40 +00:00
Allow other pallets to check asset ids. (#12666)
* Make it easier for other pallets to check asset ids. * Avoid boxing * cargo fmt
This commit is contained in:
@@ -283,3 +283,14 @@ impl<T: Config<I>, I: 'static> fungibles::roles::Inspect<<T as SystemConfig>::Ac
|
||||
Asset::<T, I>::get(asset).map(|x| x.freezer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::InspectEnumerable<T::AccountId> for Pallet<T, I> {
|
||||
type AssetsIterator = KeyPrefixIterator<<T as Config<I>>::AssetId>;
|
||||
|
||||
/// Returns an iterator of the assets in existence.
|
||||
///
|
||||
/// NOTE: iterating this list invokes a storage read per item.
|
||||
fn asset_ids() -> Self::AssetsIterator {
|
||||
Asset::<T, I>::iter_keys()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user