diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index e5a1dbed88..753746e39b 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -31,85 +31,6 @@ pub use xcm_emulator::Chain; pub mod common; -/// TODO: when bumping to polkadot-sdk stable2506, -/// remove this crate altogether and get the macros from `emulated-integration-tests-common`. -/// note: $asset needs to be prefunded outside this function -#[macro_export] -macro_rules! create_pool_with_native_on { - ( $chain:ident, $asset:expr, $is_foreign:expr, $asset_owner:expr ) => { - $crate::create_pool_with_native_on!( - $chain, - $asset, - $is_foreign, - $asset_owner, - 1_000_000_000_000, - 2_000_000_000_000 - ); - }; - - ( $chain:ident, $asset:expr, $is_foreign:expr, $asset_owner:expr, $native_amount:expr, $asset_amount:expr ) => { - $crate::paste::paste! { - <$chain>::execute_with(|| { - type RuntimeEvent = <$chain as $crate::Chain>::RuntimeEvent; - let owner = $asset_owner; - let signed_owner = <$chain as $crate::Chain>::RuntimeOrigin::signed(owner.clone()); - let native_asset = Location::parent(); - - if $is_foreign { - assert_ok!(<$chain as [<$chain Pallet>]>::ForeignAssets::mint( - signed_owner.clone(), - $asset.clone().into(), - owner.clone().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - } else { - let asset_id = match $asset.clone().interior.last() { - Some(GeneralIndex(id)) => *id as u32, - _ => unreachable!(), - }; - assert_ok!(<$chain as [<$chain Pallet>]>::Assets::mint( - signed_owner.clone(), - asset_id.into(), - owner.clone().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - } - - assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::create_pool( - signed_owner.clone(), - Box::new(native_asset.clone()), - Box::new($asset.clone().try_into().unwrap()), - )); - - assert_expected_events!( - $chain, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::add_liquidity( - signed_owner, - Box::new(native_asset), - Box::new($asset), - $native_amount, - $asset_amount, - 0, - 0, - owner.into() - )); - - assert_expected_events!( - $chain, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded { .. }) => {}, - ] - ); - }); - } - }; -} - #[macro_export] macro_rules! test_relay_is_trusted_teleporter { ( $sender_relay:ty, vec![$( $receiver_para:ty ),+], ($assets:expr, $amount:expr), $xcm_call:ident ) => { diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs index 06dd4fc576..ce667e3acc 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs @@ -35,6 +35,7 @@ pub use bp_messages::LegacyLaneId; // Cumulus pub use emulated_integration_tests_common::{ accounts::{ALICE, BOB}, + create_pool_with_native_on, impls::Inspect, test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter, @@ -45,10 +46,7 @@ pub use emulated_integration_tests_common::{ xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, ASSETS_PALLET_ID, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V4, }; -pub use integration_tests_helpers::{ - common::snowbridge::{MIN_ETHER_BALANCE, WETH}, - create_pool_with_native_on, -}; +pub use integration_tests_helpers::common::snowbridge::{MIN_ETHER_BALANCE, WETH}; pub use kusama_polkadot_system_emulated_network::{ asset_hub_kusama_emulated_chain::{ genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs index 7dfabc06d8..5bed825397 100644 --- a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs @@ -36,7 +36,7 @@ fn fellows_whitelist_call() { UnpaidExecution { weight_limit: Unlimited, check_origin: None }, Transact { origin_kind: OriginKind::Xcm, - fallback_max_weight: Some(Weight::from_parts(5_000_000_000, 500_000)), + fallback_max_weight: None, call: PolkadotCall::Whitelist( pallet_whitelist::Call::::whitelist_call { call_hash } ) diff --git a/integration-tests/emulated/tests/people/people-kusama/src/tests/governance.rs b/integration-tests/emulated/tests/people/people-kusama/src/tests/governance.rs index b7a432e202..a1d8ee136b 100644 --- a/integration-tests/emulated/tests/people/people-kusama/src/tests/governance.rs +++ b/integration-tests/emulated/tests/people/people-kusama/src/tests/governance.rs @@ -48,10 +48,7 @@ fn relay_commands_add_registrar() { UnpaidExecution { weight_limit: Unlimited, check_origin: None }, Transact { origin_kind, - // TODO: - // This and the below weight data in the XCM can be removed once XCMv5 is - // used. - fallback_max_weight: Some(Weight::from_parts(5_000_000_000, 500_000)), + fallback_max_weight: None, call: add_registrar_call.encode().into(), } ]))), @@ -110,7 +107,7 @@ fn relay_commands_add_registrar_wrong_origin() { UnpaidExecution { weight_limit: Unlimited, check_origin: None }, Transact { origin_kind, - fallback_max_weight: Some(Weight::from_parts(5_000_000_000, 500_000)), + fallback_max_weight: None, call: add_registrar_call.encode().into(), } ]))), diff --git a/integration-tests/emulated/tests/people/people-polkadot/src/tests/governance.rs b/integration-tests/emulated/tests/people/people-polkadot/src/tests/governance.rs index 1b156a5207..7d8c6d054d 100644 --- a/integration-tests/emulated/tests/people/people-polkadot/src/tests/governance.rs +++ b/integration-tests/emulated/tests/people/people-polkadot/src/tests/governance.rs @@ -48,7 +48,7 @@ fn relay_commands_add_registrar() { UnpaidExecution { weight_limit: Unlimited, check_origin: None }, Transact { origin_kind, - fallback_max_weight: Some(Weight::from_parts(5_000_000_000, 500_000)), + fallback_max_weight: None, call: add_registrar_call.encode().into(), } ]))), @@ -107,7 +107,7 @@ fn relay_commands_add_registrar_wrong_origin() { UnpaidExecution { weight_limit: Unlimited, check_origin: None }, Transact { origin_kind, - fallback_max_weight: Some(Weight::from_parts(5_000_000_000, 500_000)), + fallback_max_weight: None, call: add_registrar_call.encode().into(), } ]))),