xcm: Do not require Asset to be sorted on decode#9842
Conversation
`Asset` was requiring that all the assets are sorted at decoding. This is quite confusing for people writingg frontends, because this is not really documented anywhere. There are also only at max 20 assets available, we can just make everyones life easier and always sort the assets after decoding.
|
/cmd prdoc --audience runtime_user --bump patch |
…time_user --bump patch'
franciscoaguirre
left a comment
There was a problem hiding this comment.
Thanks for this 😁
|
Something to take into consideration: there are extrinsics (like |
That is really sub-optimal :) |
|
OMG thank you @bkchr. This was 💩 for ages. |
|
@bkchr just checking if this will still work?
|
As long as the assets are ordered, yes. But we discussed this in the Xcm channel and all these methods which take a fixed index are deprecated and should be replaced by assetid or something like this to not be bound to the ordering of the assets when addressing them. |
|
Great, thanks @bkchr. I missed the thread, but I have read it now - I agree. Link to the thread, incase anyone else comes across this PR. |
`Asset` was requiring that all the assets are sorted at decoding. This is quite confusing for people writingg frontends, because this is not really documented anywhere. There are also only at max 20 assets available, we can just make everyones life easier and always sort the assets after decoding. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
`Asset` was requiring that all the assets are sorted at decoding. This is quite confusing for people writingg frontends, because this is not really documented anywhere. There are also only at max 20 assets available, we can just make everyones life easier and always sort the assets after decoding. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
… specify asset for fees (#10243) Multiple pallet-xcm calls use `u32` index as a way to specify which asset from the `assets` (also an arg of the call) is to be used for fees purposes. This PR brings **major API change (breaking change)** that proposes usage of `VersionedAssetId` instead Affected pallet-xcm calls: `teleport_assets`, `reserve_transfer_assets`, `limited_reserve_transfer_assets`, `limited_teleport_assets`, `transfer_assets` This is follow-up change to the: #9842, that aims to remove the requirement of the client to provide sorted list of Assets to the APIs (often a point failures). With the mentioned change sorting happens on the runtime side and `u32` index (provided by the client) can become invalid after sorting (this PR aims that problem) Relevant [dicussion](https://matrix.to/#/!nYxxyvMNMUaniRIokh:parity.io/$gAcAEznmQL6LhUlvGPHSaePUV4cZtxoco2I6ap8Cn3Q?via=parity.io&via=matrix.org&via=web3.foundation) on XCM public element channel --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
… specify asset for fees (#10243) Multiple pallet-xcm calls use `u32` index as a way to specify which asset from the `assets` (also an arg of the call) is to be used for fees purposes. This PR brings **major API change (breaking change)** that proposes usage of `VersionedAssetId` instead Affected pallet-xcm calls: `teleport_assets`, `reserve_transfer_assets`, `limited_reserve_transfer_assets`, `limited_teleport_assets`, `transfer_assets` This is follow-up change to the: #9842, that aims to remove the requirement of the client to provide sorted list of Assets to the APIs (often a point failures). With the mentioned change sorting happens on the runtime side and `u32` index (provided by the client) can become invalid after sorting (this PR aims that problem) Relevant [dicussion](https://matrix.to/#/!nYxxyvMNMUaniRIokh:parity.io/$gAcAEznmQL6LhUlvGPHSaePUV4cZtxoco2I6ap8Cn3Q?via=parity.io&via=matrix.org&via=web3.foundation) on XCM public element channel --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Assetwas requiring that all the assets are sorted at decoding. This is quite confusing for people writingg frontends, because this is not really documented anywhere. There are also only at max 20 assets available, we can just make everyones life easier and always sort the assets after decoding.