Skip to content

Commit a384493

Browse files
committed
feat: remove exteral runtimes deps
1 parent b6334e5 commit a384493

11 files changed

+57
-1452
lines changed

Cargo.lock

+9-777
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ default-members = ["nodes/*", "pallets/*"]
1212
resolver = "2"
1313

1414
[workspace.lints.clippy]
15-
all = { level = "warn", priority = -1}
15+
all = { level = "warn", priority = -1 }
1616
inconsistent_digit_grouping = "allow"
1717
zero_prefixed_literal = "allow"
1818
missing_errors_doc = "allow"
1919
must_use_candidate = "allow"
2020
identity_op = "allow"
21-
tabs_in_doc_comments= "allow"
21+
tabs_in_doc_comments = "allow"
2222

2323
[workspace.lints.rust]
2424
unreachable_patterns = "deny"
@@ -148,7 +148,7 @@ sp-authority-discovery = { version = "33.0.0", default-features = false }
148148
sp-consensus-babe = { version = "0.39.0", default-features = false }
149149
pallet-message-queue = { version = "38.0.0", default-features = false }
150150
sp-weights = { version = "31.0.0", default-features = false }
151-
sp-application-crypto = {version = "37.0.0", default-features = false}
151+
sp-application-crypto = { version = "37.0.0", default-features = false }
152152

