-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
286 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...rachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/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,25 @@ | ||
[package] | ||
name = "coretime-rococo-emulated-chain" | ||
version = "0.1.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
license = "Apache-2.0" | ||
description = "Coretime Rococo emulated chain" | ||
publish = false | ||
|
||
[dependencies] | ||
serde_json = "1.0.104" | ||
|
||
# Substrate | ||
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false } | ||
sp-runtime = { path = "../../../../../../../../substrate/primitives/runtime", default-features = false } | ||
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false } | ||
|
||
# Polakadot | ||
parachains-common = { path = "../../../../../../../parachains/common" } | ||
|
||
# Cumulus | ||
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false } | ||
emulated-integration-tests-common = { path = "../../../../common", default-features = false } | ||
coretime-rococo-runtime = { path = "../../../../../../runtimes/coretime/coretime-rococo" } | ||
rococo-emulated-chain = { path = "../../../relays/rococo" } |
66 changes: 66 additions & 0 deletions
66
...ains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/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,66 @@ | ||
// 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 coretime_rococo_runtime::{ | ||
CollatorSelectionConfig, ParachainInfoConfig, PolkadotXcmConfig, RuntimeGenesisConfig, | ||
SessionConfig, SessionKeys, SystemConfig, WASM_BINARY, | ||
}; | ||
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 = 1005; | ||
pub const ED: Balance = parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT; | ||
|
||
pub fn genesis() -> Storage { | ||
let genesis_config = RuntimeGenesisConfig { | ||
system: SystemConfig::default(), | ||
parachain_info: ParachainInfoConfig { | ||
parachain_id: ParaId::from(PARA_ID), | ||
..Default::default() | ||
}, | ||
collator_selection: CollatorSelectionConfig { | ||
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), | ||
candidacy_bond: ED * 16, | ||
..Default::default() | ||
}, | ||
session: SessionConfig { | ||
keys: collators::invulnerables() | ||
.into_iter() | ||
.map(|(acc, aura)| { | ||
( | ||
acc.clone(), // account id | ||
acc, // validator id | ||
SessionKeys { aura }, // session keys | ||
) | ||
}) | ||
.collect(), | ||
}, | ||
polkadot_xcm: PolkadotXcmConfig { | ||
safe_xcm_version: Some(SAFE_XCM_VERSION), | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}; | ||
|
||
build_genesis_storage( | ||
&genesis_config, | ||
WASM_BINARY.expect("WASM binary was not built, please build it!"), | ||
) | ||
} |
52 changes: 52 additions & 0 deletions
52
...rachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/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 coretime_rococo_runtime::{ | ||
xcm_config::LocationToAccountId, AuraExt, Balances, Broker, ParachainInfo, PolkadotXcm, | ||
XcmpQueue, | ||
}; | ||
use emulated_integration_tests_common::{ | ||
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, | ||
impls::Parachain, xcm_emulator::decl_test_parachains, | ||
}; | ||
|
||
decl_test_parachains! { | ||
pub struct CoretimeRococo { | ||
genesis = genesis::genesis(), | ||
on_init = { | ||
AuraExt::on_initialize(1); | ||
}, | ||
runtime = coretime_rococo_runtime, | ||
core = { | ||
XcmpMessageHandler: XcmpQueue, | ||
LocationToAccountId: LocationToAccountId, | ||
ParachainInfo: ParachainInfo, | ||
}, | ||
pallets = { | ||
PolkadotXcm: PolkadotXcm, | ||
Balances: Balances, | ||
Broker: Broker, | ||
} | ||
}, | ||
} | ||
|
||
impl_accounts_helpers_for_parachain!(CoretimeRococo); | ||
impl_assert_events_helpers_for_parachain!(CoretimeRococo); |
25 changes: 25 additions & 0 deletions
25
...achains/integration-tests/emulated/chains/parachains/coretime/coretime-westend/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,25 @@ | ||
[package] | ||
name = "coretime-westend-emulated-chain" | ||
version = "0.1.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
license = "Apache-2.0" | ||
description = "Coretime Westend emulated chain" | ||
publish = false | ||
|
||
[dependencies] | ||
serde_json = "1.0.104" | ||
|
||
# Substrate | ||
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false } | ||
sp-runtime = { path = "../../../../../../../../substrate/primitives/runtime", default-features = false } | ||
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false } | ||
|
||
# Polakadot | ||
parachains-common = { path = "../../../../../../../parachains/common" } | ||
|
||
# Cumulus | ||
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false } | ||
emulated-integration-tests-common = { path = "../../../../common", default-features = false } | ||
coretime-westend-runtime = { path = "../../../../../../runtimes/coretime/coretime-westend" } | ||
westend-emulated-chain = { path = "../../../relays/westend" } |
66 changes: 66 additions & 0 deletions
66
...ins/integration-tests/emulated/chains/parachains/coretime/coretime-westend/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,66 @@ | ||
// 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 coretime_westend_runtime::{ | ||
CollatorSelectionConfig, ParachainInfoConfig, PolkadotXcmConfig, RuntimeGenesisConfig, | ||
SessionConfig, SessionKeys, SystemConfig, WASM_BINARY, | ||
}; | ||
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 = 1005; | ||
pub const ED: Balance = parachains_common::westend::currency::EXISTENTIAL_DEPOSIT; | ||
|
||
pub fn genesis() -> Storage { | ||
let genesis_config = RuntimeGenesisConfig { | ||
system: SystemConfig::default(), | ||
parachain_info: ParachainInfoConfig { | ||
parachain_id: ParaId::from(PARA_ID), | ||
..Default::default() | ||
}, | ||
collator_selection: CollatorSelectionConfig { | ||
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), | ||
candidacy_bond: ED * 16, | ||
..Default::default() | ||
}, | ||
session: SessionConfig { | ||
keys: collators::invulnerables() | ||
.into_iter() | ||
.map(|(acc, aura)| { | ||
( | ||
acc.clone(), // account id | ||
acc, // validator id | ||
SessionKeys { aura }, // session keys | ||
) | ||
}) | ||
.collect(), | ||
}, | ||
polkadot_xcm: PolkadotXcmConfig { | ||
safe_xcm_version: Some(SAFE_XCM_VERSION), | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}; | ||
|
||
build_genesis_storage( | ||
&genesis_config, | ||
WASM_BINARY.expect("WASM binary was not built, please build it!"), | ||
) | ||
} |
52 changes: 52 additions & 0 deletions
52
...achains/integration-tests/emulated/chains/parachains/coretime/coretime-westend/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 coretime_westend_runtime::{ | ||
xcm_config::LocationToAccountId, AuraExt, Balances, Broker, ParachainInfo, PolkadotXcm, | ||
XcmpQueue, | ||
}; | ||
use emulated_integration_tests_common::{ | ||
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, | ||
impls::Parachain, xcm_emulator::decl_test_parachains, | ||
}; | ||
|
||
decl_test_parachains! { | ||
pub struct CoretimeWestend { | ||
genesis = genesis::genesis(), | ||
on_init = { | ||
AuraExt::on_initialize(1); | ||
}, | ||
runtime = coretime_westend_runtime, | ||
core = { | ||
XcmpMessageHandler: XcmpQueue, | ||
LocationToAccountId: LocationToAccountId, | ||
ParachainInfo: ParachainInfo, | ||
}, | ||
pallets = { | ||
PolkadotXcm: PolkadotXcm, | ||
Balances: Balances, | ||
Broker: Broker, | ||
} | ||
}, | ||
} | ||
|
||
impl_accounts_helpers_for_parachain!(CoretimeWestend); | ||
impl_assert_events_helpers_for_parachain!(CoretimeWestend); |