mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
[xcm-emulator] Unignore cumulus integration tests (#1247)
* tests should not be run with runtime-benchmarks feature
This commit is contained in:
+1
@@ -80,4 +80,5 @@ pub fn system_para_test_args(
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
mod tests;
|
||||
|
||||
+52
-42
@@ -16,54 +16,64 @@
|
||||
|
||||
//! 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]
|
||||
#[ignore]
|
||||
fn pay_salary() {
|
||||
// let asset_id: u32 = 1984;
|
||||
// let pay_from: AccountId =
|
||||
// <AccountId as Ss58Codec>::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS")
|
||||
// .unwrap();
|
||||
// let pay_to = Polkadot::account_id_of(ALICE);
|
||||
// let pay_amount = 9000;
|
||||
let asset_id: u32 = 1984;
|
||||
let pay_from: AccountId =
|
||||
<AccountId as Ss58Codec>::from_string("13w7NdvSR1Af8xsQTArDtZmVvjE8XhWNdL4yed3iFHrUNCnS")
|
||||
.unwrap();
|
||||
let pay_to = Polkadot::account_id_of(ALICE);
|
||||
let pay_amount = 9000;
|
||||
|
||||
// AssetHubPolkadot::execute_with(|| {
|
||||
// type AssetHubAssets = <AssetHubPolkadot as AssetHubPolkadotPallet>::Assets;
|
||||
AssetHubPolkadot::execute_with(|| {
|
||||
type AssetHubAssets = <AssetHubPolkadot as AssetHubPolkadotPallet>::Assets;
|
||||
|
||||
// assert_ok!(<AssetHubAssets as Create<_>>::create(
|
||||
// asset_id,
|
||||
// pay_to.clone(),
|
||||
// true,
|
||||
// pay_amount / 2
|
||||
// ));
|
||||
// assert_ok!(<AssetHubAssets as Mutate<_>>::mint_into(asset_id, &pay_from, pay_amount * 2));
|
||||
// });
|
||||
assert_ok!(<AssetHubAssets as Create<_>>::create(
|
||||
asset_id,
|
||||
pay_to.clone(),
|
||||
true,
|
||||
pay_amount / 2
|
||||
));
|
||||
assert_ok!(<AssetHubAssets as Mutate<_>>::mint_into(asset_id, &pay_from, pay_amount * 2));
|
||||
});
|
||||
|
||||
// Collectives::execute_with(|| {
|
||||
// type RuntimeEvent = <Collectives as Chain>::RuntimeEvent;
|
||||
Collectives::execute_with(|| {
|
||||
type RuntimeEvent = <Collectives as Chain>::RuntimeEvent;
|
||||
|
||||
// assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount));
|
||||
// assert_expected_events!(
|
||||
// Collectives,
|
||||
// vec![
|
||||
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
|
||||
// ]
|
||||
// );
|
||||
// });
|
||||
assert_ok!(FellowshipSalaryPaymaster::pay(&pay_to, (), pay_amount));
|
||||
assert_expected_events!(
|
||||
Collectives,
|
||||
vec![
|
||||
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
// AssetHubPolkadot::execute_with(|| {
|
||||
// type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
||||
Collectives::execute_with(|| {});
|
||||
|
||||
// assert_expected_events!(
|
||||
// AssetHubPolkadot,
|
||||
// vec![
|
||||
// RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) =>
|
||||
// { asset_id: id == &asset_id,
|
||||
// from: from == &pay_from,
|
||||
// to: to == &pay_to,
|
||||
// amount: amount == &pay_amount,
|
||||
// },
|
||||
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {},
|
||||
// ]
|
||||
// );
|
||||
// });
|
||||
AssetHubPolkadot::execute_with(|| {
|
||||
type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
|
||||
|
||||
assert_expected_events!(
|
||||
AssetHubPolkadot,
|
||||
vec![
|
||||
RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) =>
|
||||
{ asset_id: id == &asset_id,
|
||||
from: from == &pay_from,
|
||||
to: to == &pay_to,
|
||||
amount: amount == &pay_amount,
|
||||
},
|
||||
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Success { .. }) => {},
|
||||
]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user