Skip to content

Commit 06c059c

Browse files
committed
Add tests scaffolding
1 parent 1841f23 commit 06c059c

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
name = "coretime-rococo-integration-tests"
3+
version = "0.1.0"
4+
authors.workspace = true
5+
edition.workspace = true
6+
license = "Apache-2.0"
7+
description = "Coretime Rococo runtime integration tests with xcm-emulator"
8+
publish = false
9+
10+
[dependencies]
11+
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
12+
assert_matches = "1.5.0"
13+
14+
# Substrate
15+
sp-runtime = { path = "../../../../../../../substrate/primitives/runtime", default-features = false }
16+
frame-support = { path = "../../../../../../../substrate/frame/support", default-features = false }
17+
pallet-balances = { path = "../../../../../../../substrate/frame/balances", default-features = false }
18+
pallet-assets = { path = "../../../../../../../substrate/frame/assets", default-features = false }
19+
pallet-asset-conversion = { path = "../../../../../../../substrate/frame/asset-conversion", default-features = false }
20+
pallet-message-queue = { path = "../../../../../../../substrate/frame/message-queue", default-features = false }
21+
pallet-broker = { path = "../../../../../../../substrate/frame/broker", default-features = false }
22+
23+
# Polkadot
24+
xcm = { package = "staging-xcm", path = "../../../../../../../polkadot/xcm", default-features = false }
25+
pallet-xcm = { path = "../../../../../../../polkadot/xcm/pallet-xcm", default-features = false }
26+
xcm-executor = { package = "staging-xcm-executor", path = "../../../../../../../polkadot/xcm/xcm-executor", default-features = false }
27+
rococo-runtime = { path = "../../../../../../../polkadot/runtime/rococo" }
28+
rococo-runtime-constants = { path = "../../../../../../../polkadot/runtime/rococo/constants" }
29+
polkadot-primitives = { path = "../../../../../../../polkadot/primitives" }
30+
polkadot-runtime-common = { path = "../../../../../../../polkadot/runtime/common" }
31+
32+
# Cumulus
33+
asset-test-utils = { path = "../../../../../runtimes/assets/test-utils" }
34+
parachains-common = { path = "../../../../../../parachains/common" }
35+
coretime-rococo-runtime = { path = "../../../../../runtimes/coretime/coretime-rococo" }
36+
emulated-integration-tests-common = { path = "../../../common", default-features = false }
37+
penpal-runtime = { path = "../../../../../runtimes/testing/penpal" }
38+
rococo-system-emulated-network = { path = "../../../networks/rococo-system" }
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright (C) Parity Technologies (UK) Ltd.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
pub use codec::Encode;
17+
18+
// Substrate
19+
pub use frame_support::{
20+
assert_err, assert_ok,
21+
pallet_prelude::Weight,
22+
sp_runtime::{AccountId32, DispatchError, DispatchResult},
23+
traits::fungibles::Inspect,
24+
};
25+
26+
// Polkadot
27+
pub use xcm::{
28+
prelude::{AccountId32 as AccountId32Junction, *},
29+
v3::{Error, NetworkId::Rococo as RococoId},
30+
};
31+
32+
// Cumulus
33+
pub use asset_test_utils::xcm_helpers;
34+
pub use emulated_integration_tests_common::{
35+
test_parachain_is_trusted_teleporter,
36+
xcm_emulator::{
37+
assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para,
38+
RelayChain as Relay, Test, TestArgs, TestContext, TestExt,
39+
},
40+
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
41+
PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3,
42+
};
43+
pub use parachains_common::{AccountId, Balance};
44+
pub use rococo_system_emulated_network::{
45+
coretime_rococo_emulated_chain::{
46+
genesis::ED as CORETIME_ROCOCO_ED, CoretimeRococoParaPallet as CoretimeRococoPallet,
47+
},
48+
rococo_emulated_chain::{genesis::ED as ROCOCO_ED, RococoRelayPallet as RococoPallet},
49+
CoretimeRococoPara as CoretimeRococo, CoretimeRococoParaReceiver as CoretimeRococoReceiver,
50+
CoretimeRococoParaSender as CoretimeRococoSender, PenpalAPara as PenpalA,
51+
RococoRelay as Rococo, RococoRelayReceiver as RococoReceiver,
52+
RococoRelaySender as RococoSender,
53+
};
54+
55+
// pub const ASSET_ID: u32 = 1;
56+
// pub const ASSET_MIN_BALANCE: u128 = 1000;
57+
pub type RelayToSystemParaTest = Test<Rococo, CoretimeRococo>;
58+
pub type RelayToParaTest = Test<Rococo, PenpalA>;
59+
pub type SystemParaToRelayTest = Test<CoretimeRococo, Rococo>;
60+
pub type SystemParaToParaTest = Test<CoretimeRococo, PenpalA>;
61+
pub type ParaToSystemParaTest = Test<PenpalA, CoretimeRococo>;
62+
63+
#[cfg(test)]
64+
mod tests;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) Parity Technologies (UK) Ltd.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.

0 commit comments

Comments
 (0)