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 <git-user-email.h0ly5@simplelogin.com>
Co-authored-by: command-bot <>
This commit is contained in:
Joshy Orndorff
2023-10-25 16:32:18 -04:00
committed by GitHub
parent f6560c2b72
commit bdf186870d
3 changed files with 9 additions and 12 deletions
Generated
+5 -5
View File
@@ -12625,7 +12625,6 @@ version = "1.0.0"
dependencies = [ dependencies = [
"bounded-collections", "bounded-collections",
"derive_more", "derive_more",
"frame-support",
"parity-scale-codec", "parity-scale-codec",
"polkadot-core-primitives", "polkadot-core-primitives",
"scale-info", "scale-info",
@@ -12633,6 +12632,7 @@ dependencies = [
"sp-core", "sp-core",
"sp-runtime", "sp-runtime",
"sp-std", "sp-std",
"sp-weights",
] ]
[[package]] [[package]]
@@ -13440,9 +13440,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.68" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -13639,9 +13639,9 @@ dependencies = [
[[package]] [[package]]
name = "quinn-proto" name = "quinn-proto"
version = "0.9.4" version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989"
dependencies = [ dependencies = [
"bytes", "bytes",
"rand 0.8.5", "rand 0.8.5",
+3 -6
View File
@@ -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-std = { path = "../../substrate/primitives/std", default-features = false }
sp-runtime = { path = "../../substrate/primitives/runtime", default-features = false, features = ["serde"] } sp-runtime = { path = "../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
sp-core = { path = "../../substrate/primitives/core", 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 } polkadot-core-primitives = { path = "../core-primitives", default-features = false }
derive_more = "0.99.11" derive_more = "0.99.11"
bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] } bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] }
@@ -28,7 +28,6 @@ default = [ "std" ]
wasm-api = [] wasm-api = []
std = [ std = [
"bounded-collections/std", "bounded-collections/std",
"frame-support/std",
"parity-scale-codec/std", "parity-scale-codec/std",
"polkadot-core-primitives/std", "polkadot-core-primitives/std",
"scale-info/std", "scale-info/std",
@@ -36,8 +35,6 @@ std = [
"sp-core/std", "sp-core/std",
"sp-runtime/std", "sp-runtime/std",
"sp-std/std", "sp-std/std",
"sp-weights/std",
] ]
runtime-benchmarks = [ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks" ]
"frame-support/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
+1 -1
View File
@@ -20,12 +20,12 @@
use sp_std::vec::Vec; use sp_std::vec::Vec;
use bounded_collections::{BoundedVec, ConstU32}; use bounded_collections::{BoundedVec, ConstU32};
use frame_support::weights::Weight;
use parity_scale_codec::{CompactAs, Decode, Encode, MaxEncodedLen}; use parity_scale_codec::{CompactAs, Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo; use scale_info::TypeInfo;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sp_core::{bytes, RuntimeDebug, TypeId}; use sp_core::{bytes, RuntimeDebug, TypeId};
use sp_runtime::traits::Hash as _; use sp_runtime::traits::Hash as _;
use sp_weights::Weight;
use polkadot_core_primitives::{Hash, OutboundHrmpMessage}; use polkadot_core_primitives::{Hash, OutboundHrmpMessage};