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

pallet-xcm: enhance reserve_transfer_assets to support remote reserves #1672

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
43ef694
asset-hubs runtimes: add xcm reserve transfer tests
acatangiu Sep 5, 2023
945b34c
pallet-xcm: filter assets teleports based on XcmExecutor configuration
acatangiu Sep 21, 2023
ce215a1
xcm: MultiLocation: add .chain_location() helper function
acatangiu Sep 20, 2023
a5fd746
pallet-xcm: enchance reserve_transfer_assets() to support various res…
acatangiu Sep 25, 2023
c581d76
use correct fees beneficiary on assets reserve chain
acatangiu Sep 25, 2023
fe52d48
build dest-reserve and remote-reserve XCM programs
acatangiu Sep 26, 2023
5d847e3
deduplicate teleport and reserve transfer tests
acatangiu Sep 26, 2023
026a779
add test cases plan
acatangiu Sep 26, 2023
4465c65
add pallet-assets to mock test runtime
acatangiu Sep 26, 2023
2392dd9
fix add assets to mock pallet-xcm runtime
acatangiu Sep 26, 2023
67daafe
add test for asset-reserve and fee-reserve both at destination
acatangiu Sep 27, 2023
88b3024
add test for asset-reserve and fee-reserve both at remote chain
acatangiu Sep 27, 2023
513e15a
add test for asset-reserve at destination while fee-reserve is local
acatangiu Sep 27, 2023
19eec17
add test for asset local-reserve while fee-reserve is destination
acatangiu Sep 27, 2023
1687c53
add test for asset local-reserve while fee-reserve is remote chain
acatangiu Sep 27, 2023
abf029d
refactor tests using better naming and conceptual examples
acatangiu Sep 27, 2023
576c770
add test for asset destination-reserve while fee-reserve is remote chain
acatangiu Sep 28, 2023
280c4b1
fix some typos
acatangiu Sep 28, 2023
bab8fc2
deduplicate code for do_teleport_assets()
acatangiu Sep 28, 2023
f7a4a2e
add test for asset local-reserve while teleporting fees
acatangiu Sep 28, 2023
f88de5e
add test for asset destination-reserve while teleporting fees
acatangiu Sep 28, 2023
f7abb0a
fix cases when asset reserve is remote, add test remote-asset and tel…
acatangiu Sep 28, 2023
7b920ec
add test for transfer asset remote reserve and fee local reserve
acatangiu Sep 28, 2023
3130566
add test for transfer asset remote reserve and fee destination reserve
acatangiu Sep 28, 2023
1b17e84
disallow teleportable assets in reserve-transfer, add regression test
acatangiu Sep 29, 2023
84e213a
asset-hubs: fix emulated tests and deduplicate code
acatangiu Sep 29, 2023
ce00c28
asset-hubs: use non-system para IDs in tests where non-system paras a…
acatangiu Sep 29, 2023
1dfcd01
pallet-xcm: refactor newly added tests
acatangiu Sep 29, 2023
24f9b72
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 10, 2023
022ef71
pallet-xcm: fix benchmarks
acatangiu Oct 10, 2023
9827c3b
fix pallet-xcm benchmarks for all runtimes
acatangiu Oct 10, 2023
23588a8
address review comments
acatangiu Oct 11, 2023
931e093
expose TransferType through XcmExecutor::traits::AssetTransferSupport…
acatangiu Oct 11, 2023
bf39726
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 11, 2023
8ac30aa
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 13, 2023
09badd6
allow transfer for non-fungible assets too
acatangiu Oct 13, 2023
648ba8a
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 19, 2023
f8e8b4a
fix merge damage
acatangiu Oct 20, 2023
71bd4b3
fmt
acatangiu Oct 23, 2023
4ab90f7
pallet-xcm: split asset transfer tests to own file
acatangiu Oct 23, 2023
3070994
address review comments
acatangiu Oct 23, 2023
f045c73
pallet-xcm: disallow combining remote reserves with other xfer types
acatangiu Oct 23, 2023
fe93ef4
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 23, 2023
d1a9709
xcm-barriers: allow SetFeesMode in BuyExecution barrier and fix tests
acatangiu Oct 23, 2023
50d844f
verify assets and beneficiary in over-bridge test
acatangiu Oct 24, 2023
0bf64e6
fix AHs tests
acatangiu Oct 24, 2023
c711961
AHs: fix emulated tests
acatangiu Oct 24, 2023
67929a5
AHs: include delivery-fee checking in tests
acatangiu Oct 24, 2023
dd46f23
fix runtime-benchmarks for AHRococo
acatangiu Oct 24, 2023
e8cbcb9
fix clippy
acatangiu Oct 24, 2023
d725103
withdraw fees before buyexecution - still broken because of executor …
acatangiu Oct 25, 2023
3d97f19
pallet-xcm: uses single custom XCM to send both fees and assets
acatangiu Oct 25, 2023
ac3773e
pallet-xcm: handle teleport checking account when custom burn+teleport
acatangiu Oct 25, 2023
cb6f53a
fixes plus tests
acatangiu Oct 25, 2023
560d788
fix pallet-xcm tests
acatangiu Oct 25, 2023
3bc2d73
fix AHs tests
acatangiu Oct 25, 2023
f838cd5
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 26, 2023
bd60203
remove unused SetFeesMode instruction
acatangiu Oct 26, 2023
2e71447
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 27, 2023
371ac2d
pallet-xcm: fix broken reserve_transfer_assets benchmark
acatangiu Oct 26, 2023
9b58ff0
try add pallet-assets for benchmarking to rococo
acatangiu Oct 27, 2023
942977e
Revert "try add pallet-assets for benchmarking to rococo"
acatangiu Oct 27, 2023
3b9965b
pallet-xcm benchmarking: most chains do not have pallet-assets, use p…
acatangiu Oct 27, 2023
adcd688
pallet-xcm: fix teleport_assets benchmark
acatangiu Oct 27, 2023
eca0c3e
fix runtimes benchmarks for pallet-xcm
acatangiu Oct 27, 2023
b648df2
AHs simplify test_cases_over_bridge
acatangiu Oct 27, 2023
da7d8ff
runtimes: add dedicated benchmarking config for pallet-xcm
acatangiu Oct 27, 2023
8d85faa
AHs benchmarks: fix transfer to sibling parachain
acatangiu Oct 28, 2023
37552fd
Update polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs
acatangiu Oct 30, 2023
6714d39
Update polkadot/xcm/pallet-xcm/src/lib.rs
acatangiu Oct 30, 2023
a79ed78
Merge branch 'master' into pallet-xcm-fully-support-reserve-transfers
acatangiu Oct 30, 2023
7a61129
fmt
acatangiu Oct 30, 2023
0f76530
Update polkadot/xcm/xcm-builder/src/barriers.rs
acatangiu Oct 31, 2023
9d3f2dd
Update polkadot/xcm/pallet-xcm/src/lib.rs
acatangiu Oct 31, 2023
9feb4b0
Update polkadot/xcm/pallet-xcm/src/lib.rs
acatangiu Oct 31, 2023
0a38b70
Update polkadot/xcm/pallet-xcm/src/lib.rs
acatangiu Oct 31, 2023
02447d0
fmt
acatangiu Oct 31, 2023
84e3e29
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Oct 31, 2023
b67cb0f
xcm-emulator: configure penpal for asset transfers and enhance existi…
acatangiu Nov 1, 2023
ec87ce6
xcm-emulator: add relay to penpal native transfer test
acatangiu Nov 1, 2023
da3c12e
xcm-emulator: add ah to penpal native asset transfer test
acatangiu Nov 1, 2023
ac9bf49
xcm: MultiLocation::chain_location() takes nonmut reference
acatangiu Nov 1, 2023
e85e339
pallet-xcm: benchmarks: enforce single asset transfer at the api level
acatangiu Nov 1, 2023
9f7538d
xcm-executor: rename AssetTransferSupport to XcmAssetTransfer
acatangiu Nov 1, 2023
45279cc
clippy
acatangiu Nov 1, 2023
59cf104
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 1, 2023
e9c7205
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 2, 2023
6ba36f8
AssetHub tests: account for Westend higher delivery fees
acatangiu Nov 2, 2023
7728527
fix merge damage
acatangiu Nov 2, 2023
a4089c8
Added withdraw reserve to scripts
bkontur Nov 2, 2023
44e1918
bridge-hub-westend-runtime: fix benchmarks
acatangiu Nov 2, 2023
a59ccf3
xcm-emulator: add ah to penpal multiple mixed assets transfer test
acatangiu Nov 3, 2023
27c7cea
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 3, 2023
582c616
fix merge damage
acatangiu Nov 3, 2023
94aaffd
remove limited from test names, all transfers use limited method now
acatangiu Nov 3, 2023
fe2cb6a
barriers: allow withdrawing multiple assets in AllowTopLevelPaidExecu…
acatangiu Nov 5, 2023
2ebefc0
pallet-xcm: add trace logs
acatangiu Nov 6, 2023
839af41
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 6, 2023
56c52f1
fix runtime-benchmarks
acatangiu Nov 6, 2023
669e109
Merge branch 'master' into pallet-xcm-fully-support-reserve-transfers
acatangiu Nov 6, 2023
ba91cd6
pallet-xcm: fix tests
acatangiu Nov 6, 2023
8951238
xcm-emulator: remove unused pallet import
acatangiu Nov 7, 2023
dd2a06f
xcm-barrier: enforce MAX_ASSETS_FOR_BUY_EXECUTION
acatangiu Nov 7, 2023
6d67ea1
rename some variables and fns
acatangiu Nov 7, 2023
db1e826
add explicit incomplete local execution error
acatangiu Nov 7, 2023
54d7465
rename fns
acatangiu Nov 7, 2023
39e7b66
pallet-xcm: fix pallet extrinsic default weights
acatangiu Nov 7, 2023
ceddec5
pallet-xcm: also buy execution as part of custom fee handling
acatangiu Nov 8, 2023
7f78c73
pallet-xcm: fix lossy fees math
acatangiu Nov 8, 2023
45131b1
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 8, 2023
cb8226d
fix merge damage
acatangiu Nov 8, 2023
d0c8944
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 8, 2023
c5522e4
fix merge damage
acatangiu Nov 8, 2023
9827904
Merge branch 'master' of github.com:paritytech/polkadot-sdk into pall…
acatangiu Nov 13, 2023
0cc32e3
fix merge damage
acatangiu Nov 13, 2023
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
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions cumulus/parachain-template/runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ pub type XcmRouter = WithUniqueTopic<(
XcmpQueue,
)>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -180,8 +175,6 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = LocationToAccountId;
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frame_support::traits::OnInitialize;
// Cumulus
use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_assets_helpers_for_system_parachain, xcm_emulator::decl_test_parachains,
impl_assets_helpers_for_parachain, xcm_emulator::decl_test_parachains,
};
use rococo_emulated_chain::Rococo;

