From bdf186870dc4a7d74d59cad338baf8478d0715b4 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 25 Oct 2023 16:32:18 -0400 Subject: [PATCH] `polkadot-parachain-primitives` should not depend on `frame-support`. (#1897) This PR does not make any functional changes to the code. Rather, it restructures the dependency graph. Before this PR, the crate `polkadot-parachain-primitives` depended directly on the crate `frame-support`. This is wrong in principal because a parachain does not necessarily have anything to do with frame. This dependency was only for the `Weight` type which was just a re-export from `sp-weights` anyway. So this PR changes the dependency to be directly on the much lighter `sp-weights`. --------- Co-authored-by: Joshy Orndorff Co-authored-by: command-bot <> --- Cargo.lock | 10 +++++----- polkadot/parachain/Cargo.toml | 9 +++------ polkadot/parachain/src/primitives.rs | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1a1b1877a92..7208b77e1098 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12625,7 +12625,6 @@ version = "1.0.0" dependencies = [ "bounded-collections", "derive_more", - "frame-support", "parity-scale-codec", "polkadot-core-primitives", "scale-info", @@ -12633,6 +12632,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", + "sp-weights", ] [[package]] @@ -13440,9 +13440,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -13639,9 +13639,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ "bytes", "rand 0.8.5", diff --git a/polkadot/parachain/Cargo.toml b/polkadot/parachain/Cargo.toml index 681bee3c3273..27aa117a87f0 100644 --- a/polkadot/parachain/Cargo.toml +++ b/polkadot/parachain/Cargo.toml @@ -15,7 +15,7 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive sp-std = { path = "../../substrate/primitives/std", default-features = false } sp-runtime = { path = "../../substrate/primitives/runtime", default-features = false, features = ["serde"] } sp-core = { path = "../../substrate/primitives/core", default-features = false, features = ["serde"] } -frame-support = { path = "../../substrate/frame/support", default-features = false } +sp-weights = { path = "../../substrate/primitives/weights", default-features = false } polkadot-core-primitives = { path = "../core-primitives", default-features = false } derive_more = "0.99.11" bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] } @@ -28,7 +28,6 @@ default = [ "std" ] wasm-api = [] std = [ "bounded-collections/std", - "frame-support/std", "parity-scale-codec/std", "polkadot-core-primitives/std", "scale-info/std", @@ -36,8 +35,6 @@ std = [ "sp-core/std", "sp-runtime/std", "sp-std/std", + "sp-weights/std", ] -runtime-benchmarks = [ - "frame-support/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] +runtime-benchmarks = [ "sp-runtime/runtime-benchmarks" ] diff --git a/polkadot/parachain/src/primitives.rs b/polkadot/parachain/src/primitives.rs index 3247e841422e..dc89ae7868e1 100644 --- a/polkadot/parachain/src/primitives.rs +++ b/polkadot/parachain/src/primitives.rs @@ -20,12 +20,12 @@ use sp_std::vec::Vec; use bounded_collections::{BoundedVec, ConstU32}; -use frame_support::weights::Weight; use parity_scale_codec::{CompactAs, Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_core::{bytes, RuntimeDebug, TypeId}; use sp_runtime::traits::Hash as _; +use sp_weights::Weight; use polkadot_core_primitives::{Hash, OutboundHrmpMessage};