[testnet] Align testnet system parachain runtimes using RelayTreasuryLocation and SystemParachains in the same way (#2023)

This PR addresses several issues:
- simplify referencing `RelayTreasuryLocation` without needing
additional `RelayTreasury` struct
- fix for referencing `SystemParachains` from parachain with `parents:
1` instead of `parents: 0`
- removed hard-coded constants and fix tests for `asset-hub-rococo`
which was merged to master after
https://github.com/paritytech/polkadot-sdk/pull/1726

---------

Co-authored-by: command-bot <>
This commit is contained in:
Branislav Kontur
2023-10-25 17:35:15 +02:00
committed by GitHub
parent c86b633695
commit f6560c2b72
12 changed files with 198 additions and 155 deletions
@@ -93,6 +93,7 @@ pub fn teleports_for_native_asset_works<
.with_session_keys(collator_session_keys.session_keys())
.with_safe_xcm_version(XCM_VERSION)
.with_para_id(runtime_para_id.into())
.with_tracing()
.build()
.execute_with(|| {
let mut alice = [0u8; 32];
@@ -111,7 +112,7 @@ pub fn teleports_for_native_asset_works<
let native_asset_id = MultiLocation::parent();
let buy_execution_fee_amount_eta =
WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0));
WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 1024));
let native_asset_amount_unit = existential_deposit;
let native_asset_amount_received =
native_asset_amount_unit * 10.into() + buy_execution_fee_amount_eta.into();
@@ -128,7 +129,7 @@ pub fn teleports_for_native_asset_works<
id: Concrete(native_asset_id),
fun: Fungible(buy_execution_fee_amount_eta),
},
weight_limit: Limited(Weight::from_parts(303531000, 65536)),
weight_limit: Limited(Weight::from_parts(3035310000, 65536)),
},
DepositAsset {
assets: Wild(AllCounted(1)),
@@ -182,6 +182,14 @@ pub fn limited_reserve_transfer_assets_for_native_asset_works<
weight_limit,
));
// check pallet_xcm attempted
RuntimeHelper::<Runtime, AllPalletsWithoutSystem>::assert_pallet_xcm_event_outcome(
&unwrap_pallet_xcm_event,
|outcome| {
assert_ok!(outcome.ensure_complete());
},
);
// check alice account decreased by balance_to_transfer
// TODO:check-parameter: change and assert in tests when (https://github.com/paritytech/polkadot-sdk/pull/1234) merged
assert_eq!(
@@ -196,15 +204,6 @@ pub fn limited_reserve_transfer_assets_for_native_asset_works<
existential_deposit + balance_to_transfer.into()
);
// check events
// check pallet_xcm attempted
RuntimeHelper::<Runtime, AllPalletsWithoutSystem>::assert_pallet_xcm_event_outcome(
&unwrap_pallet_xcm_event,
|outcome| {
assert_ok!(outcome.ensure_complete());
},
);
// check that xcm was sent
let xcm_sent_message_hash = <frame_system::Pallet<Runtime>>::events()
.into_iter()