Expand Down Expand Up @@ -51,5 +51,5 @@ decl_test_parachains! {

// AssetHubRococo implementation
impl_accounts_helpers_for_parachain!(AssetHubRococo);
impl_assert_events_helpers_for_parachain!(AssetHubRococo);
impl_assets_helpers_for_system_parachain!(AssetHubRococo, Rococo);
impl_assert_events_helpers_for_parachain!(AssetHubRococo, false);
impl_assets_helpers_for_parachain!(AssetHubRococo, Rococo);
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frame_support::traits::OnInitialize;
// Cumulus
use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_assets_helpers_for_system_parachain, xcm_emulator::decl_test_parachains,
impl_assets_helpers_for_parachain, xcm_emulator::decl_test_parachains,
};
use westend_emulated_chain::Westend;

Expand Down Expand Up @@ -51,5 +51,5 @@ decl_test_parachains! {

// AssetHubWestend implementation
impl_accounts_helpers_for_parachain!(AssetHubWestend);
impl_assert_events_helpers_for_parachain!(AssetHubWestend);
impl_assets_helpers_for_system_parachain!(AssetHubWestend, Westend);
impl_assert_events_helpers_for_parachain!(AssetHubWestend, false);
impl_assets_helpers_for_parachain!(AssetHubWestend, Westend);
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use frame_support::traits::OnInitialize;
// Cumulus
use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_assets_helpers_for_system_parachain, xcm_emulator::decl_test_parachains,
impl_assets_helpers_for_parachain, xcm_emulator::decl_test_parachains,
};
use wococo_emulated_chain::Wococo;

