diff --git a/integration-tests/src/chains/pop_network/genesis.rs b/integration-tests/src/chains/pop_network/genesis.rs index d4ecf0904..492f5ce88 100644 --- a/integration-tests/src/chains/pop_network/genesis.rs +++ b/integration-tests/src/chains/pop_network/genesis.rs @@ -1,9 +1,13 @@ use emulated_integration_tests_common::{build_genesis_storage, collators}; use pop_runtime_common::Balance; -use pop_runtime_devnet as runtime; use sp_core::storage::Storage; +use super::runtime; + +#[cfg(not(feature = "mainnet"))] pub(crate) const ED: Balance = runtime::EXISTENTIAL_DEPOSIT; +#[cfg(feature = "mainnet")] +pub(crate) const ED: Balance = runtime::EXISTENTIAL_DEPOSIT * 100; const PARA_ID: u32 = 9090; const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; diff --git a/integration-tests/src/chains/pop_network/mod.rs b/integration-tests/src/chains/pop_network/mod.rs index 7c579defd..dbd4e0f7d 100644 --- a/integration-tests/src/chains/pop_network/mod.rs +++ b/integration-tests/src/chains/pop_network/mod.rs @@ -6,11 +6,11 @@ use emulated_integration_tests_common::{ }; use frame_support::traits::OnInitialize; #[cfg(feature = "devnet")] -use pop_runtime_devnet as runtime; +pub(crate) use pop_runtime_devnet as runtime; #[cfg(feature = "mainnet")] -use pop_runtime_mainnet as runtime; +pub(crate) use pop_runtime_mainnet as runtime; #[cfg(feature = "testnet")] -use pop_runtime_testnet as runtime; +pub(crate) use pop_runtime_testnet as runtime; // PopNetwork Parachain declaration decl_test_parachains! { diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 108ad33c5..1b5c2475e 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -6,7 +6,9 @@ use chains::{ genesis::ED as ASSET_HUB_ED, runtime::xcm_config::XcmConfig as AssetHubXcmConfig, AssetHub, AssetHubParaPallet, }, - pop_network::{genesis::ED as POP_ED, PopNetwork, PopNetworkParaPallet}, + pop_network::{ + runtime::config::xcm::XcmConfig as PopNetworkXcmConfig, PopNetwork, PopNetworkParaPallet, + }, relay::{ genesis::ED as RELAY_ED, runtime::xcm_config::XcmConfig as RelayXcmConfig, Relay, RelayRelayPallet as RelayPallet, @@ -22,10 +24,6 @@ use emulated_integration_tests_common::{ }; use frame_support::{pallet_prelude::Weight, sp_runtime::DispatchResult}; use pop_runtime_common::Balance; -#[cfg(not(feature = "mainnet"))] -use pop_runtime_devnet::config::xcm::XcmConfig as PopNetworkXcmConfig; -#[cfg(feature = "mainnet")] -use pop_runtime_mainnet::config::xcm::XcmConfig as PopNetworkXcmConfig; use xcm::prelude::*; mod chains; @@ -315,23 +313,8 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { // Init values for Pop Network Parachain let destination = PopNetworkPara::sibling_location_of(AssetHubPara::para_id()); let beneficiary_id = AssetHubParaReceiver::get(); // bob on asset hub - let amount_to_send = PopNetworkPara::account_data_of(PopNetworkParaReceiver::get()).free; // bob on pop balance - let assets: Assets = (Parent, amount_to_send).into(); - - let delivery_fees = PopNetworkPara::execute_with(|| { - xcm_helpers::teleport_assets_delivery_fees::< - ::XcmSender, - >( - assets.clone(), 0, Unlimited, Location::from(beneficiary_id.clone()), destination.clone() - ) - }); - - // Mainnet ED is 100 times higher. - let pop_mainnet_ed = POP_ED * 100; - // We need to keep `delivery_fees` in balance to pay for these fees locally. - // To avoid the account from being reaped we need to ensure its balance is >= ED. - let amount_to_send = amount_to_send - (pop_mainnet_ed + delivery_fees); - let assets: Assets = (Parent, amount_to_send).into(); + let amount_to_send = PopNetworkPara::account_data_of(PopNetworkParaReceiver::get()).free / 4; // bob on pop balance + let assets = (Parent, amount_to_send).into(); let test_args = TestContext { sender: PopNetworkParaReceiver::get(), // bob on pop @@ -344,6 +327,18 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; + let delivery_fees = PopNetworkPara::execute_with(|| { + xcm_helpers::teleport_assets_delivery_fees::< + ::XcmSender, + >( + test.args.assets.clone(), + 0, + test.args.weight_limit.clone(), + test.args.beneficiary.clone(), + test.args.dest.clone(), + ) + }); + let pop_net_location_as_seen_by_ahr = AssetHubPara::sibling_location_of(PopNetworkPara::para_id()); let sov_pop_net_on_ahr = AssetHubPara::sovereign_account_id_of(pop_net_location_as_seen_by_ahr); @@ -361,8 +356,6 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { // Sender's balance is reduced assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after); - // Sender's remaining balance equals ED. - assert_eq!(pop_mainnet_ed, sender_balance_after); // Receiver's balance is increased assert!(receiver_balance_after > receiver_balance_before); // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`;