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

sc-chain-spec: deprecated code removed #4410

Merged
merged 11 commits into from
May 27, 2024
26 changes: 13 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-parachain-bin"
version = "4.0.0"
version = "5.0.0"
michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved
authors.workspace = true
build = "build.rs"
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Extensions {
}

/// Generic chain spec for all polkadot-parachain runtimes
pub type GenericChainSpec = sc_service::GenericChainSpec<(), Extensions>;
pub type GenericChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ mod tests {
cfg_file_path
}

pub type DummyChainSpec<E> = sc_service::GenericChainSpec<(), E>;
pub type DummyChainSpec<E> = sc_service::GenericChainSpec<E>;

pub fn create_default_with_extensions<E: Extension>(
id: &str,
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cumulus-test-service"
version = "0.1.0"
version = "0.2.0"
authors.workspace = true
edition.workspace = true
publish = false
Expand Down
4 changes: 2 additions & 2 deletions cumulus/test/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#![allow(missing_docs)]

use cumulus_primitives_core::ParaId;
use cumulus_test_runtime::{AccountId, RuntimeGenesisConfig, Signature};
use cumulus_test_runtime::{AccountId, Signature};
use parachains_common::AuraId;
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
Expand All @@ -26,7 +26,7 @@ use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "polkadot-service"
rust-version = "1.60"
version = "7.0.0"
version = "8.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions polkadot/node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ pub struct Extensions {
}

// Generic chain spec, in case when we don't have the native runtime.
pub type GenericChainSpec = service::GenericChainSpec<(), Extensions>;
pub type GenericChainSpec = service::GenericChainSpec<Extensions>;

/// The `ChainSpec` parameterized for the westend runtime.
#[cfg(feature = "westend-native")]
pub type WestendChainSpec = service::GenericChainSpec<(), Extensions>;
pub type WestendChainSpec = service::GenericChainSpec<Extensions>;

/// The `ChainSpec` parameterized for the westend runtime.
// Dummy chain spec, but that is fine when we don't have the native runtime.
Expand All @@ -83,7 +83,7 @@ pub type WestendChainSpec = GenericChainSpec;

/// The `ChainSpec` parameterized for the rococo runtime.
#[cfg(feature = "rococo-native")]
pub type RococoChainSpec = service::GenericChainSpec<(), Extensions>;
pub type RococoChainSpec = service::GenericChainSpec<Extensions>;

/// The `ChainSpec` parameterized for the rococo runtime.
// Dummy chain spec, but that is fine when we don't have the native runtime.
Expand Down
4 changes: 2 additions & 2 deletions polkadot/node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ pub use sc_executor::NativeExecutionDispatch;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
pub use service::{
config::{DatabaseSource, PrometheusConfig},
ChainSpec, Configuration, Error as SubstrateServiceError, PruningMode, Role, RuntimeGenesis,
TFullBackend, TFullCallExecutor, TFullClient, TaskManager, TransactionPoolOptions,
ChainSpec, Configuration, Error as SubstrateServiceError, PruningMode, Role, TFullBackend,
TFullCallExecutor, TFullClient, TaskManager, TransactionPoolOptions,
};
pub use sp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi};
pub use sp_runtime::{
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/test/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "polkadot-test-service"
publish = false
version = "1.0.0"
version = "2.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/test/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use test_runtime_constants::currency::DOTS;
const DEFAULT_PROTOCOL_ID: &str = "dot";

/// The `ChainSpec` parameterized for polkadot test runtime.
pub type PolkadotChainSpec = sc_service::GenericChainSpec<(), Extensions>;
pub type PolkadotChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Returns the properties for the [`PolkadotChainSpec`].
pub fn polkadot_chain_spec_properties() -> serde_json::map::Map<String, serde_json::Value> {
Expand Down
37 changes: 37 additions & 0 deletions prdoc/pr_4410.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title: "[sc-chain-spec] Remove deprecated code"

doc:
- audience: Node Dev
description: |
The RuntimeGenesisConfig generic type parameter was removed from GenericChainSpec struct.
ChainSpec::from_genesis method was removed.
Removed related deprecated code from `sc-chain-spec`.
This change simplifies the codebase and ensures the use of up-to-date definitions.

crates:
- name: sc-service
bump: minor
- name: minimal-template-node
bump: minor
- name: sc-cli
bump: patch
- name: polkadot-test-service
bump: major
- name: sc-service-test
bump: major
- name: staging-node-cli
bump: major
- name: parachain-template-node
bump: minor
- name: solochain-template-node
bump: minor
- name: polkadot-parachain-bin
bump: major
- name: polkadot-service
bump: major
- name: sc-consensus-grandpa
bump: patch
- name: cumulus-test-service
bump: minor
- name: sc-chain-spec
bump: major
2 changes: 1 addition & 1 deletion substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "staging-node-cli"
version = "3.0.0-dev"
version = "4.0.0-dev"
authors.workspace = true
description = "Generic Substrate node implementation in Rust."
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub struct Extensions {
}

/// Specialized `ChainSpec`.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
/// Flaming Fir testnet generator
pub fn flaming_fir_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(&include_bytes!("../res/flaming-fir.json")[..])
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/chain-spec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sc-chain-spec"
version = "28.0.0"
version = "29.0.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `substrateTest`, `balances` at line 3 column 9 for blob:
Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `substrateTest`, `balances` at line 2 column 9 for blob:
{
"system": {},
"babex": {
"authorities": [
[
Expand All @@ -17,20 +16,13 @@ Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `sub
]
],
"epochConfig": {
"allowed_slots": "PrimaryAndSecondaryPlainSlots",
"c": [
3,
10
],
"allowed_slots": "PrimaryAndSecondaryPlainSlots"
]
}
},
"substrateTest": {
"authorities": [
"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
"5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y"
]
},
"balances": {
"balances": [
[
Expand Down Expand Up @@ -110,5 +102,13 @@ Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `sub
100000000000000000
]
]
}
},
"substrateTest": {
"authorities": [
"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
"5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y"
]
},
"system": {}
}
Loading
Loading