Function assets_common::get_assets_in_pool_with
source · pub fn get_assets_in_pool_with<Runtime: Config<PoolId = (L, L)>, L: TryInto<Location> + Clone + Decode + EncodeLike + PartialEq>(
asset: &L,
) -> Result<Vec<AssetId>, ()>
Expand description
Returns an iterator of all assets in a pool with asset
.
Should only be used in runtime APIs since it iterates over the whole
pallet_asset_conversion::Pools
map.
It takes in any version of an XCM Location but always returns the latest one. This is to allow some margin of migrating the pools when updating the XCM version.
An error of type ()
is returned if the version conversion fails for XCM locations.
This error should be mapped by the caller to a more descriptive one.