Skip to content

Commit

Permalink
Add more integrations tests to People chains (#499)
Browse files Browse the repository at this point in the history
https://github.com/open-web3-stack/polkadot-ecosystem-tests relies on
chopsticks to create E2E tests using periodically (roughly daily)
obtained runtimes from production relay chains/system parachains.

In particular,
open-web3-stack/polkadot-ecosystem-tests#63 does
this for the People chains.
In writing those tests, I was unable to use XCM to test
`pallet_identity::{kill_identity/add_username_authority/remove_username_authority}`.
I wrote this PR to replicate those tests at this layer, whose passing
status falsify the hypothesis that there may have been an issue with the
runtimes, and confirm that it was a problem with the way I wrote those
tests.

- [x] Does not require a CHANGELOG entry
  • Loading branch information
rockbmb authored Dec 13, 2024
1 parent 7b096c1 commit 46dcafc
Show file tree
Hide file tree
Showing 7 changed files with 946 additions and 4 deletions.
2 changes: 2 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 @@ -18,6 +18,9 @@ parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }

# Runtimes
kusama-runtime-constants = { workspace = true, default-features = true }

# Local
people-kusama-runtime = { workspace = true }
kusama-emulated-chain = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ use sp_core::storage::Storage;

// Cumulus
use cumulus_primitives_core::ParaId;
use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION};
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use kusama_runtime_constants::currency::UNITS as KSM;
use parachains_common::Balance;

const ENDOWMENT: u128 = 1_000 * KSM;
pub const PARA_ID: u32 = 1004;
pub const ED: Balance = people_kusama_runtime::ExistentialDeposit::get();

pub fn genesis() -> Storage {
let genesis_config = people_kusama_runtime::RuntimeGenesisConfig {
balances: people_kusama_runtime::BalancesConfig {
balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(),
},
system: people_kusama_runtime::SystemConfig::default(),
parachain_info: people_kusama_runtime::ParachainInfoConfig {
parachain_id: ParaId::from(PARA_ID),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }

# Runtimes
polkadot-runtime-constants = { workspace = true, default-features = true }

# Local
people-polkadot-runtime = { workspace = true }
polkadot-emulated-chain = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ use sp_core::storage::Storage;

// Cumulus
use cumulus_primitives_core::ParaId;
use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION};
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::Balance;
use polkadot_runtime_constants::currency::UNITS as DOT;

const ENDOWMENT: u128 = 1_000 * DOT;
pub const PARA_ID: u32 = 1004;
pub const ED: Balance = people_polkadot_runtime::ExistentialDeposit::get();

pub fn genesis() -> Storage {
let genesis_config = people_polkadot_runtime::RuntimeGenesisConfig {
balances: people_polkadot_runtime::BalancesConfig {
balances: accounts::init_balances().iter().cloned().map(|k| (k, ENDOWMENT)).collect(),
},
system: people_polkadot_runtime::SystemConfig::default(),
parachain_info: people_polkadot_runtime::ParachainInfoConfig {
parachain_id: ParaId::from(PARA_ID),
Expand Down
Loading

0 comments on commit 46dcafc

Please sign in to comment.