Skip to content

Commit f899a47

Browse files
lrazovicJuaniRios
authored andcommittedJan 16, 2025
feat: remove exteral runtimes deps
1 parent 20431c2 commit f899a47

13 files changed

+69
-1472
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

@@ -62,8 +62,7 @@ polkadot-service.workspace = true
6262
sp-authority-discovery.workspace = true
6363
sp-consensus-babe.workspace = true
6464
sp-consensus-beefy.workspace = true
65-
polkadot-runtime-constants.workspace = true
66-
system-parachains-constants.workspace = true
65+
rococo-runtime-constants.workspace = true
6766
pallet-staking.workspace = true
6867
pallet-membership.workspace = true
6968
orml-oracle.workspace = true
@@ -86,8 +85,7 @@ hex.workspace = true
8685
assets-common.workspace = true
8786

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

@@ -96,7 +94,6 @@ penpal-runtime = { path = "penpal", default-features = false }
9694
default = [ "development-settings", "instant-mode", "std" ]
9795
instant-mode = [ "polimec-runtime/instant-mode" ]
9896
std = [
99-
"asset-hub-polkadot-runtime/std",
10097
"cumulus-pallet-xcm/std",
10198
"cumulus-primitives-core/std",
10299
"frame-metadata-hash-extension/std",
@@ -139,9 +136,7 @@ std = [
139136
"polkadot-core-primitives/std",
140137
"polkadot-parachain-primitives/std",
141138
"polkadot-primitives/std",
142-
"polkadot-runtime-constants/std",
143139
"polkadot-runtime-parachains/std",
144-
"polkadot-runtime/std",
145140
"scale-info/std",
146141
"serde/std",
147142
"sp-arithmetic/std",
@@ -153,15 +148,15 @@ std = [
153148
"sp-io/std",
154149
"sp-runtime/std",
155150
"sp-std/std",
156-
"system-parachains-constants/std",
151+
"rococo-runtime-constants/std",
152+
"rococo-runtime/std",
157153
"xcm-builder/std",
158154
"xcm-executor/std",
159155
"xcm-fee-payment-runtime-api/std",
160156
"xcm/std",
161157
]
162158
development-settings = [ "polimec-runtime/development-settings" ]
163159
runtime-benchmarks = [
164-
"asset-hub-polkadot-runtime/runtime-benchmarks",
165160
"cumulus-primitives-core/runtime-benchmarks",
166161
"frame-support/runtime-benchmarks",
167162
"frame-system/runtime-benchmarks",
@@ -195,11 +190,10 @@ runtime-benchmarks = [
195190
"polkadot-parachain-primitives/runtime-benchmarks",
196191
"polkadot-primitives/runtime-benchmarks",
197192
"polkadot-runtime-parachains/runtime-benchmarks",
198-
"polkadot-runtime/runtime-benchmarks",
199193
"polkadot-service/runtime-benchmarks",
200194
"sp-runtime/runtime-benchmarks",
195+
"rococo-runtime/runtime-benchmarks",
201196
"xcm-builder/runtime-benchmarks",
202197
"xcm-executor/runtime-benchmarks",
203198
"xcm-fee-payment-runtime-api/runtime-benchmarks",
204199
]
205-

‎integration-tests/src/constants.rs

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

238237
pub fn get_host_config() -> HostConfiguration<BlockNumber> {
239238
HostConfiguration {
@@ -254,17 +253,16 @@ pub mod polkadot {
254253
para_assignment: AssignmentId,
255254
authority_discovery: AuthorityDiscoveryId,
256255
beefy: BeefyId,
257-
) -> polkadot_runtime::SessionKeys {
258-
polkadot_runtime::SessionKeys { babe, grandpa, para_validator, para_assignment, authority_discovery, beefy }
256+
) -> rococo_runtime::SessionKeys {
257+
rococo_runtime::SessionKeys { babe, grandpa, para_validator, para_assignment, authority_discovery, beefy }
259258
}
260259

261260
pub fn genesis() -> Storage {
262-
let genesis_config = polkadot_runtime::RuntimeGenesisConfig {
263-
system: Default::default(),
264-
balances: polkadot_runtime::BalancesConfig {
261+
let genesis_config = rococo_runtime::RuntimeGenesisConfig {
262+
balances: rococo_runtime::BalancesConfig {
265263
balances: accounts::init_balances().iter().cloned().map(|k| (k, INITIAL_DEPOSIT)).collect(),
266264
},
267-
session: polkadot_runtime::SessionConfig {
265+
session: rococo_runtime::SessionConfig {
268266
keys: validators::initial_authorities()
269267
.iter()
270268
.map(|x| {
@@ -284,99 +282,19 @@ pub mod polkadot {
284282
})
285283
.collect::<Vec<_>>(),
286284
},
287-
staking: polkadot_runtime::StakingConfig {
288-
validator_count: validators::initial_authorities().len() as u32,
289-
minimum_validator_count: 1,
290-
stakers: validators::initial_authorities()
291-
.iter()
292-
.map(|x| (x.0.clone(), x.1.clone(), STASH, polkadot_runtime::StakerStatus::Validator))
293-
.collect(),
294-
invulnerables: validators::initial_authorities().iter().map(|x| x.0.clone()).collect(),
295-
force_era: pallet_staking::Forcing::ForceNone,
296-
slash_reward_fraction: Perbill::from_percent(10),
297-
..Default::default()
298-
},
299-
babe: polkadot_runtime::BabeConfig {
285+
babe: rococo_runtime::BabeConfig {
300286
authorities: Default::default(),
301-
epoch_config: polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG,
287+
epoch_config: rococo_runtime::BABE_GENESIS_EPOCH_CONFIG,
302288
..Default::default()
303289
},
304-
configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() },
290+
configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() },
305291
..Default::default()
306292
};
307293

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

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

388306
pub fn genesis() -> Storage {
389307
let mut funded_accounts = vec![(
390-
<Penpal<PolkadotNet>>::sovereign_account_id_of(
391-
(Parent, xcm::prelude::Parachain(asset_hub::PARA_ID)).into(),
392-
),
308+
<Penpal<PolkadotNet>>::sovereign_account_id_of((Parent, xcm::prelude::Parachain(1000)).into()),
393309
INITIAL_DEPOSIT,
394310
)];
395311
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)