-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate integration tests to paseo (#139)
- Loading branch information
1 parent
171a035
commit 85a7218
Showing
15 changed files
with
508 additions
and
445 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use emulated_integration_tests_common::{ | ||
accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, SAFE_XCM_VERSION, | ||
}; | ||
use polkadot_primitives::{AccountId, Balance}; | ||
use sp_core::{sr25519, storage::Storage}; | ||
|
||
pub(crate) const PARA_ID: u32 = 1000; | ||
pub(crate) const ED: Balance = paseo_runtime_constants::currency::EXISTENTIAL_DEPOSIT / 10; | ||
|
||
pub(crate) fn genesis() -> Storage { | ||
let genesis_config = asset_hub_paseo_runtime::RuntimeGenesisConfig { | ||
system: asset_hub_paseo_runtime::SystemConfig::default(), | ||
balances: asset_hub_paseo_runtime::BalancesConfig { | ||
balances: accounts::init_balances() | ||
.iter() | ||
.cloned() | ||
.map(|k| (k, ED * 4096 * 4096)) | ||
.collect(), | ||
}, | ||
parachain_info: asset_hub_paseo_runtime::ParachainInfoConfig { | ||
parachain_id: PARA_ID.into(), | ||
..Default::default() | ||
}, | ||
collator_selection: asset_hub_paseo_runtime::CollatorSelectionConfig { | ||
invulnerables: invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), | ||
candidacy_bond: ED * 16, | ||
..Default::default() | ||
}, | ||
session: asset_hub_paseo_runtime::SessionConfig { | ||
keys: invulnerables() | ||
.into_iter() | ||
.map(|(acc, aura)| { | ||
( | ||
acc.clone(), // account id | ||
acc, // validator id | ||
asset_hub_paseo_runtime::SessionKeys { aura }, // session keys | ||
) | ||
}) | ||
.collect(), | ||
}, | ||
polkadot_xcm: asset_hub_paseo_runtime::PolkadotXcmConfig { | ||
safe_xcm_version: Some(SAFE_XCM_VERSION), | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}; | ||
|
||
build_genesis_storage( | ||
&genesis_config, | ||
asset_hub_paseo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), | ||
) | ||
} | ||
|
||
type AuraId = sp_consensus_aura::ed25519::AuthorityId; | ||
pub fn invulnerables() -> Vec<(AccountId, AuraId)> { | ||
vec![ | ||
(get_account_id_from_seed::<sr25519::Public>("Alice"), get_from_seed::<AuraId>("Alice")), | ||
(get_account_id_from_seed::<sr25519::Public>("Bob"), get_from_seed::<AuraId>("Bob")), | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
pub(crate) mod genesis; | ||
|
||
use crate::chains::paseo::Paseo; | ||
use emulated_integration_tests_common::{ | ||
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, | ||
impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, | ||
impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains, | ||
}; | ||
use frame_support::traits::OnInitialize; | ||
|
||
// AssetHubPaseo Parachain declaration | ||
decl_test_parachains! { | ||
pub struct AssetHubPaseo { | ||
genesis = genesis::genesis(), | ||
on_init = { | ||
asset_hub_paseo_runtime::AuraExt::on_initialize(1); | ||
}, | ||
runtime = asset_hub_paseo_runtime, | ||
core = { | ||
XcmpMessageHandler: asset_hub_paseo_runtime::XcmpQueue, | ||
LocationToAccountId: asset_hub_paseo_runtime::xcm_config::LocationToAccountId, | ||
ParachainInfo: asset_hub_paseo_runtime::ParachainInfo, | ||
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, | ||
}, | ||
pallets = { | ||
PolkadotXcm: asset_hub_paseo_runtime::PolkadotXcm, | ||
Assets: asset_hub_paseo_runtime::Assets, | ||
ForeignAssets: asset_hub_paseo_runtime::ForeignAssets, | ||
Balances: asset_hub_paseo_runtime::Balances, | ||
} | ||
}, | ||
} | ||
|
||
// AssetHubPaseo implementation | ||
impl_accounts_helpers_for_parachain!(AssetHubPaseo); | ||
impl_assert_events_helpers_for_parachain!(AssetHubPaseo); | ||
impl_assets_helpers_for_parachain!(AssetHubPaseo, Paseo); | ||
impl_foreign_assets_helpers_for_parachain!(AssetHubPaseo, Paseo); | ||
impl_xcm_helpers_for_parachain!(AssetHubPaseo); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub(crate) mod asset_hub_rococo; | ||
pub(crate) mod asset_hub_paseo; | ||
pub(crate) mod paseo; | ||
pub(crate) mod pop_network; | ||
pub(crate) mod rococo; |
Oops, something went wrong.