Skip to content

Commit

Permalink
polkadot-parachain-primitives should not depend on frame-support. (
Browse files Browse the repository at this point in the history
…paritytech#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 <[email protected]>
Co-authored-by: command-bot <>
  • Loading branch information
JoshOrndorff and Joshy Orndorff authored Oct 25, 2023
1 parent f6560c2 commit bdf1868
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions polkadot/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand All @@ -28,16 +28,13 @@ default = [ "std" ]
wasm-api = []
std = [
"bounded-collections/std",
"frame-support/std",
"parity-scale-codec/std",
"polkadot-core-primitives/std",
"scale-info/std",
"serde/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" ]
2 changes: 1 addition & 1 deletion polkadot/parachain/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down

0 comments on commit bdf1868

Please sign in to comment.