Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove: serde feature from frame-system #688

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pallets/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ thiserror-no-std.workspace = true

# Substrate
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [ "derive"] }
scale-info = { workspace = true, default-features = false }
serde = { workspace = true, default-features = false, optional = true }
scale-info = { workspace = true, default-features = false, features = ["derive", "serde"] }
serde = { workspace = true, default-features = false, features = ["alloc", "derive"] }
frame-support = { workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false, features = ["serde"] }
sp-io = { workspace = true, default-features = false }
Expand Down Expand Up @@ -76,7 +76,6 @@ std = [
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"serde",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
Expand All @@ -85,7 +84,6 @@ try-runtime = [
"sp-runtime/try-runtime",
]
experimental = [ "frame-support/experimental" ]
serde = [ "dep:serde" ]

# It enables the corruption of header extensions where block number is greater than 20.
# NOTE: Only for testing and development purposes.
Expand Down
11 changes: 2 additions & 9 deletions pallets/system/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,20 @@ use frame_support::{
};
use kate::config::{MAX_BLOCK_COLUMNS, MAX_BLOCK_ROWS};
use scale_info::{build::Fields, Path, Type, TypeInfo};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use sp_runtime::{traits::Bounded, Perbill, RuntimeDebug};
use sp_runtime_interface::pass_by::PassByCodec;
use sp_std::vec::Vec;
use static_assertions::const_assert;

/// Block length limit configuration.
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(rename_all = "camelCase")
)]
#[derive(RuntimeDebug, PartialEq, Clone, PassByCodec, MaxEncodedLen)]
#[derive(RuntimeDebug, PartialEq, Clone, PassByCodec, MaxEncodedLen, Serialize, Deserialize)]
pub struct BlockLength {
/// Maximal total length in bytes for each extrinsic class.
///
/// In the worst case, the total block length is going to be:
/// `MAX(max)`
#[cfg_attr(feature = "serde", serde(with = "per_dispatch_class_serde"))]
#[serde(with = "per_dispatch_class_serde")]
pub max: PerDispatchClass<u32>,
pub cols: BlockLengthColumns,
pub rows: BlockLengthRows,
Expand Down Expand Up @@ -162,7 +156,6 @@ impl Decode for BlockLength {
}

/// This module adds serialization support to `BlockLength::max` field.
#[cfg(feature = "serde")]
mod per_dispatch_class_serde {
use serde::{Deserializer, Serializer};

Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sp-storage = { workspace = true, default-features = false }

## frame dependencies
frame-support = { workspace = true, default-features = false }
frame-system = { workspace = true, default-features = false, features = ["serde"] }
frame-system = { workspace = true, default-features = false }
frame-executive = { workspace = true, default-features = false }
frame-try-runtime = { workspace = true, default-features = false, optional = true }

Expand Down
4 changes: 1 addition & 3 deletions runtime/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ codec = { package = "parity-scale-codec", version = "3", default-features = fals
"derive",
] }
frame-support = { workspace = true, default-features = false }
frame-system = { path = "../../pallets/system", default-features = false, features = [
"serde",
] }
frame-system = { path = "../../pallets/system", default-features = false }
pallet-transaction-payment = { workspace = true, default-features = false }
pallet-babe = { workspace = true, default-features = false }
pallet-balances = { workspace = true, default-features = false }
Expand Down
Loading