Expand Down Expand Up @@ -49,5 +49,5 @@ decl_test_parachains! {

// AssetHubWococo implementation
impl_accounts_helpers_for_parachain!(AssetHubWococo);
impl_assert_events_helpers_for_parachain!(AssetHubWococo);
impl_assets_helpers_for_system_parachain!(AssetHubWococo, Wococo);
impl_assert_events_helpers_for_parachain!(AssetHubWococo, false);
impl_assets_helpers_for_parachain!(AssetHubWococo, Wococo);
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ decl_test_parachains! {

// BridgeHubRococo implementation
impl_accounts_helpers_for_parachain!(BridgeHubRococo);
impl_assert_events_helpers_for_parachain!(BridgeHubRococo);
impl_assert_events_helpers_for_parachain!(BridgeHubRococo, false);
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ decl_test_parachains! {

// BridgeHubWestend implementation
impl_accounts_helpers_for_parachain!(BridgeHubWestend);
impl_assert_events_helpers_for_parachain!(BridgeHubWestend);
impl_assert_events_helpers_for_parachain!(BridgeHubWestend, false);
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ decl_test_parachains! {

// BridgeHubWococo implementation
impl_accounts_helpers_for_parachain!(BridgeHubWococo);
impl_assert_events_helpers_for_parachain!(BridgeHubWococo);
impl_assert_events_helpers_for_parachain!(BridgeHubWococo, false);
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ parachains-common = { path = "../../../../../../../parachains/common" }
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
penpal-runtime = { path = "../../../../../../runtimes/testing/penpal" }
rococo-emulated-chain = { path = "../../../relays/rococo" }
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ use frame_support::traits::OnInitialize;

// Cumulus
use emulated_integration_tests_common::{
impl_assert_events_helpers_for_parachain, xcm_emulator::decl_test_parachains,
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_assets_helpers_for_parachain, xcm_emulator::decl_test_parachains,
};
use rococo_emulated_chain::Rococo;

// Penpal Parachain declaration
decl_test_parachains! {
Expand All @@ -40,6 +42,7 @@ decl_test_parachains! {
pallets = {
PolkadotXcm: penpal_runtime::PolkadotXcm,
Assets: penpal_runtime::Assets,
Balances: penpal_runtime::Balances,
}
},
pub struct PenpalB {
Expand All @@ -56,10 +59,13 @@ decl_test_parachains! {
pallets = {
PolkadotXcm: penpal_runtime::PolkadotXcm,
Assets: penpal_runtime::Assets,
Balances: penpal_runtime::Balances,
}
},
}

// Penpal implementation
impl_assert_events_helpers_for_parachain!(PenpalA);
impl_assert_events_helpers_for_parachain!(PenpalB);
impl_accounts_helpers_for_parachain!(PenpalA);
impl_assets_helpers_for_parachain!(PenpalA, Rococo);
impl_assert_events_helpers_for_parachain!(PenpalA, true);
impl_assert_events_helpers_for_parachain!(PenpalB, true);
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ decl_test_relay_chains! {
on_init = (),
runtime = westend_runtime,
core = {
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf,
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter,
},
pallets = {
XcmPallet: westend_runtime::XcmPallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ macro_rules! impl_accounts_helpers_for_parachain {

#[macro_export]
macro_rules! impl_assert_events_helpers_for_parachain {
( $chain:ident ) => {
( $chain:ident, $ignore_weight:expr ) => {
$crate::impls::paste::paste! {
type [<$chain RuntimeEvent>]<N> = <$chain<N> as $crate::impls::Chain>::RuntimeEvent;

Expand All @@ -412,7 +412,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
[<$chain RuntimeEvent>]::<N>::PolkadotXcm(
$crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Complete(weight) }
) => {
weight: $crate::impls::weight_within_threshold(
weight: $ignore_weight || $crate::impls::weight_within_threshold(
($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD),
expected_weight.unwrap_or(*weight),
*weight
Expand All @@ -434,7 +434,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
[<$chain RuntimeEvent>]::<N>::PolkadotXcm(
$crate::impls::pallet_xcm::Event::Attempted { outcome: $crate::impls::Outcome::Incomplete(weight, error) }
) => {
weight: $crate::impls::weight_within_threshold(
weight: $ignore_weight || $crate::impls::weight_within_threshold(
($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD),
expected_weight.unwrap_or(*weight),
*weight
Expand Down Expand Up @@ -490,7 +490,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
[<$chain RuntimeEvent>]::<N>::MessageQueue($crate::impls::pallet_message_queue::Event::Processed {
success: true, weight_used: weight, ..
}) => {
weight: $crate::impls::weight_within_threshold(
weight: $ignore_weight || $crate::impls::weight_within_threshold(
($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD),
expected_weight.unwrap_or(*weight),
*weight
Expand All @@ -510,7 +510,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
[<$chain RuntimeEvent>]::<N>::MessageQueue($crate::impls::pallet_message_queue::Event::Processed {
success: false, weight_used: weight, ..
}) => {
weight: $crate::impls::weight_within_threshold(
weight: $ignore_weight || $crate::impls::weight_within_threshold(
($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD),
expected_weight.unwrap_or(*weight),
*weight
Expand Down Expand Up @@ -541,7 +541,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
vec![
[<$chain RuntimeEvent>]::<N>::MessageQueue($crate::impls::pallet_message_queue::Event::Processed { success: true, weight_used: weight, .. }
) => {
weight: $crate::impls::weight_within_threshold(
weight: $ignore_weight || $crate::impls::weight_within_threshold(
($crate::impls::REF_TIME_THRESHOLD, $crate::impls::PROOF_SIZE_THRESHOLD),
expected_weight.unwrap_or(*weight),
*weight
Expand All @@ -556,7 +556,7 @@ macro_rules! impl_assert_events_helpers_for_parachain {
}

#[macro_export]
macro_rules! impl_assets_helpers_for_system_parachain {
macro_rules! impl_assets_helpers_for_parachain {
( $chain:ident, $relay_chain:ident ) => {
$crate::impls::paste::paste! {
impl<N: $crate::impls::Network> $chain<N> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ frame-support = { path = "../../../../../../../substrate/frame/support", default
pallet-balances = { path = "../../../../../../../substrate/frame/balances", default-features = false}
pallet-assets = { path = "../../../../../../../substrate/frame/assets", default-features = false}
pallet-asset-conversion = { path = "../../../../../../../substrate/frame/asset-conversion", default-features = false}
pallet-message-queue = { path = "../../../../../../../substrate/frame/message-queue", default-features = false }

# Polkadot
xcm = { package = "staging-xcm", path = "../../../../../../../polkadot/xcm", default-features = false}
Expand All @@ -28,5 +29,6 @@ rococo-runtime = { path = "../../../../../../../polkadot/runtime/rococo" }
asset-test-utils = { path = "../../../../../runtimes/assets/test-utils" }
parachains-common = { path = "../../../../../../parachains/common" }
asset-hub-rococo-runtime = { path = "../../../../../runtimes/assets/asset-hub-rococo" }
emulated-integration-tests-common = { path = "../../../common", default-features = false}
emulated-integration-tests-common = { path = "../../../common", default-features = false }
penpal-runtime = { path = "../../../../../runtimes/testing/penpal" }
rococo-system-emulated-network ={ path = "../../../networks/rococo-system" }
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,20 @@ pub const ASSET_MIN_BALANCE: u128 = 1000;
pub const ASSETS_PALLET_ID: u8 = 50;

pub type RelayToSystemParaTest = Test<Rococo, AssetHubRococo>;
pub type RelayToParaTest = Test<Rococo, PenpalA>;
pub type SystemParaToRelayTest = Test<AssetHubRococo, Rococo>;
pub type SystemParaToParaTest = Test<AssetHubRococo, PenpalA>;
pub type ParaToSystemParaTest = Test<PenpalA, AssetHubRococo>;

/// Returns a `TestArgs` instance to de used for the Relay Chain accross integraton tests
pub fn relay_test_args(amount: Balance) -> TestArgs {
/// Returns a `TestArgs` instance to be used for the Relay Chain across integration tests
pub fn relay_test_args(
dest: MultiLocation,
beneficiary_id: AccountId32,
amount: Balance,
) -> TestArgs {
TestArgs {
dest: Rococo::child_location_of(AssetHubRococo::para_id()),
beneficiary: AccountId32Junction {
network: None,
id: AssetHubRococoReceiver::get().into(),
}
.into(),
dest,
beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(),
amount,
assets: (Here, amount).into(),
asset_id: None,
Expand All @@ -81,21 +83,22 @@ pub fn relay_test_args(amount: Balance) -> TestArgs {
}
}

/// Returns a `TestArgs` instance to de used for the System Parachain accross integraton tests
pub fn system_para_test_args(
/// Returns a `TestArgs` instance to be used by parachains across integration tests
pub fn para_test_args(
dest: MultiLocation,
beneficiary_id: AccountId32,
amount: Balance,
assets: MultiAssets,
asset_id: Option<u32>,
fee_asset_item: u32,
) -> TestArgs {
TestArgs {
dest,
beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(),
amount,
assets,
asset_id,
fee_asset_item: 0,
fee_asset_item,
weight_limit: WeightLimit::Unlimited,
}
}
Expand Down
Loading