-
Notifications
You must be signed in to change notification settings - Fork 50
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
Impl Display for MultiLocation #15
Comments
I like this, I think non-rust API libraries and library users would benefit from this a lot. |
I believe it might be more appropriate to place this issue/RFC in the xcm-format repository. |
There's no strict guidance here, but RFC'ing every change like adding RFCs are generally meant to be for software architectural, design, and protocol documents. That said, a small RFC attempting to standardize a format for displaying XCM paths and junctions in an implementation-agnostic way could be fine, but it'd need to be comprehensive. |
In a number of occasions I've wanted to represent a
MultiLocation
in a short, url friendly way. (if something like it doesn't exist yet) I think we should have such a representation, e.g. similar to how aMultiAddress
are displayed.Before proposing an RFC it would be nice to hear some thoughts about possible ways to represent locations or if the feature is desired in the first place. The first format that naturally comes to mind on a high level is translating junctions into a URL-path-like format, with some prefix to represent parents(and version?), perhaps an "absolute path" representation as well.
Starting with
We can do something like
.N/(junction1)/(junctionX)
where N is the number of parents and junctions repeat separated by a/
. The "absolute path" can be to just omit the parents prefix and expect the first junction to be of typeGlobalConsensus
.Next, with current v3 we have
This junctions can have a long version that simply converts the enum variant to a lowercase snake version(e.g.
only_child
) and in case it's a tuple/struct variant we include the params wrapped in parentheses or squared brackets(for structs we ignore the name of the field), i.e.parachain(1000)
,account_id32(polkadot/11111111111111111111111111111111)
,account_index64(none/1)
,plurality(legislative/fraction[6/10])
.Now to actually make it short what about using a short form by default where we replace the long words with abbreviations or sigils that act as an alias, when using a sigil parenthesis/brackets could be omitted(?).
Here are some ideas ...
For example purposes only let's imagine for a moment there is a
xcm://
URI scheme to illustrate how several URL friendly multi-locations can be "rendered" together(also with multi-assets?) ...The text was updated successfully, but these errors were encountered: