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

feat: add xcm transacting support #97

Merged
merged 61 commits into from
Jun 8, 2021
Merged

feat: add xcm transacting support #97

merged 61 commits into from
Jun 8, 2021

Conversation

mattsse
Copy link
Contributor

@mattsse mattsse commented Jun 7, 2021

Changes

  • Adds support for dispatching pallet_proxy and pallet_staking calls on different chains
  • Since the various parachains may use types other than configured for PINT, it is necessary to encode the calls depending on their destination
  • Therefor the EncodeWith trait was introduced which is intended as wrapper around code::Encode but with an additional context provided (AssetId or Location) to encode the type properly
  • Each pallet (staking, proxy) require their own Encoder type inside the remote asset manager, they ensure that the calls are encoded correctly and will be configured in the runtime.

Builds on #79

Tests

cargo test

Issues

@mattsse mattsse requested a review from clearloop June 7, 2021 10:31
@mattsse mattsse added the needs review PR needs reviewing label Jun 7, 2021
@clearloop
Copy link
Contributor

Is there any reference for XCM calls? The structure here seems like a pallet?

Copy link
Contributor

@clearloop clearloop left a comment

Choose a reason for hiding this comment

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

Rename remote-asset-manager/src/calls.rs to remote-asset-manager/src/calls/mod.rs?

Or move the calls to /root/primitives/xcm-calls ?

pallets/remote-asset-manager/Cargo.toml Show resolved Hide resolved
pallets/remote-asset-manager/Cargo.toml Show resolved Hide resolved
pallets/remote-asset-manager/src/calls/proxy.rs Outdated Show resolved Hide resolved
pallets/remote-asset-manager/src/calls/staking.rs Outdated Show resolved Hide resolved
@mattsse
Copy link
Contributor Author

mattsse commented Jun 7, 2021

Is there any reference for XCM calls? The structure here seems like a pallet?

Here are the expanded versions of the staking pallet
pallet-staking-expanded.rs.txt

and the polkadot runtime
polkadot-expanded.rs.txt

@mattsse
Copy link
Contributor Author

mattsse commented Jun 7, 2021

Rename remote-asset-manager/src/calls.rs to remote-asset-manager/src/calls/mod.rs?

Or move the calls to /root/primitives/xcm-calls ?

I like the idea of moving this to primitives!

@clearloop
Copy link
Contributor

Is there any reference for XCM calls? The structure here seems like a pallet?

Here are the expanded versions of the staking pallet
pallet-staking-expanded.rs.txt

and the polkadot runtime
polkadot-expanded.rs.txt

Emmmm, this calls is from polkadot/runtime/polkadot/src/lib.rs.... amazming..

@mattsse
Copy link
Contributor Author

mattsse commented Jun 7, 2021

The relevant decoding happens upon arrival XCM Transact here:

https://github.com/paritytech/polkadot/blob/master/xcm/xcm-executor/src/lib.rs#L172-L177

@@ -0,0 +1 @@
License: LGPL-3.0-only
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add links like

To this README so that we can trace the new updates easily from the upstream when we need to update this pallet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, will add links and will also reference them in the docs

@clearloop clearloop added approved PR approved to merge and removed needs review PR needs reviewing labels Jun 8, 2021
@mattsse mattsse merged commit ffaac9f into main Jun 8, 2021
@mattsse mattsse deleted the matt/xcm-transacting branch June 8, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR approved to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for transacting pallet_proxy calls
2 participants