[xcm] ConvertedConcreteId convert to MultiAsset (fungible) back-and-forth#6760
[xcm] ConvertedConcreteId convert to MultiAsset (fungible) back-and-forth#6760
ConvertedConcreteId convert to MultiAsset (fungible) back-and-forth#6760Conversation
07b8eb5 to
f9d4cb5
Compare
| Balance: Clone, | ||
| ConvertAssetId: Convert<MultiLocation, AssetId>, | ||
| ConvertBalance: Convert<u128, Balance>, | ||
| > Convert<(AssetId, Balance), MultiAsset> |
There was a problem hiding this comment.
@KiChjang
it would be cool and useful to have backwards conversion (AssetId, Balance) -> MultiAsset for ConvertedConcreteId/MatchedConvertedConcreteId automatically,
if I add the similar impl for ConvertedConcreteId for non-fungibles
impl<
ClassId: Clone,
InstanceId: Clone,
ConvertClassId: Convert<MultiLocation, ClassId>,
ConvertInstanceId: Convert<AssetInstance, InstanceId>,
> Convert<(ClassId, InstanceId), MultiAsset>
for ConvertedConcreteId<ClassId, InstanceId, ConvertClassId, ConvertInstanceId>
it errors with:
error[E0119]: conflicting implementations of trait
so maybe, some new trait to extend traits MatchesFungibles / MatchesNonFungibles or some other solution?
or we dont want to support this here?
There was a problem hiding this comment.
Could you first give some context as to what problem this PR is trying to solve? It's hard to reason about your solutions here when I don't have much idea what's going on.
There was a problem hiding this comment.
ok, sure, no problem, I updated here desc: #6760 (comment)
There was a problem hiding this comment.
Okay, but doesn't reverse_ref already does the thing that you expect it to?
|
@bkontur Is this PR still wanted? |
not really, closing |
related to the #6777
Context:
We started on work on runtime
FungiblesApito query all fungible assets from runtime for better UX/UI experience.This API could be used by all runtimes.
So in this first iteration we have api (Basti suggests to have it in Cumulus):
In Cumulus:
https://github.com/paritytech/cumulus/pull/2180/files#diff-5739a90b109dd72bff24e5e1d8a1e7854fb56fcd62d7174fcc6d838f495f52f0R34-R39
Or Polkadot:
https://github.com/paritytech/polkadot/pull/6777/files#diff-df0fea42045207170f8b159d2640ccfcd00da630bd57f38a2cca8a9ee79f698bR37-R42
So, in Cumulus for Statemine/Statemint/Westmint we have implementation, which reads account balances from
pallet_balancesand from multiple instances ofpallet_assets.For
pallet_assetswe useConvertedConreteId, which is going to be replaced byMatchedConvertedConcreteId, when this PR is merged.So, the idea behind this PR, is that
ConvertedConreteId/MatchedConvertedConcreteIddoes conversion fromMultiAsset->(AssetId, Balance), and it would be very useful, if it does the backwards also(AssetId, Balance)->MultiAssetto minimalize adding new code/custom conversions like this in every (Cumulus or whatever (para)chain) runtime.