forked from polkadot-fellows/runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kusama People Chain (polkadot-fellows#217)
See https://forum.polkadot.network/t/people-chain-launch-and-identity-migration-plan/5930 for launch process. A branch with runtimes for steps 2 and 3 of the launch process is here: #1 --------- Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Dónal Murray <donalm@seadanda.dev>
- Loading branch information
1 parent
360581f
commit 6d93705
Showing
48 changed files
with
6,694 additions
and
4 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
23 changes: 23 additions & 0 deletions
23
integration-tests/emulated/chains/parachains/people/people-kusama/Cargo.toml
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,23 @@ | ||
[package] | ||
name = "people-kusama-emulated-chain" | ||
authors.workspace = true | ||
edition.workspace = true | ||
version.workspace = true | ||
license = "Apache-2.0" | ||
description = "People Kusama emulated chain used for integration tests" | ||
publish = false | ||
|
||
[dependencies] | ||
|
||
# Substrate | ||
sp-core = { version = "29.0.0" } | ||
frame-support = { version = "29.0.0" } | ||
|
||
# Cumulus | ||
parachains-common = { version = "8.0.0" } | ||
cumulus-primitives-core = { version = "0.8.0" } | ||
emulated-integration-tests-common = { version = "4.0.0" } | ||
|
||
# Local | ||
people-kusama-runtime = { path = "../../../../../../system-parachains/people/people-kusama" } | ||
kusama-emulated-chain = { path = "../../../relays/kusama" } |
62 changes: 62 additions & 0 deletions
62
integration-tests/emulated/chains/parachains/people/people-kusama/src/genesis.rs
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,62 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Substrate | ||
use sp_core::storage::Storage; | ||
|
||
// Cumulus | ||
use cumulus_primitives_core::ParaId; | ||
use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION}; | ||
use parachains_common::Balance; | ||
|
||
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 { | ||
system: people_kusama_runtime::SystemConfig::default(), | ||
parachain_info: people_kusama_runtime::ParachainInfoConfig { | ||
parachain_id: ParaId::from(PARA_ID), | ||
..Default::default() | ||
}, | ||
collator_selection: people_kusama_runtime::CollatorSelectionConfig { | ||
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), | ||
candidacy_bond: ED * 16, | ||
..Default::default() | ||
}, | ||
session: people_kusama_runtime::SessionConfig { | ||
keys: collators::invulnerables() | ||
.into_iter() | ||
.map(|(acc, aura)| { | ||
( | ||
acc.clone(), // account id | ||
acc, // validator id | ||
people_kusama_runtime::SessionKeys { aura }, // session keys | ||
) | ||
}) | ||
.collect(), | ||
}, | ||
polkadot_xcm: people_kusama_runtime::PolkadotXcmConfig { | ||
safe_xcm_version: Some(SAFE_XCM_VERSION), | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}; | ||
|
||
build_genesis_storage( | ||
&genesis_config, | ||
people_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), | ||
) | ||
} |
52 changes: 52 additions & 0 deletions
52
integration-tests/emulated/chains/parachains/people/people-kusama/src/lib.rs
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,52 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
pub mod genesis; | ||
|
||
// Substrate | ||
use frame_support::traits::OnInitialize; | ||
|
||
// Cumulus | ||
use emulated_integration_tests_common::{ | ||
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, | ||
impls::Parachain, xcm_emulator::decl_test_parachains, | ||
}; | ||
|
||
// PeopleKusama Parachain declaration | ||
decl_test_parachains! { | ||
pub struct PeopleKusama { | ||
genesis = genesis::genesis(), | ||
on_init = { | ||
people_kusama_runtime::AuraExt::on_initialize(1); | ||
}, | ||
runtime = people_kusama_runtime, | ||
core = { | ||
XcmpMessageHandler: people_kusama_runtime::XcmpQueue, | ||
LocationToAccountId: people_kusama_runtime::xcm_config::LocationToAccountId, | ||
ParachainInfo: people_kusama_runtime::ParachainInfo, | ||
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, | ||
}, | ||
pallets = { | ||
PolkadotXcm: people_kusama_runtime::PolkadotXcm, | ||
Balances: people_kusama_runtime::Balances, | ||
Identity: people_kusama_runtime::Identity, | ||
IdentityMigrator: people_kusama_runtime::IdentityMigrator, | ||
} | ||
}, | ||
} | ||
|
||
// PeopleKusama implementation | ||
impl_accounts_helpers_for_parachain!(PeopleKusama); | ||
impl_assert_events_helpers_for_parachain!(PeopleKusama); |
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
35 changes: 35 additions & 0 deletions
35
integration-tests/emulated/tests/people/people-kusama/Cargo.toml
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,35 @@ | ||
[package] | ||
name = "people-kusama-integration-tests" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license = "Apache-2.0" | ||
description = "People Kusama runtime integration tests with xcm-emulator" | ||
publish = false | ||
|
||
[dependencies] | ||
codec = { package = "parity-scale-codec", version = "3.6.9" } | ||
|
||
# Substrate | ||
sp-runtime = { version = "32.0.0" } | ||
frame-support = { version = "29.0.0" } | ||
pallet-balances = { version = "29.0.0" } | ||
pallet-message-queue = { version = "32.0.0" } | ||
pallet-identity = { version = "29.0.0" } | ||
|
||
# Polkadot | ||
polkadot-runtime-common = { version = "8.0.1" } | ||
xcm = { package = "staging-xcm", version = "8.0.1" } | ||
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } | ||
|
||
# Cumulus | ||
parachains-common = { version = "8.0.0" } | ||
emulated-integration-tests-common = { version = "4.0.0" } | ||
asset-test-utils = { version = "8.0.1" } | ||
cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], version = "0.8.1" } | ||
|
||
# Local | ||
kusama-runtime-constants = { path = "../../../../../relay/kusama/constants" } | ||
kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } | ||
people-kusama-runtime = { path = "../../../../../system-parachains/people/people-kusama" } | ||
kusama-system-emulated-network = { path = "../../../networks/kusama-system" } |
Oops, something went wrong.