Improve pallet-xcm-precompile docs (assets ordering)#58
Conversation
gonzamontiel
left a comment
There was a problem hiding this comment.
I see this as a necessary patch but I would soon add a function to automatically sort the assets.
Also, the type of sort that the users need to use is implicit. While it might be obvious, I would take the opportunity to be more precise (and maybe add an example).
|
I would specify that the order matters, and as you mention, that the fee index relates to the asset array. |
|
As discussed internally, we will add some examples for the assets ordering, and will work on a future PR containing the helper function to automatically sort the assets. |
|
Adding some context to this issue, the explanation below is copied from: paritytech/polkadot-sdk#2388 (comment)
|
What does it do?
Adds an extra line of description to the functions present in
pallet-xcm-precompile's interface.Basically, if we send assets that are not sorted and we specify a fee index, it may happen that the incorrect asset is used to pay for fees. This is because internally, we need to perform some conversions with the
Assetsstruct, which automatically sorts the assets being converted.The purpose of the new extra line of docs is to inform (and prevent) users about this behavior.