Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pallet-xcm-precompile docs (assets ordering) #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Agusrodri
Copy link
Contributor

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 Assets struct, 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.

Copy link

@gonzamontiel gonzamontiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@stiiifff
Copy link

I would specify that the order matters, and as you mention, that the fee index relates to the asset array.

@Agusrodri
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants