mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
[xcm-emulator] Unignore cumulus integration tests (#1247)
* tests should not be run with runtime-benchmarks feature
This commit is contained in:
@@ -33,3 +33,19 @@ asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusam
|
|||||||
# Local
|
# Local
|
||||||
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
||||||
integration-tests-common = { path = "../../common", default-features = false}
|
integration-tests-common = { path = "../../common", default-features = false}
|
||||||
|
|
||||||
|
[features]
|
||||||
|
runtime-benchmarks = [
|
||||||
|
"asset-hub-kusama-runtime/runtime-benchmarks",
|
||||||
|
"frame-support/runtime-benchmarks",
|
||||||
|
"frame-system/runtime-benchmarks",
|
||||||
|
"integration-tests-common/runtime-benchmarks",
|
||||||
|
"pallet-asset-conversion/runtime-benchmarks",
|
||||||
|
"pallet-assets/runtime-benchmarks",
|
||||||
|
"pallet-balances/runtime-benchmarks",
|
||||||
|
"pallet-xcm/runtime-benchmarks",
|
||||||
|
"polkadot-parachain-primitives/runtime-benchmarks",
|
||||||
|
"polkadot-runtime-parachains/runtime-benchmarks",
|
||||||
|
"polkadot-runtime/runtime-benchmarks",
|
||||||
|
"sp-runtime/runtime-benchmarks",
|
||||||
|
]
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ pub use integration_tests_common::{
|
|||||||
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
|
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
|
||||||
AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, Kusama,
|
AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, Kusama,
|
||||||
KusamaPallet, KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet,
|
KusamaPallet, KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet,
|
||||||
PenpalKusamaAReceiver, PenpalKusamaASender,
|
PenpalKusamaAReceiver, PenpalKusamaASender, PenpalKusamaB, PenpalKusamaBPallet,
|
||||||
};
|
};
|
||||||
pub use parachains_common::{AccountId, Balance};
|
pub use parachains_common::{AccountId, Balance};
|
||||||
pub use xcm::{
|
pub use xcm::{
|
||||||
@@ -87,4 +87,5 @@ pub fn system_para_test_args(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
+2
-1
@@ -21,7 +21,6 @@ const MAX_MESSAGE_SIZE: u32 = 8192;
|
|||||||
|
|
||||||
/// Opening HRMP channels between Parachains should work
|
/// Opening HRMP channels between Parachains should work
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn open_hrmp_channel_between_paras_works() {
|
fn open_hrmp_channel_between_paras_works() {
|
||||||
// Parchain A init values
|
// Parchain A init values
|
||||||
let para_a_id = PenpalKusamaA::para_id();
|
let para_a_id = PenpalKusamaA::para_id();
|
||||||
@@ -110,6 +109,8 @@ fn open_hrmp_channel_between_paras_works() {
|
|||||||
PenpalKusamaB::assert_xcm_pallet_sent();
|
PenpalKusamaB::assert_xcm_pallet_sent();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
PenpalKusamaB::execute_with(|| {});
|
||||||
|
|
||||||
Kusama::execute_with(|| {
|
Kusama::execute_with(|| {
|
||||||
type RuntimeEvent = <Kusama as Chain>::RuntimeEvent;
|
type RuntimeEvent = <Kusama as Chain>::RuntimeEvent;
|
||||||
|
|
||||||
|
|||||||
+59
-58
@@ -126,72 +126,73 @@ fn send_transact_native_from_system_para_to_relay_fails() {
|
|||||||
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
||||||
/// in the System Parachain
|
/// in the System Parachain
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
||||||
// let para_sovereign_account = AssetHubKusama::sovereign_account_id_of(
|
let para_sovereign_account = AssetHubKusama::sovereign_account_id_of(
|
||||||
// AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()),
|
AssetHubKusama::sibling_location_of(PenpalKusamaA::para_id()),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // Force create and mint assets for Parachain's sovereign account
|
// Force create and mint assets for Parachain's sovereign account
|
||||||
// AssetHubKusama::force_create_and_mint_asset(
|
AssetHubKusama::force_create_and_mint_asset(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// true,
|
true,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// ASSET_MIN_BALANCE * 1000000000,
|
ASSET_MIN_BALANCE * 1000000000,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // We just need a call that can pass the `SafeCallFilter`
|
// We just need a call that can pass the `SafeCallFilter`
|
||||||
// // Call values are not relevant
|
// Call values are not relevant
|
||||||
// let call = AssetHubKusama::force_create_asset_call(
|
let call = AssetHubKusama::force_create_asset_call(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// true,
|
true,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// let origin_kind = OriginKind::SovereignAccount;
|
let origin_kind = OriginKind::SovereignAccount;
|
||||||
// let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
||||||
// let native_asset =
|
let native_asset =
|
||||||
// (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
(X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
||||||
|
|
||||||
// let root_origin = <PenpalKusamaA as Chain>::RuntimeOrigin::root();
|
let root_origin = <PenpalKusamaA as Chain>::RuntimeOrigin::root();
|
||||||
// let system_para_destination =
|
let system_para_destination =
|
||||||
// PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()).into();
|
PenpalKusamaA::sibling_location_of(AssetHubKusama::para_id()).into();
|
||||||
// let xcm = xcm_transact_paid_execution(
|
let xcm = xcm_transact_paid_execution(
|
||||||
// call,
|
call,
|
||||||
// origin_kind,
|
origin_kind,
|
||||||
// native_asset,
|
native_asset,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// PenpalKusamaA::execute_with(|| {
|
PenpalKusamaA::execute_with(|| {
|
||||||
// assert_ok!(<PenpalKusamaA as PenpalKusamaAPallet>::PolkadotXcm::send(
|
assert_ok!(<PenpalKusamaA as PenpalKusamaAPallet>::PolkadotXcm::send(
|
||||||
// root_origin,
|
root_origin,
|
||||||
// bx!(system_para_destination),
|
bx!(system_para_destination),
|
||||||
// bx!(xcm),
|
bx!(xcm),
|
||||||
// ));
|
));
|
||||||
|
|
||||||
// PenpalKusamaA::assert_xcm_pallet_sent();
|
PenpalKusamaA::assert_xcm_pallet_sent();
|
||||||
// });
|
});
|
||||||
|
|
||||||
// AssetHubKusama::execute_with(|| {
|
PenpalKusamaA::execute_with(|| {});
|
||||||
// type RuntimeEvent = <AssetHubKusama as Chain>::RuntimeEvent;
|
|
||||||
|
|
||||||
// AssetHubKusama::assert_xcmp_queue_success(Some(Weight::from_parts(2_176_414_000, 203_593)));
|
AssetHubKusama::execute_with(|| {
|
||||||
|
type RuntimeEvent = <AssetHubKusama as Chain>::RuntimeEvent;
|
||||||
|
|
||||||
// assert_expected_events!(
|
AssetHubKusama::assert_xcmp_queue_success(Some(Weight::from_parts(2_176_414_000, 203_593)));
|
||||||
// AssetHubKusama,
|
|
||||||
// vec![
|
assert_expected_events!(
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
AssetHubKusama,
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
vec![
|
||||||
// owner: *owner == para_sovereign_account,
|
RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
||||||
// balance: *balance == fee_amount,
|
asset_id: *asset_id == ASSET_ID,
|
||||||
// },
|
owner: *owner == para_sovereign_account,
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
balance: *balance == fee_amount,
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
},
|
||||||
// },
|
RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
||||||
// ]
|
asset_id: *asset_id == ASSET_ID,
|
||||||
// );
|
},
|
||||||
// });
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -187,7 +187,6 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() {
|
|||||||
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
||||||
/// should work when there is enough balance in Relay Chain's `CheckAccount`
|
/// should work when there is enough balance in Relay Chain's `CheckAccount`
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
||||||
// Dependency - Relay Chain's `CheckAccount` should have enough balance
|
// Dependency - Relay Chain's `CheckAccount` should have enough balance
|
||||||
limited_teleport_native_assets_from_relay_to_system_para_works();
|
limited_teleport_native_assets_from_relay_to_system_para_works();
|
||||||
@@ -226,7 +225,6 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
|||||||
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
||||||
/// should't work when there is not enough balance in Relay Chain's `CheckAccount`
|
/// should't work when there is not enough balance in Relay Chain's `CheckAccount`
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
|
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
|
||||||
// Init values for Relay Chain
|
// Init values for Relay Chain
|
||||||
let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000;
|
let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000;
|
||||||
|
|||||||
@@ -32,3 +32,19 @@ asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusam
|
|||||||
# Local
|
# Local
|
||||||
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
||||||
integration-tests-common = { path = "../../common", default-features = false}
|
integration-tests-common = { path = "../../common", default-features = false}
|
||||||
|
|
||||||
|
[features]
|
||||||
|
runtime-benchmarks = [
|
||||||
|
"asset-hub-kusama-runtime/runtime-benchmarks",
|
||||||
|
"frame-support/runtime-benchmarks",
|
||||||
|
"frame-system/runtime-benchmarks",
|
||||||
|
"integration-tests-common/runtime-benchmarks",
|
||||||
|
"pallet-asset-conversion/runtime-benchmarks",
|
||||||
|
"pallet-assets/runtime-benchmarks",
|
||||||
|
"pallet-balances/runtime-benchmarks",
|
||||||
|
"pallet-xcm/runtime-benchmarks",
|
||||||
|
"polkadot-parachain-primitives/runtime-benchmarks",
|
||||||
|
"polkadot-runtime-parachains/runtime-benchmarks",
|
||||||
|
"polkadot-runtime/runtime-benchmarks",
|
||||||
|
"sp-runtime/runtime-benchmarks",
|
||||||
|
]
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ pub use integration_tests_common::{
|
|||||||
},
|
},
|
||||||
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
|
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
|
||||||
AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender,
|
AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender,
|
||||||
PenpalPolkadotA, PenpalPolkadotAReceiver, Polkadot, PolkadotPallet, PolkadotReceiver,
|
PenpalPolkadotA, PenpalPolkadotAPallet, PenpalPolkadotAReceiver, PenpalPolkadotB,
|
||||||
PolkadotSender,
|
PenpalPolkadotBPallet, Polkadot, PolkadotPallet, PolkadotReceiver, PolkadotSender,
|
||||||
};
|
};
|
||||||
pub use parachains_common::{AccountId, Balance};
|
pub use parachains_common::{AccountId, Balance};
|
||||||
pub use xcm::{
|
pub use xcm::{
|
||||||
@@ -87,4 +87,5 @@ pub fn system_para_test_args(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
+2
-1
@@ -21,7 +21,6 @@ const MAX_MESSAGE_SIZE: u32 = 8192;
|
|||||||
|
|
||||||
/// Opening HRMP channels between Parachains should work
|
/// Opening HRMP channels between Parachains should work
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn open_hrmp_channel_between_paras_works() {
|
fn open_hrmp_channel_between_paras_works() {
|
||||||
// Parchain A init values
|
// Parchain A init values
|
||||||
let para_a_id = PenpalPolkadotA::para_id();
|
let para_a_id = PenpalPolkadotA::para_id();
|
||||||
@@ -110,6 +109,8 @@ fn open_hrmp_channel_between_paras_works() {
|
|||||||
PenpalPolkadotB::assert_xcm_pallet_sent();
|
PenpalPolkadotB::assert_xcm_pallet_sent();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
PenpalPolkadotB::execute_with(|| {});
|
||||||
|
|
||||||
Polkadot::execute_with(|| {
|
Polkadot::execute_with(|| {
|
||||||
type RuntimeEvent = <Polkadot as Chain>::RuntimeEvent;
|
type RuntimeEvent = <Polkadot as Chain>::RuntimeEvent;
|
||||||
|
|
||||||
|
|||||||
+62
-61
@@ -129,75 +129,76 @@ fn send_transact_native_from_system_para_to_relay_fails() {
|
|||||||
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
||||||
/// in the System Parachain
|
/// in the System Parachain
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
||||||
// let para_sovereign_account = AssetHubPolkadot::sovereign_account_id_of(
|
let para_sovereign_account = AssetHubPolkadot::sovereign_account_id_of(
|
||||||
// AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()),
|
AssetHubPolkadot::sibling_location_of(PenpalPolkadotA::para_id()),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // Force create and mint assets for Parachain's sovereign account
|
// Force create and mint assets for Parachain's sovereign account
|
||||||
// AssetHubPolkadot::force_create_and_mint_asset(
|
AssetHubPolkadot::force_create_and_mint_asset(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// true,
|
true,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// ASSET_MIN_BALANCE * 1000000000,
|
ASSET_MIN_BALANCE * 1000000000,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // We just need a call that can pass the `SafeCallFilter`
|
// We just need a call that can pass the `SafeCallFilter`
|
||||||
// // Call values are not relevant
|
// Call values are not relevant
|
||||||
// let call = AssetHubPolkadot::force_create_asset_call(
|
let call = AssetHubPolkadot::force_create_asset_call(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// true,
|
true,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// let origin_kind = OriginKind::SovereignAccount;
|
let origin_kind = OriginKind::SovereignAccount;
|
||||||
// let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
||||||
// let native_asset =
|
let native_asset =
|
||||||
// (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
(X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
||||||
|
|
||||||
// let root_origin = <PenpalPolkadotA as Chain>::RuntimeOrigin::root();
|
let root_origin = <PenpalPolkadotA as Chain>::RuntimeOrigin::root();
|
||||||
// let system_para_destination =
|
let system_para_destination =
|
||||||
// PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()).into();
|
PenpalPolkadotA::sibling_location_of(AssetHubPolkadot::para_id()).into();
|
||||||
// let xcm = xcm_transact_paid_execution(
|
let xcm = xcm_transact_paid_execution(
|
||||||
// call,
|
call,
|
||||||
// origin_kind,
|
origin_kind,
|
||||||
// native_asset,
|
native_asset,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// PenpalPolkadotA::execute_with(|| {
|
PenpalPolkadotA::execute_with(|| {
|
||||||
// assert_ok!(<PenpalPolkadotA as PenpalPolkadotAPallet>::PolkadotXcm::send(
|
assert_ok!(<PenpalPolkadotA as PenpalPolkadotAPallet>::PolkadotXcm::send(
|
||||||
// root_origin,
|
root_origin,
|
||||||
// bx!(system_para_destination),
|
bx!(system_para_destination),
|
||||||
// bx!(xcm),
|
bx!(xcm),
|
||||||
// ));
|
));
|
||||||
|
|
||||||
// PenpalPolkadotA::assert_xcm_pallet_sent();
|
PenpalPolkadotA::assert_xcm_pallet_sent();
|
||||||
// });
|
});
|
||||||
|
|
||||||
// AssetHubPolkadot::execute_with(|| {
|
PenpalPolkadotA::execute_with(|| {});
|
||||||
// type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
|
||||||
|
|
||||||
// AssetHubPolkadot::assert_xcmp_queue_success(Some(Weight::from_parts(
|
AssetHubPolkadot::execute_with(|| {
|
||||||
// 2_176_414_000,
|
type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
||||||
// 203_593,
|
|
||||||
// )));
|
|
||||||
|
|
||||||
// assert_expected_events!(
|
AssetHubPolkadot::assert_xcmp_queue_success(Some(Weight::from_parts(
|
||||||
// AssetHubPolkadot,
|
2_176_414_000,
|
||||||
// vec![
|
203_593,
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
)));
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
|
||||||
// owner: *owner == para_sovereign_account,
|
assert_expected_events!(
|
||||||
// balance: *balance == fee_amount,
|
AssetHubPolkadot,
|
||||||
// },
|
vec![
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
asset_id: *asset_id == ASSET_ID,
|
||||||
// },
|
owner: *owner == para_sovereign_account,
|
||||||
// ]
|
balance: *balance == fee_amount,
|
||||||
// );
|
},
|
||||||
// });
|
RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
||||||
|
asset_id: *asset_id == ASSET_ID,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,3 +33,19 @@ asset-hub-westend-runtime = { path = "../../../../runtimes/assets/asset-hub-west
|
|||||||
# Local
|
# Local
|
||||||
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
xcm-emulator = { path = "../../../../../xcm/xcm-emulator", default-features = false}
|
||||||
integration-tests-common = { path = "../../common", default-features = false}
|
integration-tests-common = { path = "../../common", default-features = false}
|
||||||
|
|
||||||
|
[features]
|
||||||
|
runtime-benchmarks = [
|
||||||
|
"asset-hub-westend-runtime/runtime-benchmarks",
|
||||||
|
"frame-support/runtime-benchmarks",
|
||||||
|
"frame-system/runtime-benchmarks",
|
||||||
|
"integration-tests-common/runtime-benchmarks",
|
||||||
|
"pallet-asset-conversion/runtime-benchmarks",
|
||||||
|
"pallet-assets/runtime-benchmarks",
|
||||||
|
"pallet-balances/runtime-benchmarks",
|
||||||
|
"pallet-xcm/runtime-benchmarks",
|
||||||
|
"polkadot-parachain-primitives/runtime-benchmarks",
|
||||||
|
"polkadot-runtime-parachains/runtime-benchmarks",
|
||||||
|
"polkadot-runtime/runtime-benchmarks",
|
||||||
|
"sp-runtime/runtime-benchmarks",
|
||||||
|
]
|
||||||
|
|||||||
@@ -89,4 +89,5 @@ pub fn system_para_test_args(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
+62
-61
@@ -68,75 +68,76 @@ fn send_transact_sudo_from_relay_to_system_para_works() {
|
|||||||
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
/// Parachain should be able to send XCM paying its fee with sufficient asset
|
||||||
/// in the System Parachain
|
/// in the System Parachain
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
|
||||||
// let para_sovereign_account = AssetHubWestend::sovereign_account_id_of(
|
let para_sovereign_account = AssetHubWestend::sovereign_account_id_of(
|
||||||
// AssetHubWestend::sibling_location_of(PenpalWestendA::para_id()),
|
AssetHubWestend::sibling_location_of(PenpalWestendA::para_id()),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // Force create and mint assets for Parachain's sovereign account
|
// Force create and mint assets for Parachain's sovereign account
|
||||||
// AssetHubWestend::force_create_and_mint_asset(
|
AssetHubWestend::force_create_and_mint_asset(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// true,
|
true,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// ASSET_MIN_BALANCE * 1000000000,
|
ASSET_MIN_BALANCE * 1000000000,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // We just need a call that can pass the `SafeCallFilter`
|
// We just need a call that can pass the `SafeCallFilter`
|
||||||
// // Call values are not relevant
|
// Call values are not relevant
|
||||||
// let call = AssetHubWestend::force_create_asset_call(
|
let call = AssetHubWestend::force_create_asset_call(
|
||||||
// ASSET_ID,
|
ASSET_ID,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// true,
|
true,
|
||||||
// ASSET_MIN_BALANCE,
|
ASSET_MIN_BALANCE,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// let origin_kind = OriginKind::SovereignAccount;
|
let origin_kind = OriginKind::SovereignAccount;
|
||||||
// let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
let fee_amount = ASSET_MIN_BALANCE * 1000000;
|
||||||
// let native_asset =
|
let native_asset =
|
||||||
// (X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
(X2(PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())), fee_amount).into();
|
||||||
|
|
||||||
// let root_origin = <PenpalWestendA as Chain>::RuntimeOrigin::root();
|
let root_origin = <PenpalWestendA as Chain>::RuntimeOrigin::root();
|
||||||
// let system_para_destination =
|
let system_para_destination =
|
||||||
// PenpalWestendA::sibling_location_of(AssetHubWestend::para_id()).into();
|
PenpalWestendA::sibling_location_of(AssetHubWestend::para_id()).into();
|
||||||
// let xcm = xcm_transact_paid_execution(
|
let xcm = xcm_transact_paid_execution(
|
||||||
// call,
|
call,
|
||||||
// origin_kind,
|
origin_kind,
|
||||||
// native_asset,
|
native_asset,
|
||||||
// para_sovereign_account.clone(),
|
para_sovereign_account.clone(),
|
||||||
// );
|
);
|
||||||
|
|
||||||
// PenpalWestendA::execute_with(|| {
|
PenpalWestendA::execute_with(|| {
|
||||||
// assert_ok!(<PenpalWestendA as PenpalWestendAPallet>::PolkadotXcm::send(
|
assert_ok!(<PenpalWestendA as PenpalWestendAPallet>::PolkadotXcm::send(
|
||||||
// root_origin,
|
root_origin,
|
||||||
// bx!(system_para_destination),
|
bx!(system_para_destination),
|
||||||
// bx!(xcm),
|
bx!(xcm),
|
||||||
// ));
|
));
|
||||||
|
|
||||||
// PenpalWestendA::assert_xcm_pallet_sent();
|
PenpalWestendA::assert_xcm_pallet_sent();
|
||||||
// });
|
});
|
||||||
|
|
||||||
// AssetHubWestend::execute_with(|| {
|
PenpalWestendA::execute_with(|| {});
|
||||||
// type RuntimeEvent = <AssetHubWestend as Chain>::RuntimeEvent;
|
|
||||||
|
|
||||||
// AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts(
|
AssetHubWestend::execute_with(|| {
|
||||||
// 2_176_414_000,
|
type RuntimeEvent = <AssetHubWestend as Chain>::RuntimeEvent;
|
||||||
// 203_593,
|
|
||||||
// )));
|
|
||||||
|
|
||||||
// assert_expected_events!(
|
AssetHubWestend::assert_xcmp_queue_success(Some(Weight::from_parts(
|
||||||
// AssetHubWestend,
|
2_176_414_000,
|
||||||
// vec![
|
203_593,
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
)));
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
|
||||||
// owner: *owner == para_sovereign_account,
|
assert_expected_events!(
|
||||||
// balance: *balance == fee_amount,
|
AssetHubWestend,
|
||||||
// },
|
vec![
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => {
|
||||||
// asset_id: *asset_id == ASSET_ID,
|
asset_id: *asset_id == ASSET_ID,
|
||||||
// },
|
owner: *owner == para_sovereign_account,
|
||||||
// ]
|
balance: *balance == fee_amount,
|
||||||
// );
|
},
|
||||||
// });
|
RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, .. }) => {
|
||||||
|
asset_id: *asset_id == ASSET_ID,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -187,7 +187,6 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() {
|
|||||||
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
||||||
/// should work when there is enough balance in Relay Chain's `CheckAccount`
|
/// should work when there is enough balance in Relay Chain's `CheckAccount`
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
||||||
// Dependency - Relay Chain's `CheckAccount` should have enough balance
|
// Dependency - Relay Chain's `CheckAccount` should have enough balance
|
||||||
limited_teleport_native_assets_from_relay_to_system_para_works();
|
limited_teleport_native_assets_from_relay_to_system_para_works();
|
||||||
@@ -226,7 +225,6 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
|
|||||||
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
/// Limited Teleport of native asset from System Parachain to Relay Chain
|
||||||
/// should't work when there is not enough balance in Relay Chain's `CheckAccount`
|
/// should't work when there is not enough balance in Relay Chain's `CheckAccount`
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
|
|
||||||
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
|
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
|
||||||
// Init values for Relay Chain
|
// Init values for Relay Chain
|
||||||
let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000;
|
let amount_to_send: Balance = ASSET_HUB_WESTEND_ED * 1000;
|
||||||
|
|||||||
@@ -64,4 +64,5 @@ pub fn relay_test_args(amount: Balance) -> TestArgs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
+1
@@ -80,4 +80,5 @@ pub fn system_para_test_args(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|||||||
+52
-42
@@ -16,54 +16,64 @@
|
|||||||
|
|
||||||
//! Integration tests concerning the Fellowship.
|
//! Integration tests concerning the Fellowship.
|
||||||
|
|
||||||
|
use crate::*;
|
||||||
|
use collectives_polkadot_runtime::fellowship::FellowshipSalaryPaymaster;
|
||||||
|
use frame_support::traits::{
|
||||||
|
fungibles::{Create, Mutate},
|
||||||
|
tokens::Pay,
|
||||||
|
};
|
||||||
|
use sp_core::crypto::Ss58Codec;
|
||||||
|
use xcm_emulator::TestExt;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn pay_salary() {
|
fn pay_salary() {
|
||||||
// let asset_id: u32 = 1984;
|
let asset_id: u32 = 1984;
|
||||||
// let pay_from: AccountId =
|
let pay_from: AccountId =
|
||||||
// <AccountId as Ss58Codec>::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS")
|
<AccountId as Ss58Codec>::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS")
|
||||||
// .unwrap();
|
.unwrap();
|
||||||
// let pay_to = Polkadot::account_id_of(ALICE);
|
let pay_to = Polkadot::account_id_of(ALICE);
|
||||||
// let pay_amount = 9000;
|
let pay_amount = 9000;
|
||||||
|
|
||||||
// AssetHubPolkadot::execute_with(|| {
|
AssetHubPolkadot::execute_with(|| {
|
||||||
// type AssetHubAssets = <AssetHubPolkadot as AssetHubPolkadotPallet>::Assets;
|
type AssetHubAssets = <AssetHubPolkadot as AssetHubPolkadotPallet>::Assets;
|
||||||
|
|
||||||
// assert_ok!(<AssetHubAssets as Create<_>>::create(
|
assert_ok!(<AssetHubAssets as Create<_>>::create(
|
||||||
// asset_id,
|
asset_id,
|
||||||
// pay_to.clone(),
|
pay_to.clone(),
|
||||||
// true,
|
true,
|
||||||
// pay_amount / 2
|
pay_amount / 2
|
||||||
// ));
|
));
|
||||||
// assert_ok!(<AssetHubAssets as Mutate<_>>::mint_into(asset_id, &pay_from, pay_amount * 2));
|
assert_ok!(<AssetHubAssets as Mutate<_>>::mint_into(asset_id, &pay_from, pay_amount * 2));
|
||||||
// });
|
});
|
||||||
|
|
||||||
// Collectives::execute_with(|| {
|
Collectives::execute_with(|| {
|
||||||
// type RuntimeEvent = <Collectives as Chain>::RuntimeEvent;
|
type RuntimeEvent = <Collectives as Chain>::RuntimeEvent;
|
||||||
|
|
||||||
// assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount));
|
assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount));
|
||||||
// assert_expected_events!(
|
assert_expected_events!(
|
||||||
// Collectives,
|
Collectives,
|
||||||
// vec![
|
vec![
|
||||||
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
|
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
|
||||||
// ]
|
]
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// AssetHubPolkadot::execute_with(|| {
|
Collectives::execute_with(|| {});
|
||||||
// type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
|
||||||
|
|
||||||
// assert_expected_events!(
|
AssetHubPolkadot::execute_with(|| {
|
||||||
// AssetHubPolkadot,
|
type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
||||||
// vec![
|
|
||||||
// RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) =>
|
assert_expected_events!(
|
||||||
// { asset_id: id == &asset_id,
|
AssetHubPolkadot,
|
||||||
// from: from == &pay_from,
|
vec![
|
||||||
// to: to == &pay_to,
|
RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) =>
|
||||||
// amount: amount == &pay_amount,
|
{ asset_id: id == &asset_id,
|
||||||
// },
|
from: from == &pay_from,
|
||||||
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {},
|
to: to == &pay_to,
|
||||||
// ]
|
amount: amount == &pay_amount,
|
||||||
// );
|
},
|
||||||
// });
|
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user