-
Notifications
You must be signed in to change notification settings - Fork 47
chore: refactor some more XCM config stuff #457
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5440383
wip
ntn-x2 23d146e
Merge commit 'a12b0c8c526ff9e761da2227976617cbbbf11461' into aa/xcm-c…
ntn-x2 220fe92
Fix lock file
ntn-x2 af4593f
Change filters to Nothing for everything
ntn-x2 e20059c
More refactoring
ntn-x2 444b032
Merge commit '4353493d4e733fe94b6f77bc5c493ea1b00cf4d5' into aa/xcm-c…
ntn-x2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,20 +21,17 @@ use super::{ | |
| RuntimeOrigin, Treasury, WeightToFee, XcmpQueue, | ||
| }; | ||
|
|
||
| use frame_support::{ | ||
| parameter_types, | ||
| traits::{Everything, Nothing}, | ||
| }; | ||
| use frame_support::{parameter_types, traits::Nothing}; | ||
| use pallet_xcm::XcmPassthrough; | ||
| use xcm::latest::prelude::*; | ||
| use xcm_builder::{ | ||
| EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, RelayChainAsNative, SiblingParachainAsNative, | ||
| EnsureXcmOrigin, FixedWeightBounds, LocationInverter, RelayChainAsNative, SiblingParachainAsNative, | ||
| SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, UsingComponents, | ||
| }; | ||
| use xcm_executor::XcmExecutor; | ||
|
|
||
| use runtime_common::xcm_config::{ | ||
| LocalAssetTransactor, LocationToAccountId, MaxInstructions, RelayLocation, UnitWeightCost, XcmBarrier, | ||
| HereLocation, LocalAssetTransactor, LocationToAccountId, MaxInstructions, UnitWeightCost, XcmBarrier, | ||
| }; | ||
|
|
||
| parameter_types! { | ||
|
|
@@ -75,8 +72,8 @@ impl xcm_executor::Config for XcmConfig { | |
| // How to withdraw and deposit an asset. | ||
| type AssetTransactor = LocalAssetTransactor<Balances, RelayNetworkId>; | ||
| type OriginConverter = XcmOriginToTransactDispatchOrigin; | ||
| // We only trust our own KILT asset reserve. | ||
| type IsReserve = NativeAsset; | ||
| // Reserving is disabled. | ||
| type IsReserve = (); | ||
| // Teleporting is disabled. | ||
| type IsTeleporter = (); | ||
| // Invert a location. | ||
|
|
@@ -92,7 +89,7 @@ impl xcm_executor::Config for XcmConfig { | |
| // How weight is transformed into fees. The fees are not taken out of the | ||
| // Balances pallet here. Balances is only used if fees are dropped without being | ||
| // used. In that case they are put into the treasury. | ||
| type Trader = UsingComponents<WeightToFee<Runtime>, RelayLocation, AccountId, Balances, Treasury>; | ||
| type Trader = UsingComponents<WeightToFee<Runtime>, HereLocation, AccountId, Balances, Treasury>; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We allow unpaid execution from the relay chain. Plus, here we were saying that relay chain funds could be used to pay for the fees, when nothing else was allowed. I think keeping it local for now is the most logical choice. We will open up once we open up to other chains. |
||
| type ResponseHandler = PolkadotXcm; | ||
| // What happens with assets that are left in the register after the XCM message | ||
| // was processed. PolkadotXcm has an AssetTrap that stores a hash of the asset | ||
|
|
@@ -102,7 +99,8 @@ impl xcm_executor::Config for XcmConfig { | |
| type SubscriptionService = PolkadotXcm; | ||
| } | ||
|
|
||
| /// No local origins on this chain are allowed to dispatch XCM sends/executions. | ||
| /// Allows only local `Signed` origins to be converted into `MultiLocation`s by | ||
| /// the XCM executor. | ||
| pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetworkId>; | ||
|
|
||
| /// The means for routing XCM messages which are not for local execution into | ||
|
|
@@ -122,9 +120,9 @@ impl pallet_xcm::Config for Runtime { | |
| // Disable dispatchable execution on the XCM pallet. | ||
| // NOTE: For local testing this needs to be `Everything`. | ||
| type XcmExecuteFilter = Nothing; | ||
| type XcmExecutor = XcmExecutor<XcmConfig>; | ||
| type XcmTeleportFilter = Everything; | ||
| type XcmTeleportFilter = Nothing; | ||
| type XcmReserveTransferFilter = Nothing; | ||
| type XcmExecutor = XcmExecutor<XcmConfig>; | ||
| type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>; | ||
| type LocationInverter = LocationInverter<Ancestry>; | ||
| type RuntimeOrigin = RuntimeOrigin; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic refers to a network ID. So especially for the future it is clearer to give the generic the proper name.