153153
# FRAME
154154
assets-common = { version = "0.14.0", default-features = false }
@@ -246,7 +246,5 @@ cumulus-pallet-session-benchmarking = { version = "16.0.0", default-features = f
246246

247247
# Runtimes
248248
polimec-runtime = { path = "runtimes/polimec" }
249-
asset-hub-polkadot-runtime = { git = 'https://github.com/polkadot-fellows/runtimes', default-features = false, rev = 'c5080e43321476ec82d69b710ebfaafb634f7475' }
250-
polkadot-runtime-constants = { git = 'https://github.com/polkadot-fellows/runtimes', default-features = false, rev = 'c5080e43321476ec82d69b710ebfaafb634f7475' }
251-
system-parachains-constants = { git = 'https://github.com/polkadot-fellows/runtimes', default-features = false, rev = 'c5080e43321476ec82d69b710ebfaafb634f7475' }
252-
polkadot-runtime = { git = 'https://github.com/polkadot-fellows/runtimes', default-features = false, rev = 'c5080e43321476ec82d69b710ebfaafb634f7475' }
249+
rococo-runtime-constants = { version = "14.0.0" }
250+
rococo-runtime = { version = "14.0.0" }

integration-tests/Cargo.toml

+6-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ workspace = true
1717
substrate-wasm-builder.workspace = true
1818

1919
[dependencies]
20-
serde = { workspace = true }
20+
serde = { workspace = true }
2121
parity-scale-codec = { workspace = true, features = ["derive"] }
2222
scale-info = { workspace = true, features = ["derive"] }
2323

@@ -63,8 +63,7 @@ polkadot-service.workspace = true
6363
sp-authority-discovery.workspace = true
6464
sp-consensus-babe.workspace = true
6565
sp-consensus-beefy.workspace = true
66-
polkadot-runtime-constants.workspace = true
67-
system-parachains-constants.workspace = true
66+
rococo-runtime-constants.workspace = true
6867
pallet-staking.workspace = true
6968
pallet-membership.workspace = true
7069
orml-oracle.workspace = true
@@ -87,8 +86,7 @@ hex.workspace = true
8786
assets-common.workspace = true
8887

8988
# Runtimes
90-
polkadot-runtime.workspace = true
91-
asset-hub-polkadot-runtime.workspace = true
89+
rococo-runtime.workspace = true
9290
polimec-runtime.workspace = true
9391
penpal-runtime = { path = "penpal", default-features = false }
9492

@@ -97,7 +95,6 @@ penpal-runtime = { path = "penpal", default-features = false }
9795
default = [ "development-settings", "instant-mode", "std" ]
9896
instant-mode = [ "polimec-runtime/instant-mode" ]
9997
std = [
100-
"asset-hub-polkadot-runtime/std",
10198
"cumulus-pallet-xcm/std",
10299
"cumulus-primitives-core/std",
103100
"frame-metadata-hash-extension/std",
@@ -140,9 +137,7 @@ std = [
140137
"polkadot-core-primitives/std",
141138
"polkadot-parachain-primitives/std",
142139
"polkadot-primitives/std",
143-
"polkadot-runtime-constants/std",
144140
"polkadot-runtime-parachains/std",
145-
"polkadot-runtime/std",
146141
"scale-info/std",
147142
"serde/std",
148143
"sp-arithmetic/std",
@@ -154,15 +149,15 @@ std = [
154149
"sp-io/std",
155150
"sp-runtime/std",
156151
"sp-std/std",
157-
"system-parachains-constants/std",
152+
"rococo-runtime-constants/std",
153+
"rococo-runtime/std",
158154
"xcm-builder/std",
159155
"xcm-executor/std",
160156
"xcm-fee-payment-runtime-api/std",
161157
"xcm/std",
162158
]
163159
development-settings = [ "polimec-runtime/development-settings" ]
164160
runtime-benchmarks = [
165-
"asset-hub-polkadot-runtime/runtime-benchmarks",
166161
"cumulus-primitives-core/runtime-benchmarks",
167162
"frame-support/runtime-benchmarks",
168163
"frame-system/runtime-benchmarks",
@@ -196,11 +191,10 @@ runtime-benchmarks = [
196191
"polkadot-parachain-primitives/runtime-benchmarks",
197192
"polkadot-primitives/runtime-benchmarks",
198193
"polkadot-runtime-parachains/runtime-benchmarks",
199-
"polkadot-runtime/runtime-benchmarks",
200194
"polkadot-service/runtime-benchmarks",
201195
"sp-runtime/runtime-benchmarks",
196+
"rococo-runtime/runtime-benchmarks",
202197
"xcm-builder/runtime-benchmarks",
203198
"xcm-executor/runtime-benchmarks",
204199
"xcm-fee-payment-runtime-api/runtime-benchmarks",
205200
]
206-

integration-tests/src/constants.rs

+11-98
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
231231
// Polkadot
232232
pub mod polkadot {
233233
use super::*;
234-
pub const ED: Balance = polkadot_runtime_constants::currency::EXISTENTIAL_DEPOSIT;
235-
const STASH: u128 = 100 * polkadot_runtime_constants::currency::UNITS;
234+
pub const ED: Balance = rococo_runtime_constants::currency::EXISTENTIAL_DEPOSIT;
236235

237236
pub fn get_host_config() -> HostConfiguration<BlockNumber> {
238237
HostConfiguration {
@@ -253,17 +252,16 @@ pub mod polkadot {
253252
para_assignment: AssignmentId,
254253
authority_discovery: AuthorityDiscoveryId,
255254
beefy: BeefyId,
256-
) -> polkadot_runtime::SessionKeys {
257-
polkadot_runtime::SessionKeys { babe, grandpa, para_validator, para_assignment, authority_discovery, beefy }
255+
) -> rococo_runtime::SessionKeys {
256+
rococo_runtime::SessionKeys { babe, grandpa, para_validator, para_assignment, authority_discovery, beefy }
258257
}
259258

260259
pub fn genesis() -> Storage {
261-
let genesis_config = polkadot_runtime::RuntimeGenesisConfig {
262-
system: Default::default(),
263-
balances: polkadot_runtime::BalancesConfig {
260+
let genesis_config = rococo_runtime::RuntimeGenesisConfig {
261+
balances: rococo_runtime::BalancesConfig {
264262
balances: accounts::init_balances().iter().cloned().map(|k| (k, INITIAL_DEPOSIT)).collect(),
265263
},
266-
session: polkadot_runtime::SessionConfig {
264+
session: rococo_runtime::SessionConfig {
267265
keys: validators::initial_authorities()
268266
.iter()
269267
.map(|x| {
@@ -283,99 +281,19 @@ pub mod polkadot {
283281
})
284282
.collect::<Vec<_>>(),
285283
},
286-
staking: polkadot_runtime::StakingConfig {
287-
validator_count: validators::initial_authorities().len() as u32,
288-
minimum_validator_count: 1,
289-
stakers: validators::initial_authorities()
290-
.iter()
291-
.map(|x| (x.0.clone(), x.1.clone(), STASH, polkadot_runtime::StakerStatus::Validator))
292-
.collect(),
293-
invulnerables: validators::initial_authorities().iter().map(|x| x.0.clone()).collect(),
294-
force_era: pallet_staking::Forcing::ForceNone,
295-
slash_reward_fraction: Perbill::from_percent(10),
296-
..Default::default()
297-
},
298-
babe: polkadot_runtime::BabeConfig {
284+
babe: rococo_runtime::BabeConfig {
299285
authorities: Default::default(),
300-
epoch_config: polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG,
286+
epoch_config: rococo_runtime::BABE_GENESIS_EPOCH_CONFIG,
301287
..Default::default()
302288
},
303-
configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() },
289+
configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() },
304290
..Default::default()
305291
};
306292

307293
genesis_config.build_storage().unwrap()
308294
}
309295
}
310296

311-
// AssetHub
312-
pub mod asset_hub {
313-
use super::*;
314-
use crate::{AssetHub, PolkadotNet};
315-
use xcm::v4::Parent;
316-
317-
pub const PARA_ID: u32 = 1000;
318-
pub const ED: Balance = system_parachains_constants::polkadot::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT;
319-
320-
pub fn genesis() -> Storage {
321-
let mut funded_accounts = vec![
322-
(
323-
<AssetHub<PolkadotNet>>::sovereign_account_id_of(
324-
(Parent, xcm::prelude::Parachain(penpal::PARA_ID)).into(),
325-
),
326-
INITIAL_DEPOSIT,
327-
),
328-
(
329-
<AssetHub<PolkadotNet>>::sovereign_account_id_of(
330-
(Parent, xcm::prelude::Parachain(polimec::PARA_ID)).into(),
331-
),
332-
INITIAL_DEPOSIT,
333-
),
334-
];
335-
funded_accounts.extend(accounts::init_balances().iter().cloned().map(|k| (k, INITIAL_DEPOSIT)));
336-
337-
let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig {
338-
system: Default::default(),
339-
balances: asset_hub_polkadot_runtime::BalancesConfig { balances: funded_accounts },
340-
parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig {
341-
parachain_id: PARA_ID.into(),
342-
..Default::default()
343-
},
344-
collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig {
345-
invulnerables: collators::invulnerables_asset_hub().iter().cloned().map(|(acc, _)| acc).collect(),
346-
candidacy_bond: ED * 16,
347-
..Default::default()
348-
},
349-
session: asset_hub_polkadot_runtime::SessionConfig {
350-
keys: collators::invulnerables_asset_hub()
351-
.into_iter()
352-
.map(|(acc, aura)| {
353-
(
354-
acc.clone(), // account id
355-
acc, // validator id
356-
asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys
357-
)
358-
})
359-
.collect(),
360-
},
361-
aura: Default::default(),
362-
aura_ext: Default::default(),
363-
parachain_system: Default::default(),
364-
polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig {
365-
safe_xcm_version: Some(SAFE_XCM_VERSION),
366-
..Default::default()
367-
},
368-
assets: Default::default(),
369-
foreign_assets: Default::default(),
370-
transaction_payment: Default::default(),
371-
vesting: Default::default(),
372-
pool_assets: Default::default(),
373-
};
374-
375-
genesis_config.build_storage().unwrap()
376-
}
377-
}
378-
379297
// Penpal
380298
pub mod penpal {
381299
use super::*;
@@ -386,9 +304,7 @@ pub mod penpal {
386304

387305
pub fn genesis() -> Storage {
388306
let mut funded_accounts = vec![(
389-
<Penpal<PolkadotNet>>::sovereign_account_id_of(
390-
(Parent, xcm::prelude::Parachain(asset_hub::PARA_ID)).into(),
391-
),
307+
<Penpal<PolkadotNet>>::sovereign_account_id_of((Parent, xcm::prelude::Parachain(1000)).into()),
392308
INITIAL_DEPOSIT,
393309
)];
394310
funded_accounts.extend(accounts::init_balances().iter().cloned().map(|k| (k, INITIAL_DEPOSIT)));
@@ -500,10 +416,7 @@ pub mod polimec {
500416
PolimecNet::sovereign_account_id_of((Parent, xcm::prelude::Parachain(penpal::PARA_ID)).into()),
501417
INITIAL_DEPOSIT,
502418
),
503-
(
504-
PolimecNet::sovereign_account_id_of((Parent, xcm::prelude::Parachain(asset_hub::PARA_ID)).into()),
505-
INITIAL_DEPOSIT,
506-
),
419+
(PolimecNet::sovereign_account_id_of((Parent, xcm::prelude::Parachain(1000)).into()), INITIAL_DEPOSIT),
507420
];
508421
let alice_account = PolimecNet::account_id_of(accounts::ALICE);
509422
let bob_account: AccountId = PolimecNet::account_id_of(accounts::BOB);

0 commit comments

Comments
 (0)