Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ sp-keyring = { workspace = true }
frame-support = { workspace = true, default-features = true }

# Cumulus
assets-common = { workspace = true, default-features = true }
parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }
xcm = { workspace = true, default-features = true }
xcm-builder = { workspace = true, default-features = true }
polkadot-parachain-primitives = { workspace = true }

# Runtimes
asset-hub-paseo-runtime = { workspace = true, default-features = true }
asset-hub-paseo-runtime = { workspace = true }
paseo-emulated-chain = { workspace = true }
penpal-emulated-chain = { workspace = true }

Expand All @@ -35,6 +37,7 @@ integration-tests-helpers = { workspace = true }
[features]
runtime-benchmarks = [
"asset-hub-paseo-runtime/runtime-benchmarks",
"assets-common/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"integration-tests-helpers/runtime-benchmarks",
Expand All @@ -43,6 +46,6 @@ runtime-benchmarks = [
"penpal-emulated-chain/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"snowbridge-inbound-queue-primitives/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = []
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,26 @@
use sp_keyring::Sr25519Keyring;

// Cumulus
use asset_hub_paseo_runtime::xcm_config::bridging::to_ethereum::EthereumNetwork;
use emulated_integration_tests_common::{
accounts, build_genesis_storage, xcm_emulator::ConvertLocation, RESERVABLE_ASSET_ID,
accounts, build_genesis_storage, xcm_emulator::ConvertLocation, PenpalALocation,
PenpalASiblingSovereignAccount, PenpalATeleportableAssetLocation, PenpalBLocation,
PenpalBSiblingSovereignAccount, PenpalBTeleportableAssetLocation, RESERVABLE_ASSET_ID,
SAFE_XCM_VERSION,
};
use frame_support::sp_runtime::traits::AccountIdConversion;
use integration_tests_helpers::common::snowbridge::{EthLocation, WethLocation, MIN_ETHER_BALANCE};
use parachains_common::{AccountId, Balance};
use polkadot_parachain_primitives::primitives::Sibling;
use snowbridge_inbound_queue_primitives::EthereumLocationsConverterFor;
use xcm::prelude::*;
use xcm_builder::ExternalConsensusLocationsConverterFor;

pub const PARA_ID: u32 = 1000;
pub const ED: Balance = asset_hub_paseo_runtime::ExistentialDeposit::get();
pub const USDT_ID: u32 = 1984;

frame_support::parameter_types! {
pub AssetHubPaseoAssetOwner: AccountId = Sr25519Keyring::Alice.to_account_id();
pub PenpalATeleportableAssetLocation: Location
= Location::new(1, [
Parachain(penpal_emulated_chain::PARA_ID_A),
PalletInstance(penpal_emulated_chain::ASSETS_PALLET_ID),
GeneralIndex(penpal_emulated_chain::TELEPORTABLE_ASSET_ID.into()),
]
);
pub PenpalBTeleportableAssetLocation: Location
= Location::new(1, [
Parachain(penpal_emulated_chain::PARA_ID_B),
PalletInstance(penpal_emulated_chain::ASSETS_PALLET_ID),
GeneralIndex(penpal_emulated_chain::TELEPORTABLE_ASSET_ID.into()),
]
);
pub PenpalASiblingSovereignAccount: AccountId = Sibling::from(penpal_emulated_chain::PARA_ID_A).into_account_truncating();
pub PenpalBSiblingSovereignAccount: AccountId = Sibling::from(penpal_emulated_chain::PARA_ID_B).into_account_truncating();
pub EthereumSovereignAccount: AccountId = EthereumLocationsConverterFor::<AccountId>::convert_location(
&Location::new(
2,
[GlobalConsensus(EthereumNetwork::get())],
),
pub UniversalLocation: InteriorLocation = [GlobalConsensus(Paseo), Parachain(PARA_ID)].into();
pub EthereumSovereignAccount: AccountId = ExternalConsensusLocationsConverterFor::<UniversalLocation, AccountId>::convert_location(
&EthLocation::get(),
).unwrap();
}

Expand Down Expand Up @@ -137,6 +118,18 @@ pub fn genesis() -> sp_core::storage::Storage {
// Weth
(WethLocation::get(), EthereumSovereignAccount::get(), true, MIN_ETHER_BALANCE),
],
reserves: vec![
(
PenpalATeleportableAssetLocation::get(),
vec![(PenpalALocation::get(), true).into()],
),
(
PenpalBTeleportableAssetLocation::get(),
vec![(PenpalBLocation::get(), true).into()],
),
(EthLocation::get(), vec![(EthLocation::get(), false).into()]),
(WethLocation::get(), vec![(EthLocation::get(), false).into()]),
],
..Default::default()
},
..Default::default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ use emulated_integration_tests_common::{
};
use paseo_emulated_chain::Paseo;

pub use assets_common::local_and_foreign_assets::ForeignAssetReserveData;

// AssetHubPaseo Parachain declaration
decl_test_parachains! {
pub struct AssetHubPaseo {
Expand Down Expand Up @@ -59,5 +61,9 @@ impl_accounts_helpers_for_parachain!(AssetHubPaseo);
impl_assert_events_helpers_for_parachain!(AssetHubPaseo);
impl_assets_helpers_for_system_parachain!(AssetHubPaseo, Paseo);
impl_assets_helpers_for_parachain!(AssetHubPaseo);
impl_foreign_assets_helpers_for_parachain!(AssetHubPaseo, xcm::latest::Location);
impl_foreign_assets_helpers_for_parachain!(
AssetHubPaseo,
xcm::latest::Location,
ForeignAssetReserveData
);
impl_xcm_helpers_for_parachain!(AssetHubPaseo);
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ impl_assert_events_helpers_for_parachain!(PenpalA);
impl_assert_events_helpers_for_parachain!(PenpalB);
impl_assets_helpers_for_parachain!(PenpalA);
impl_assets_helpers_for_parachain!(PenpalB);
impl_foreign_assets_helpers_for_parachain!(PenpalA, xcm::latest::Location);
impl_foreign_assets_helpers_for_parachain!(PenpalB, xcm::latest::Location);
impl_foreign_assets_helpers_for_parachain!(
PenpalA,
xcm::latest::Location,
penpal_runtime::ForeignAssetReserveData
);
impl_foreign_assets_helpers_for_parachain!(
PenpalB,
xcm::latest::Location,
penpal_runtime::ForeignAssetReserveData
);
impl_xcm_helpers_for_parachain!(PenpalA);
impl_xcm_helpers_for_parachain!(PenpalB);
2 changes: 2 additions & 0 deletions integration-tests/emulated/helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pallet-message-queue = { workspace = true, default-features = true }

# Polkadot
xcm = { workspace = true, default-features = true }
xcm-runtime-apis = { workspace = true, default-features = true }
pallet-xcm = { workspace = true, default-features = true }

# Cumulus
Expand All @@ -30,5 +31,6 @@ runtime-benchmarks = [
"pallet-balances/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"xcm-runtime-apis/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
Loading
Loading