Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

XCM v3: Bridge infrastructure #4186

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
4f2a52f
increase ump_service_total_weight's default value (#4127)
GopherJ Oct 30, 2021
ad019dd
differentiate log messages (#4183)
drahnr Oct 30, 2021
fb730e4
remove duplicate Deposit from OnUnbalanced implementation (#4180)
apopiak Oct 30, 2021
a6dd54e
collator-protocol/validator_side: a couple of fixes (#4179)
ordian Oct 30, 2021
0f5cf2d
XCM bridge infrastructure
gavofyork Oct 30, 2021
1a924d3
Revamped XCM proc macros; new NetworkIds
gavofyork Oct 31, 2021
4d6be64
Fixes
gavofyork Oct 31, 2021
1dec6cc
Formatting
gavofyork Oct 31, 2021
d9d5bc6
ExportMessage instruction and config type
gavofyork Oct 31, 2021
2fd3f81
Add MessageExporter definitions
gavofyork Oct 31, 2021
332e9ab
Formatting
gavofyork Oct 31, 2021
9b4975f
Missing files
gavofyork Oct 31, 2021
97104ab
Fixes
gavofyork Oct 31, 2021
89c595c
Initial bridging config API
gavofyork Oct 31, 2021
bbe8b11
bump rococo spec (#4189)
ordian Oct 31, 2021
96673f4
Allow for two-stage XCM execution
gavofyork Nov 2, 2021
fe807f0
Update xcm/src/v3/mod.rs
gavofyork Nov 2, 2021
9c1e709
Implement IntoIterator for Xcm and cargo fmt
KiChjang Nov 2, 2021
5a6b4ef
Bump dlmalloc from 0.2.1 to 0.2.2 (#4205)
dependabot[bot] Nov 2, 2021
4fe4d3f
Update GHA to s3krit/matrix-message-action@v0.0.3 + doc (#4030)
chevdor Nov 2, 2021
dc9a1bb
Bump libc from 0.2.105 to 0.2.106 (#4194)
dependabot[bot] Nov 2, 2021
60d3305
Update SimNet test to the new format (#4051)
radupopa2010 Nov 3, 2021
9ee52bd
Offchain: Disable http requests (#4188)
bkchr Nov 3, 2021
4fdec83
Update CI image to use the latest rustc (#4200)
alvicsam Nov 3, 2021
85ec699
More remote tests for bags-list pallet (#4065)
kianenigma Nov 3, 2021
94243bb
Bump tokio from 1.12.0 to 1.13.0 (#4193)
dependabot[bot] Nov 3, 2021
4685b25
Fix misleading logs in collator protocol. (#4201)
eskimor Nov 4, 2021
6841b72
minor doc chores (#4219)
drahnr Nov 4, 2021
7a53298
implement dispatch_as (#4075)
xlc Nov 4, 2021
81013be
Change path for the tests to master (#4223)
grbIzl Nov 4, 2021
d985794
fix(staking miner): use `StorageKey` in getStorage (#4231)
niklasad1 Nov 6, 2021
e553085
Update `bridge/` codeowners (#4222)
HCastano Nov 8, 2021
15c68e4
Fixes
gavofyork Nov 8, 2021
16bcb44
Fixes
gavofyork Nov 8, 2021
547bc8a
availability recovery type name clarifications (#4203)
drahnr Nov 8, 2021
e91b9d0
Increase maximum chunk size to adjust for small networks. (#4220)
eskimor Nov 9, 2021
174f339
update cargo lock to unbreak dep of a dep (#4245)
gnunicorn Nov 9, 2021
35d93c3
Update `wasmtime` and related dependencies (companion for Substrate#1…
koute Nov 9, 2021
ca8c968
Bump serde_json from 1.0.68 to 1.0.69 (#4236)
dependabot[bot] Nov 9, 2021
5085341
Bump paste from 1.0.5 to 1.0.6 (#4244)
dependabot[bot] Nov 9, 2021
002936b
Bump libc from 0.2.106 to 0.2.107 (#4235)
dependabot[bot] Nov 9, 2021
56d4cde
Bump dlmalloc from 0.2.2 to 0.2.3 (#4250)
dependabot[bot] Nov 9, 2021
f26e523
Bump mick-jaeger from 0.1.4 to 0.1.6 (#4249)
dependabot[bot] Nov 10, 2021
2d583c1
Update dependencies for latest substrate master (#4258)
gnunicorn Nov 10, 2021
5587267
Add more XCM tracing (#4211)
apopiak Nov 11, 2021
0a86997
Companion – Update jsonrpsee to 0.4.1 (#4256)
dvdplm Nov 11, 2021
83e5955
CI: chore (#3957)
TriplEight Nov 11, 2021
9e8b26f
Per subsystem CPU usage tracking (#4239)
sandreim Nov 11, 2021
a2244b6
collator-protocol: do not connect to the next group (#4261)
ordian Nov 11, 2021
dfc0167
Enable full use of pallet-bags-list in westend and kusama runtimes (#…
kianenigma Nov 12, 2021
14be5d5
Remove light client companion (#4191)
arkpar Nov 12, 2021
c18d42d
req/resp: use IfDisconnected::ImmediateError (#4253)
ordian Nov 12, 2021
e26984f
Increment the retired metric instead of spawned (#4269)
pepyakin Nov 12, 2021
db10793
Bump pwasm-utils to 0.18.2 (#4267)
pepyakin Nov 12, 2021
e4f16c5
chore: fmt should print version (#4274)
drahnr Nov 12, 2021
e0f4df5
3x8 update nightly fix fmt (#4241)
TriplEight Nov 12, 2021
0365f3c
Limit the number of PVF workers (#4273)
pepyakin Nov 13, 2021
903c6f2
PVF host prechecking support v2 (#4123)
slumber Nov 13, 2021
12df8e0
Bump hex-literal from 0.3.3 to 0.3.4 (#4264)
dependabot[bot] Nov 13, 2021
414ec0e
Increase preparation timeout (#4270)
pepyakin Nov 15, 2021
13c2695
bump versions (#4285)
s3krit Nov 15, 2021
f26005b
Tweaks to XCM for Benchmarking (#4283)
shawntabrizi Nov 15, 2021
a711993
Update event variants (#4262)
Wizdave97 Nov 16, 2021
f0160fb
Bump serde_json from 1.0.69 to 1.0.70 (#4284)
dependabot[bot] Nov 16, 2021
a6af5c4
Bump async-process from 1.1.0 to 1.3.0 (#4260)
dependabot[bot] Nov 16, 2021
c198d26
move paras inherent filtering to runtime (#4028)
drahnr Nov 16, 2021
e0295ed
Companion for substrate#9878 (#3949)
koushiro Nov 17, 2021
7ea6595
Substrate companion: Authority discovery multiple peer ids (#4295)
bkchr Nov 17, 2021
a26dd2a
Bump tokio from 1.13.0 to 1.14.0 (#4298)
dependabot[bot] Nov 17, 2021
e2ba1ee
Remove sort_unstable_by (#4314)
Lldenaurois Nov 17, 2021
97c3483
Bump strum from 0.22.0 to 0.23.0 (#4308)
dependabot[bot] Nov 17, 2021
d21e86d
Bump serde_json from 1.0.70 to 1.0.71 (#4316)
dependabot[bot] Nov 18, 2021
dba4f1a
Enable BEEFY explicitly (#4320)
andresilva Nov 18, 2021
06642de
prepare worker: Catch unexpected unwinds (#4304)
pepyakin Nov 18, 2021
8b81b13
fix pallet-xcm extrinsic doc comments (#4317)
apopiak Nov 18, 2021
6b8eb91
Use non-empty validation code (#4322)
pepyakin Nov 18, 2021
9d53834
Add missing license header (#4321)
pepyakin Nov 18, 2021
cceb775
export hrmp config (#4324)
GopherJ Nov 19, 2021
9f059fb
Dependabot: Ignore sub-tokens (#4328)
bkchr Nov 19, 2021
d488955
Dispute spam protection (#4134)
eskimor Nov 19, 2021
1ec4819
Log para inherent inputs (#4331)
emostov Nov 19, 2021
71e7670
remove provisioner checks (#4254)
drahnr Nov 19, 2021
16fb469
prefer code upgrades in inherent filtering (#4334)
drahnr Nov 19, 2021
58e4ef8
Companion for Taskmanager: Remove `clean_shutdown` (#4336)
bkchr Nov 19, 2021
cd9929f
Replicate Rob's PR (#4337)
Lldenaurois Nov 20, 2021
2ffb293
introduce malus + zombienet based integration tests (#4131)
pepoviola Nov 20, 2021
0549d9d
Bump libc from 0.2.107 to 0.2.108 (#4343)
dependabot[bot] Nov 22, 2021
7a530d0
use correct gh_dir env for zombienet (#4346)
pepoviola Nov 22, 2021
6fa464b
Add XCM pallet and config to Polkadot runtime (#4313)
NachoPal Nov 22, 2021
8952974
Inherent filtering follow up (#4305)
emostov Nov 23, 2021
ca38b56
add missing feature (#4355)
xlc Nov 24, 2021
f9358cc
Add Provisioner dispute metrics (#4352)
sandreim Nov 24, 2021
49bb226
Fix use of weight limit errors (#4358)
gavofyork Nov 24, 2021
8cd96d9
OCD: Remove ,) in PVF (#4362)
pepyakin Nov 24, 2021
0609dc7
add additional assurances to `create_inherent` (#4349)
drahnr Nov 24, 2021
024a927
fix provisioner metric docs (#4359)
sandreim Nov 24, 2021
b56a7b7
Fix spellcheck (#4363)
sandreim Nov 24, 2021
f6b6250
add disputes to Kusama runtime (#4356)
rphmeier Nov 24, 2021
6da31d0
[ci] Add ssh token for publishing gh-pages (#4347)
alvicsam Nov 25, 2021
745d3bc
Add Statemine as parachain 1000 to rococo trusted teleporters (#4312)
apopiak Nov 25, 2021
ff20f47
Merge remote-tracking branch 'origin/master' into gav-xcm-universal-o…
gavofyork Nov 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,12 +1288,13 @@ parameter_types! {
/// The location of the KSM token, from the context of this chain. Since this token is native to this
/// chain, we make it synonymous with it and thus it is the `Here` location, which means "equivalent to
/// the context".
pub const KsmLocation: MultiLocation = Here.into();
pub const TokenLocation: MultiLocation = Here.into_location();
/// The Kusama network ID. This is named.
pub const KusamaNetwork: NetworkId = NetworkId::Kusama;
/// Our XCM location ancestry - i.e. what, if anything, `Parent` means evaluated in our context. Since
/// Kusama is a top-level relay-chain, there is no ancestry.
pub const Ancestry: MultiLocation = Here.into();
pub const ThisNetwork: NetworkId = Kusama;
/// Our XCM location ancestry - i.e. our location within the Consensus Universe.
///
/// Since Kusama is a top-level relay-chain with its own consensus, it's just our network ID.
pub Ancestry: InteriorMultiLocation = ThisNetwork::get().into();
/// The check account, which holds any native assets that have been teleported out and not back in (yet).
pub CheckAccount: AccountId = XcmPallet::check_account();
}
Expand All @@ -1304,18 +1305,18 @@ pub type SovereignAccountOf = (
// We can convert a child parachain using the standard `AccountId` conversion.
ChildParachainConvertsVia<ParaId, AccountId>,
// We can directly alias an `AccountId32` into a local account.
AccountId32Aliases<KusamaNetwork, AccountId>,
AccountId32Aliases<ThisNetwork, AccountId>,
);

/// Our asset transactor. This is what allows us to interest with the runtime facilities from the point of
/// view of XCM-only concepts like `MultiLocation` and `MultiAsset`.
///
/// Ours is only aware of the Balances pallet, which is mapped to `KsmLocation`.
/// Ours is only aware of the Balances pallet, which is mapped to `TokenLocation`.
pub type LocalAssetTransactor = XcmCurrencyAdapter<
// Use this currency:
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<KsmLocation>,
IsConcrete<TokenLocation>,
// We can convert the MultiLocations with our converter above:
SovereignAccountOf,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
Expand All @@ -1331,7 +1332,7 @@ type LocalOriginConverter = (
// A child parachain, natively expressed, has the `Parachain` origin.
ChildParachainAsNative<parachains_origin::Origin, Origin>,
// The AccountId32 location type can be expressed natively as a `Signed` origin.
SignedAccountId32AsNative<KusamaNetwork, Origin>,
SignedAccountId32AsNative<ThisNetwork, Origin>,
// A system child parachain, expressed as a Superuser, converts to the `Root` origin.
ChildSystemParachainAsSuperuser<ParaId, Origin>,
);
Expand All @@ -1352,11 +1353,11 @@ pub type XcmRouter = (
);

parameter_types! {
pub const Kusama: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(KsmLocation::get()) });
pub const KusamaForStatemine: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Parachain(1000).into());
pub const Ksm: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const KsmForStatemine: (MultiAssetFilter, MultiLocation) = (Ksm::get(), Parachain(1000).into_location());
pub const MaxAssetsIntoHolding: u32 = 64;
}
pub type TrustedTeleporters = (xcm_builder::Case<KusamaForStatemine>,);
pub type TrustedTeleporters = (xcm_builder::Case<KsmForStatemine>,);

match_type! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
Expand Down Expand Up @@ -1390,13 +1391,16 @@ impl xcm_executor::Config for XcmConfig {
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
// The weight trader piggybacks on the existing transaction-fee conversion logic.
type Trader = UsingComponents<WeightToFee, KsmLocation, AccountId, Balances, ToAuthor<Runtime>>;
type Trader =
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
type PalletInstancesInfo = AllPallets;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type MessageExporter = ();
type UniversalAliases = Nothing;
}

parameter_types! {
Expand All @@ -1414,7 +1418,7 @@ pub type LocalOriginToLocation = (
CouncilBodyId,
>,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<Origin, AccountId, KusamaNetwork>,
SignedToAccountId32<Origin, AccountId, ThisNetwork>,
);
impl pallet_xcm::Config for Runtime {
type Event = Event;
Expand Down
41 changes: 22 additions & 19 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,20 +599,20 @@ impl parachains_paras::Config for Runtime {
}

parameter_types! {
pub const RocLocation: MultiLocation = Here.into();
pub const RococoNetwork: NetworkId = NetworkId::Polkadot;
pub const Ancestry: MultiLocation = Here.into();
pub const TokenLocation: MultiLocation = Here.into_location();
pub const ThisNetwork: NetworkId = NetworkId::Rococo;
pub Ancestry: InteriorMultiLocation = ThisNetwork::get().into();
pub CheckAccount: AccountId = XcmPallet::check_account();
}

pub type SovereignAccountOf =
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<RococoNetwork, AccountId>);
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<ThisNetwork, AccountId>);

pub type LocalAssetTransactor = XcmCurrencyAdapter<
// Use this currency:
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<RocLocation>,
IsConcrete<TokenLocation>,
// We can convert the MultiLocations with our converter above:
SovereignAccountOf,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
Expand All @@ -624,7 +624,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter<
type LocalOriginConverter = (
SovereignSignedViaLocation<SovereignAccountOf, Origin>,
ChildParachainAsNative<parachains_origin::Origin, Origin>,
SignedAccountId32AsNative<RococoNetwork, Origin>,
SignedAccountId32AsNative<ThisNetwork, Origin>,
ChildSystemParachainAsSuperuser<ParaId, Origin>,
);

Expand All @@ -640,21 +640,21 @@ pub type XcmRouter = (
);

parameter_types! {
pub const Rococo: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(RocLocation::get()) });
pub const RococoForTick: (MultiAssetFilter, MultiLocation) = (Rococo::get(), Parachain(100).into());
pub const RococoForTrick: (MultiAssetFilter, MultiLocation) = (Rococo::get(), Parachain(110).into());
pub const RococoForTrack: (MultiAssetFilter, MultiLocation) = (Rococo::get(), Parachain(120).into());
pub const RococoForRockmine: (MultiAssetFilter, MultiLocation) = (Rococo::get(), Parachain(1001).into());
pub const RococoForCanvas: (MultiAssetFilter, MultiLocation) = (Rococo::get(), Parachain(1002).into());
pub const Roc: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const RocForTick: (MultiAssetFilter, MultiLocation) = (Roc::get(), Parachain(100).into_location());
pub const RocForTrick: (MultiAssetFilter, MultiLocation) = (Roc::get(), Parachain(110).into_location());
pub const RocForTrack: (MultiAssetFilter, MultiLocation) = (Roc::get(), Parachain(120).into_location());
pub const RocForRockmine: (MultiAssetFilter, MultiLocation) = (Roc::get(), Parachain(1001).into_location());
pub const RocForCanvas: (MultiAssetFilter, MultiLocation) = (Roc::get(), Parachain(1002).into_location());
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
}
pub type TrustedTeleporters = (
xcm_builder::Case<RococoForTick>,
xcm_builder::Case<RococoForTrick>,
xcm_builder::Case<RococoForTrack>,
xcm_builder::Case<RococoForRockmine>,
xcm_builder::Case<RococoForCanvas>,
xcm_builder::Case<RocForTick>,
xcm_builder::Case<RocForTrick>,
xcm_builder::Case<RocForTrack>,
xcm_builder::Case<RocForRockmine>,
xcm_builder::Case<RocForCanvas>,
);

parameter_types! {
Expand Down Expand Up @@ -690,13 +690,16 @@ impl xcm_executor::Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, RocLocation, AccountId, Balances, ToAuthor<Runtime>>;
type Trader =
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
type PalletInstancesInfo = AllPallets;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type MessageExporter = ();
type UniversalAliases = Nothing;
}

parameter_types! {
Expand All @@ -710,7 +713,7 @@ pub type LocalOriginToLocation = (
// `Unit` body.
BackingToPlurality<Origin, pallet_collective::Origin<Runtime>, CollectiveBodyId>,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<Origin, AccountId, RococoNetwork>,
SignedToAccountId32<Origin, AccountId, ThisNetwork>,
);

impl pallet_xcm::Config for Runtime {
Expand Down
6 changes: 3 additions & 3 deletions runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl parachains_ump::Config for Runtime {

parameter_types! {
pub const BaseXcmWeight: frame_support::weights::Weight = 1_000;
pub const AnyNetwork: xcm::latest::NetworkId = xcm::latest::NetworkId::Any;
pub const AnyNetwork: Option<xcm::latest::NetworkId> = None;
pub const MaxInstructions: u32 = 100;
}

Expand Down Expand Up @@ -591,7 +591,7 @@ pub mod pallet_test_notifier {
.using_encoded(|mut d| <[u8; 32]>::decode(&mut d))
.map_err(|_| Error::<T>::BadAccountFormat)?;
let qid = pallet_xcm::Pallet::<T>::new_query(
Junction::AccountId32 { network: Any, id }.into(),
Junction::AccountId32 { network: None, id },
100u32.into(),
);
Self::deposit_event(Event::<T>::QueryPrepared(qid));
Expand All @@ -607,7 +607,7 @@ pub mod pallet_test_notifier {
let call =
Call::<T>::notification_received { query_id: 0, response: Default::default() };
let qid = pallet_xcm::Pallet::<T>::new_notify_query(
Junction::AccountId32 { network: Any, id }.into(),
Junction::AccountId32 { network: None, id },
<T as Config>::Call::from(call),
100u32.into(),
);
Expand Down
12 changes: 11 additions & 1 deletion runtime/test-runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use frame_support::{parameter_types, traits::Everything, weights::Weight};
use frame_support::{
parameter_types,
traits::{Everything, Nothing},
weights::Weight,
};
use xcm::latest::prelude::*;
use xcm_builder::{AllowUnpaidExecutionFrom, FixedWeightBounds, SignedToAccountId32};
use xcm_executor::{
Expand Down Expand Up @@ -72,6 +76,10 @@ impl InvertLocation for InvertNothing {
fn invert_location(_: &MultiLocation) -> sp_std::result::Result<MultiLocation, ()> {
Ok(Here.into())
}

fn universal_location() -> InteriorMultiLocation {
Here
}
}

pub struct XcmConfig;
Expand All @@ -92,4 +100,6 @@ impl xcm_executor::Config for XcmConfig {
type SubscriptionService = super::Xcm;
type PalletInstancesInfo = ();
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type MessageExporter = ();
type UniversalAliases = Nothing;
}
31 changes: 17 additions & 14 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,20 +926,20 @@ impl auctions::Config for Runtime {
}

parameter_types! {
pub const WndLocation: MultiLocation = Here.into();
pub const Ancestry: MultiLocation = Here.into();
pub WestendNetwork: NetworkId = NetworkId::Named(b"Westend".to_vec());
pub const TokenLocation: MultiLocation = Here.into_location();
pub const ThisNetwork: NetworkId = Westend;
pub Ancestry: InteriorMultiLocation = ThisNetwork::get().into();
pub CheckAccount: AccountId = XcmPallet::check_account();
}

pub type LocationConverter =
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<WestendNetwork, AccountId>);
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<ThisNetwork, AccountId>);

pub type LocalAssetTransactor = XcmCurrencyAdapter<
// Use this currency:
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<WndLocation>,
IsConcrete<TokenLocation>,
// We can convert the MultiLocations with our converter above:
LocationConverter,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
Expand All @@ -951,7 +951,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter<
type LocalOriginConverter = (
SovereignSignedViaLocation<LocationConverter, Origin>,
ChildParachainAsNative<parachains_origin::Origin, Origin>,
SignedAccountId32AsNative<WestendNetwork, Origin>,
SignedAccountId32AsNative<ThisNetwork, Origin>,
ChildSystemParachainAsSuperuser<ParaId, Origin>,
);

Expand All @@ -963,13 +963,13 @@ pub type XcmRouter = (
);

parameter_types! {
pub const Westmint: MultiLocation = Parachain(1000).into();
pub const WestendForWestmint: (MultiAssetFilter, MultiLocation) =
(Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }), Westmint::get());
pub const Westmint: MultiLocation = Parachain(1000).into_location();
pub const Wnd: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const WndForWestmint: (MultiAssetFilter, MultiLocation) = (Wnd::get(), Westmint::get());
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
}
pub type TrustedTeleporters = (xcm_builder::Case<WestendForWestmint>,);
pub type TrustedTeleporters = (xcm_builder::Case<WndForWestmint>,);

/// The barriers one of which must be passed for an XCM message to be executed.
pub type Barrier = (
Expand All @@ -996,20 +996,23 @@ impl xcm_executor::Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = WeightInfoBounds<weights::xcm::WestendXcmWeight<Call>, Call, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, WndLocation, AccountId, Balances, ToAuthor<Runtime>>;
type Trader =
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
type PalletInstancesInfo = AllPallets;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type MessageExporter = ();
type UniversalAliases = Nothing;
}

/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location
/// of this chain.
pub type LocalOriginToLocation = (
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<Origin, AccountId, WestendNetwork>,
SignedToAccountId32<Origin, AccountId, ThisNetwork>,
);

impl pallet_xcm::Config for Runtime {
Expand Down Expand Up @@ -1543,7 +1546,7 @@ sp_api::impl_runtime_apis! {
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Westmint::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WndLocation::get()) },
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(TokenLocation::get()) },
));
}

Expand All @@ -1555,7 +1558,7 @@ sp_api::impl_runtime_apis! {

fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(WndLocation::get()),
id: Concrete(TokenLocation::get()),
fun: Fungible(1 * UNITS),
}
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/westend/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ fn sanity_check_teleport_assets_weight() {
// so this test will certainly ensure that this problem does not occur.
use frame_support::dispatch::GetDispatchInfo;
let weight = pallet_xcm::Call::<Runtime>::teleport_assets {
dest: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::here())),
beneficiary: Box::new(xcm::VersionedMultiLocation::V1(MultiLocation::here())),
assets: Box::new((Concrete(MultiLocation::here()), Fungible(200_000)).into()),
dest: Box::new(Here.into()),
beneficiary: Box::new(Here.into()),
assets: Box::new((Here, 200_000).into()),
fee_asset_item: 0,
}
.get_dispatch_info()
Expand Down
1 change: 1 addition & 0 deletions scripts/gitlab/lingua.dic
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ sr25519
SSL
startup/MS
stateful
Statemine
str
struct/MS
subcommand/SM
Expand Down
Loading