diff --git a/runtime/integration-tests/src/generic/cases/liquidity_pools.rs b/runtime/integration-tests/src/generic/cases/liquidity_pools.rs index d306e411f9..fce22e2526 100644 --- a/runtime/integration-tests/src/generic/cases/liquidity_pools.rs +++ b/runtime/integration-tests/src/generic/cases/liquidity_pools.rs @@ -51,7 +51,7 @@ use crate::{ generic::{ config::Runtime, env::{Blocks, Env}, - envs::fudge_env::{handle::FudgeHandle, FudgeEnv, FudgeSupport}, + envs::fudge_env::{handle::SIBLING_ID, FudgeEnv, FudgeSupport}, utils::{genesis, genesis::Genesis, xcm::enable_para_to_sibling_communication}, }, utils::{accounts::Keyring, orml_asset_registry}, @@ -105,7 +105,7 @@ mod utils { location: Some(VersionedLocation::V4(Location::new( 1, [ - Parachain(T::FudgeHandle::SIBLING_ID), + Parachain(SIBLING_ID), general_key(parachains::kusama::karura::AUSD_KEY), ], ))), @@ -209,7 +209,7 @@ mod utils { existential_deposit: GLMR_ED, location: Some(VersionedLocation::V4(Location::new( 1, - [Parachain(T::FudgeHandle::SIBLING_ID), general_key(&[0, 1])], + [Parachain(SIBLING_ID), general_key(&[0, 1])], ))), additional: CustomMetadata { transferability: CrossChainTransferability::Xcm(Default::default()), @@ -345,7 +345,7 @@ mod utils { set_test_domain_router::( MOONBEAM_EVM_CHAIN_ID, - Location::new(1, Junction::Parachain(T::FudgeHandle::SIBLING_ID)).into(), + Location::new(1, Junction::Parachain(SIBLING_ID)).into(), GLMR_CURRENCY_ID, ); }); @@ -3946,7 +3946,7 @@ mod routers { env.parachain_state_mut(|| { let domain_router = router_creation_fn( - Location::new(1, Parachain(T::FudgeHandle::SIBLING_ID)).into(), + Location::new(1, Parachain(SIBLING_ID)).into(), GLMR_CURRENCY_ID, ); diff --git a/runtime/integration-tests/src/generic/cases/xcm_transfers.rs b/runtime/integration-tests/src/generic/cases/xcm_transfers.rs index 4c15fb61b7..2a1b7e8504 100644 --- a/runtime/integration-tests/src/generic/cases/xcm_transfers.rs +++ b/runtime/integration-tests/src/generic/cases/xcm_transfers.rs @@ -7,7 +7,10 @@ use crate::{ generic::{ config::Runtime, env::{Blocks, Env}, - envs::fudge_env::{handle::FudgeHandle, FudgeEnv, FudgeSupport, RelayRuntime}, + envs::fudge_env::{ + handle::{PARA_ID, SIBLING_ID}, + FudgeEnv, FudgeSupport, RelayRuntime, + }, utils::{ currency::{cfg, CurrencyInfo, CustomCurrency}, genesis, @@ -37,7 +40,7 @@ fn create_transfeable_currency(decimals: u32, para_id: Option) -> CustomCur #[test_runtimes(all)] fn para_to_sibling_with_foreign_to_foreign_tokens() { - let curr = create_transfeable_currency(6, Some(T::FudgeHandle::PARA_ID)); + let curr = create_transfeable_currency(6, Some(PARA_ID)); let mut env = FudgeEnv::::from_storage( Default::default(), @@ -57,7 +60,7 @@ fn para_to_sibling_with_foreign_to_foreign_tokens() { RawOrigin::Signed(Keyring::Alice.id()).into(), curr.id(), curr.val(TRANSFER), - account_location(1, Some(T::FudgeHandle::SIBLING_ID), Keyring::Bob.id()), + account_location(1, Some(SIBLING_ID), Keyring::Bob.id()), WeightLimit::Unlimited, )); @@ -79,7 +82,7 @@ fn para_to_sibling_with_foreign_to_foreign_tokens() { #[test_runtimes(all)] fn para_to_sibling_with_native_to_foreign_tokens() { - let curr = create_transfeable_currency(18, Some(T::FudgeHandle::PARA_ID)); + let curr = create_transfeable_currency(18, Some(PARA_ID)); let mut env = FudgeEnv::::from_storage( Default::default(), @@ -99,7 +102,7 @@ fn para_to_sibling_with_native_to_foreign_tokens() { RawOrigin::Signed(Keyring::Alice.id()).into(), Native, cfg(TRANSFER), - account_location(1, Some(T::FudgeHandle::SIBLING_ID), Keyring::Bob.id()), + account_location(1, Some(SIBLING_ID), Keyring::Bob.id()), WeightLimit::Unlimited, )); @@ -121,7 +124,7 @@ fn para_to_sibling_with_native_to_foreign_tokens() { #[test_runtimes(all)] fn para_to_sibling_with_foreign_to_native_tokens() { - let curr = create_transfeable_currency(18, Some(T::FudgeHandle::PARA_ID)); + let curr = create_transfeable_currency(18, Some(PARA_ID)); let mut env = FudgeEnv::::from_storage( Default::default(), @@ -141,7 +144,7 @@ fn para_to_sibling_with_foreign_to_native_tokens() { RawOrigin::Signed(Keyring::Alice.id()).into(), curr.id(), curr.val(TRANSFER), - account_location(1, Some(T::FudgeHandle::SIBLING_ID), Keyring::Bob.id()), + account_location(1, Some(SIBLING_ID), Keyring::Bob.id()), WeightLimit::Unlimited, )); @@ -182,7 +185,7 @@ fn para_from_to_relay_using_relay_native_tokens() { assert_ok!( pallet_xcm::Pallet::>::reserve_transfer_assets( RawOrigin::Signed(Keyring::Alice.id()).into(), - Box::new(Parachain(T::FudgeHandle::PARA_ID).into()), + Box::new(Parachain(PARA_ID).into()), account_location(0, None, Keyring::Bob.id()), Box::new((Here, curr.val(TRANSFER)).into()), 0, diff --git a/runtime/integration-tests/src/generic/envs/fudge_env/handle.rs b/runtime/integration-tests/src/generic/envs/fudge_env/handle.rs index 5bb99eafc2..07d3af10e7 100644 --- a/runtime/integration-tests/src/generic/envs/fudge_env/handle.rs +++ b/runtime/integration-tests/src/generic/envs/fudge_env/handle.rs @@ -32,6 +32,8 @@ use crate::generic::config::Runtime; /// Start date used for timestamps in test-enviornments /// Sat Jan 01 2022 00:00:00 GMT+0000 pub const START_DATE: u64 = 1640995200u64; +pub const PARA_ID: u32 = 1001; +pub const SIBLING_ID: u32 = 1002; type InherentCreator = Box< dyn CreateInherentDataProviders< @@ -118,9 +120,6 @@ pub trait FudgeHandle { const RELAY_CODE: Option<&'static [u8]>; const PARACHAIN_CODE: Option<&'static [u8]>; - const PARA_ID: u32; - const SIBLING_ID: u32; - fn relay(&self) -> &RelaychainBuilder; fn relay_mut(&mut self) -> &mut RelaychainBuilder; diff --git a/runtime/integration-tests/src/generic/impls.rs b/runtime/integration-tests/src/generic/impls.rs index 764c40ee27..8c0791ac0d 100644 --- a/runtime/integration-tests/src/generic/impls.rs +++ b/runtime/integration-tests/src/generic/impls.rs @@ -46,8 +46,6 @@ macro_rules! impl_fudge_support { $relay_path:ident, $relay_session_keys:expr, $parachain_path:ident, - $parachain_id:literal, - $sibling_id:literal ) => { const _: () = { use fudge::primitives::{Chain, ParaId}; @@ -58,6 +56,7 @@ macro_rules! impl_fudge_support { use crate::generic::envs::fudge_env::{ handle::{ FudgeHandle, ParachainBuilder, ParachainClient, RelayClient, RelaychainBuilder, + PARA_ID, SIBLING_ID, }, FudgeSupport, }; @@ -67,11 +66,11 @@ macro_rules! impl_fudge_support { #[fudge::relaychain] pub relay: RelaychainBuilder<$relay_path::RuntimeApi, $relay_path::Runtime>, - #[fudge::parachain($parachain_id)] + #[fudge::parachain(PARA_ID)] pub parachain: ParachainBuilder<$parachain_path::Block, $parachain_path::RuntimeApi>, - #[fudge::parachain($sibling_id)] + #[fudge::parachain(SIBLING_ID)] pub sibling: ParachainBuilder<$parachain_path::Block, $parachain_path::RuntimeApi>, } @@ -91,9 +90,7 @@ macro_rules! impl_fudge_support { type RelayRuntime = $relay_path::Runtime; const PARACHAIN_CODE: Option<&'static [u8]> = $parachain_path::WASM_BINARY; - const PARA_ID: u32 = $parachain_id; const RELAY_CODE: Option<&'static [u8]> = $relay_path::WASM_BINARY; - const SIBLING_ID: u32 = $sibling_id; fn new( relay_storage: Storage, @@ -102,12 +99,12 @@ macro_rules! impl_fudge_support { ) -> Self { let relay = Self::new_relay_builder(relay_storage, $relay_session_keys); let parachain = Self::new_parachain_builder( - ParaId::from(Self::PARA_ID), + ParaId::from(PARA_ID), &relay, parachain_storage, ); let sibling = Self::new_parachain_builder( - ParaId::from(Self::SIBLING_ID), + ParaId::from(SIBLING_ID), &relay, sibling_storage, ); @@ -183,8 +180,6 @@ impl_fudge_support!( rococo_runtime, default_rococo_session_keys(), development_runtime, - 2000, - 2001 ); impl_fudge_support!( @@ -192,8 +187,6 @@ impl_fudge_support!( rococo_runtime, default_rococo_session_keys(), altair_runtime, - 2088, - 2089 ); impl_fudge_support!( @@ -201,8 +194,6 @@ impl_fudge_support!( rococo_runtime, default_rococo_session_keys(), centrifuge_runtime, - 2031, - 2032 ); pub fn default_rococo_session_keys() -> rococo_runtime::SessionKeys { diff --git a/runtime/integration-tests/src/generic/utils/xcm.rs b/runtime/integration-tests/src/generic/utils/xcm.rs index af842dd2e3..0380bf0ddf 100644 --- a/runtime/integration-tests/src/generic/utils/xcm.rs +++ b/runtime/integration-tests/src/generic/utils/xcm.rs @@ -13,14 +13,17 @@ use staging_xcm::{ use crate::generic::{ config::Runtime, env::{Blocks, Env}, - envs::fudge_env::{handle::FudgeHandle, FudgeEnv, FudgeSupport, RelayRuntime}, + envs::fudge_env::{ + handle::{PARA_ID, SIBLING_ID}, + FudgeEnv, FudgeSupport, RelayRuntime, + }, }; pub fn enable_relay_to_para_communication(env: &mut FudgeEnv) { env.relay_state_mut(|| { assert_ok!(pallet_xcm::Pallet::>::force_xcm_version( RawOrigin::Root.into(), - Box::new(Location::new(0, Parachain(T::FudgeHandle::PARA_ID))), + Box::new(Location::new(0, Parachain(PARA_ID))), XCM_VERSION, )); }); @@ -40,7 +43,7 @@ pub fn enable_para_to_sibling_communication(env: &mut env.parachain_state_mut(|| { assert_ok!(pallet_xcm::Pallet::::force_xcm_version( RawOrigin::Root.into(), - Box::new(Location::new(1, Parachain(T::FudgeHandle::SIBLING_ID))), + Box::new(Location::new(1, Parachain(SIBLING_ID))), XCM_VERSION, )); }); @@ -50,8 +53,8 @@ pub fn enable_para_to_sibling_communication(env: &mut assert_ok!( polkadot_runtime_parachains::hrmp::Pallet::>::force_open_hrmp_channel( RawOrigin::Root.into(), - Id::from(T::FudgeHandle::PARA_ID), - Id::from(T::FudgeHandle::SIBLING_ID), + Id::from(PARA_ID), + Id::from(SIBLING_ID), 10, 1024, )