mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
add integration tests to xcm-builder (#3537)
* add integration tests to xcm-builder * add an integration test for reserve_transfer_assets * add query holding and teleport tests * formatting * add to barrier doc comments and fix doc tests warnings * use more realistic barrier for integration tests * improve imports * adjust base xcm weight and existential deposit to be in line with Kusama * remove AnyNetwork Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * add more comments and remove unnecessary code * move mock into separate file * reduce imports * update cargo.lock * remove reserve transfer test from xcm builder integration tests * reword barrier doc comment * elaborate on QueryHolding test scenario * add an integration test for reserve based transfers from parachain to parachain * add teleport tests * fix failing teleport filter tests * Update xcm/xcm-builder/src/integration_tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update xcm/xcm-builder/src/integration_tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update xcm/xcm-builder/src/integration_tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Move integration tests to tests/ directory * Fix merge * Replace All wildcard with a concrete seed amount * Rename SEED_AMOUNT to REGISTER_AMOUNT * Fix compilation error * Check for teleport destination first before checking out assets * Fix unit test * Do not run tests in integration mock * Add a permissive assets filter for teleportation * Remove check for teleport location in InitiateTeleport XCM * Remove defunct test * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Reword comment Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@ use xcm::{
|
||||
opaque::latest::{Error as XcmError, MultiAsset, Result as XcmResult, SendXcm, Xcm},
|
||||
};
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
|
||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, Case, ChildParachainAsNative,
|
||||
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
|
||||
CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, FixedWeightBounds, IsConcrete,
|
||||
LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
|
||||
@@ -151,6 +151,7 @@ type LocalOriginConverter = (
|
||||
parameter_types! {
|
||||
pub const BaseXcmWeight: Weight = 1_000;
|
||||
pub CurrencyPerSecond: (AssetId, u128) = (Concrete(RelayLocation::get()), 1);
|
||||
pub TrustedAssets: (MultiAssetFilter, MultiLocation) = (All.into(), Here.into());
|
||||
}
|
||||
|
||||
pub type Barrier = (TakeWeightCredit, AllowTopLevelPaidExecutionFrom<Everything>);
|
||||
@@ -162,7 +163,7 @@ impl xcm_executor::Config for XcmConfig {
|
||||
type AssetTransactor = LocalAssetTransactor;
|
||||
type OriginConverter = LocalOriginConverter;
|
||||
type IsReserve = ();
|
||||
type IsTeleporter = ();
|
||||
type IsTeleporter = Case<TrustedAssets>;
|
||||
type LocationInverter = LocationInverter<Ancestry>;
|
||||
type Barrier = Barrier;
|
||||
type Weigher = FixedWeightBounds<BaseXcmWeight, Call>;
|
||||
|
||||
Reference in New Issue
Block a user