git.delta.rocks / unique-network / refs/commits / 911b03c63217

difftreelog

fix wasm runtime version section

Yaroslav Bolyukin2023-09-08parent: #320ac9b.patch.diff
in: master

9 files changed

modifiednode/cli/Cargo.tomldiffbeforeafterboth
before · node/cli/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Node'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-node'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[[bin]]16name = 'unique-collator'17path = "src/main.rs"1819[package.metadata.docs.rs]20targets = ['x86_64-unknown-linux-gnu']2122[dependencies]23clap = "4.1"24futures = '0.3.28'25tokio = { version = "1.24", features = ["time"] }26serde_json = "1.0"2728log = { workspace = true }2930# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.31codec = { workspace = true, package = "parity-scale-codec" }3233cumulus-client-cli = { workspace = true }34cumulus-client-consensus-aura = { workspace = true }35cumulus-client-consensus-common = { workspace = true }36cumulus-client-network = { workspace = true }37cumulus-client-service = { workspace = true }38cumulus-primitives-core = { workspace = true }39cumulus-primitives-parachain-inherent = { workspace = true }40cumulus-relay-chain-inprocess-interface = { workspace = true }41cumulus-relay-chain-interface = { workspace = true }42cumulus-relay-chain-minimal-node = { workspace = true }43frame-benchmarking = { workspace = true }44frame-benchmarking-cli = { workspace = true }45opal-runtime = { workspace = true, optional = true }46pallet-transaction-payment-rpc-runtime-api = { workspace = true }47polkadot-cli = { workspace = true }48polkadot-primitives = { workspace = true }49polkadot-service = { workspace = true }50quartz-runtime = { workspace = true, optional = true }51sc-basic-authorship = { workspace = true }52sc-chain-spec = { workspace = true }53sc-cli = { workspace = true }54sc-client-api = { workspace = true }55sc-consensus = { workspace = true }56sc-consensus-manual-seal = { workspace = true }57sc-executor = { workspace = true }58sc-network = { workspace = true }59sc-network-sync = { workspace = true }60sc-service = { workspace = true }61sc-sysinfo = { workspace = true }62sc-telemetry = { workspace = true }63sc-tracing = { workspace = true }64sc-transaction-pool = { workspace = true }65serde = { workspace = true }66sp-api = { workspace = true }67sp-block-builder = { workspace = true }68sp-blockchain = { workspace = true }69sp-consensus-aura = { workspace = true }70sp-core = { workspace = true }71sp-io = { workspace = true }72sp-keystore = { workspace = true }73sp-offchain = { workspace = true }74sp-runtime = { workspace = true }75sp-session = { workspace = true }76sp-timestamp = { workspace = true }77sp-transaction-pool = { workspace = true }78substrate-frame-rpc-system = { workspace = true }79substrate-prometheus-endpoint = { workspace = true }80try-runtime-cli = { workspace = true }81unique-runtime = { workspace = true, optional = true }82up-common = { workspace = true }83up-data-structs = { workspace = true }8485fc-consensus = { workspace = true }86fc-db = { workspace = true }87fc-mapping-sync = { workspace = true }88fc-rpc = { workspace = true }89fc-rpc-core = { workspace = true }90fp-rpc = { workspace = true }9192app-promotion-rpc = { workspace = true }93uc-rpc = { workspace = true }94unique-rpc = { workspace = true }95up-pov-estimate-rpc = { workspace = true }96up-rpc = { workspace = true }97jsonrpsee.workspace = true98fp-storage.workspace = true99sc-rpc.workspace = true100101[build-dependencies]102substrate-build-script-utils = { workspace = true }103104[features]105default = ["opal-runtime"]106all-runtimes = ['opal-runtime', 'quartz-runtime', 'unique-runtime']107pov-estimate = ['opal-runtime/pov-estimate', 'quartz-runtime?/pov-estimate', 'uc-rpc/pov-estimate', 'unique-rpc/pov-estimate', 'unique-runtime?/pov-estimate']108runtime-benchmarks = ['opal-runtime/runtime-benchmarks', 'polkadot-cli/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', 'quartz-runtime?/runtime-benchmarks', 'sc-service/runtime-benchmarks', 'unique-runtime?/runtime-benchmarks']109sapphire-runtime = ['quartz-runtime', 'quartz-runtime/become-sapphire']110try-runtime = ['opal-runtime?/try-runtime', 'quartz-runtime?/try-runtime', 'try-runtime-cli/try-runtime', 'unique-runtime?/try-runtime']111state-version-0 = ['opal-runtime?/state-version-0', 'quartz-runtime?/state-version-0', 'unique-runtime?/state-version-0']
after · node/cli/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Node'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-node'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[[bin]]16name = 'unique-collator'17path = "src/main.rs"1819[package.metadata.docs.rs]20targets = ['x86_64-unknown-linux-gnu']2122[dependencies]23clap = "4.1"24futures = '0.3.28'25tokio = { version = "1.24", features = ["time"] }26serde_json = "1.0"2728log = { workspace = true }2930# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.31codec = { workspace = true, package = "parity-scale-codec" }3233cumulus-client-cli = { workspace = true }34cumulus-client-consensus-aura = { workspace = true }35cumulus-client-consensus-common = { workspace = true }36cumulus-client-network = { workspace = true }37cumulus-client-service = { workspace = true }38cumulus-primitives-core = { workspace = true }39cumulus-primitives-parachain-inherent = { workspace = true }40cumulus-relay-chain-inprocess-interface = { workspace = true }41cumulus-relay-chain-interface = { workspace = true }42cumulus-relay-chain-minimal-node = { workspace = true }43frame-benchmarking = { workspace = true }44frame-benchmarking-cli = { workspace = true }45opal-runtime = { workspace = true, optional = true }46pallet-transaction-payment-rpc-runtime-api = { workspace = true }47polkadot-cli = { workspace = true }48polkadot-primitives = { workspace = true }49polkadot-service = { workspace = true }50quartz-runtime = { workspace = true, optional = true }51sc-basic-authorship = { workspace = true }52sc-chain-spec = { workspace = true }53sc-cli = { workspace = true }54sc-client-api = { workspace = true }55sc-consensus = { workspace = true }56sc-consensus-manual-seal = { workspace = true }57sc-executor = { workspace = true }58sc-network = { workspace = true }59sc-network-sync = { workspace = true }60sc-service = { workspace = true }61sc-sysinfo = { workspace = true }62sc-telemetry = { workspace = true }63sc-tracing = { workspace = true }64sc-transaction-pool = { workspace = true }65serde = { workspace = true }66sp-api = { workspace = true }67sp-block-builder = { workspace = true }68sp-blockchain = { workspace = true }69sp-consensus-aura = { workspace = true }70sp-core = { workspace = true }71sp-io = { workspace = true }72sp-keystore = { workspace = true }73sp-offchain = { workspace = true }74sp-runtime = { workspace = true }75sp-session = { workspace = true }76sp-timestamp = { workspace = true }77sp-transaction-pool = { workspace = true }78substrate-frame-rpc-system = { workspace = true }79substrate-prometheus-endpoint = { workspace = true }80try-runtime-cli = { workspace = true }81unique-runtime = { workspace = true, optional = true }82up-common = { workspace = true }83up-data-structs = { workspace = true }8485fc-consensus = { workspace = true }86fc-db = { workspace = true }87fc-mapping-sync = { workspace = true }88fc-rpc = { workspace = true }89fc-rpc-core = { workspace = true }90fp-rpc = { workspace = true }9192app-promotion-rpc = { workspace = true }93uc-rpc = { workspace = true }94unique-rpc = { workspace = true }95up-pov-estimate-rpc = { workspace = true }96up-rpc = { workspace = true }97jsonrpsee.workspace = true98fp-storage.workspace = true99sc-rpc.workspace = true100101[build-dependencies]102substrate-build-script-utils = { workspace = true }103104[features]105default = ["opal-runtime"]106all-runtimes = ['opal-runtime', 'quartz-runtime', 'unique-runtime']107pov-estimate = ['opal-runtime/pov-estimate', 'quartz-runtime?/pov-estimate', 'uc-rpc/pov-estimate', 'unique-rpc/pov-estimate', 'unique-runtime?/pov-estimate']108runtime-benchmarks = ['opal-runtime/runtime-benchmarks', 'polkadot-cli/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', 'quartz-runtime?/runtime-benchmarks', 'sc-service/runtime-benchmarks', 'unique-runtime?/runtime-benchmarks']109sapphire-runtime = ['quartz-runtime', 'quartz-runtime/become-sapphire']110try-runtime = ['opal-runtime?/try-runtime', 'quartz-runtime?/try-runtime', 'try-runtime-cli/try-runtime', 'unique-runtime?/try-runtime']
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -281,7 +281,7 @@
 		// Name
 		format!(
 			"{}{}",
-			default_runtime::RUNTIME_NAME.to_uppercase(),
+			default_runtime::VERSION.spec_name.to_uppercase(),
 			if cfg!(feature = "unique-runtime") {
 				""
 			} else {
@@ -290,7 +290,7 @@
 		)
 		.as_str(),
 		// ID
-		format!("{}_dev", default_runtime::RUNTIME_NAME).as_str(),
+		format!("{}_dev", default_runtime::VERSION.spec_name).as_str(),
 		ChainType::Local,
 		move || {
 			testnet_genesis!(
@@ -355,7 +355,7 @@
 		// Name
 		format!(
 			"{}{}",
-			default_runtime::RUNTIME_NAME.to_uppercase(),
+			default_runtime::VERSION.impl_name.to_uppercase(),
 			if cfg!(feature = "unique-runtime") {
 				""
 			} else {
@@ -364,7 +364,7 @@
 		)
 		.as_str(),
 		// ID
-		format!("{}_local", default_runtime::RUNTIME_NAME).as_str(),
+		format!("{}_local", default_runtime::VERSION.spec_name).as_str(),
 		ChainType::Local,
 		move || {
 			testnet_genesis!(
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -24,7 +24,7 @@
 		weights::CommonWeights,
 		RelayChainBlockNumberProvider,
 	},
-	Runtime, RuntimeEvent, RuntimeCall, RUNTIME_NAME, TOKEN_SYMBOL, DECIMALS, Balances,
+	Runtime, RuntimeEvent, RuntimeCall, VERSION, TOKEN_SYMBOL, DECIMALS, Balances,
 };
 use frame_support::traits::{ConstU32, ConstU64, Currency};
 use up_common::{
@@ -90,7 +90,7 @@
 
 parameter_types! {
 	pub const Decimals: u8 = DECIMALS;
-	pub Name: String = RUNTIME_NAME.to_string();
+	pub Name: String = String::from_utf8_lossy(VERSION.impl_name.as_ref()).to_string();
 	pub Symbol: String = TOKEN_SYMBOL.to_string();
 }
 impl pallet_balances_adapter::Config for Runtime {
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -64,7 +64,6 @@
 	'sp-runtime/runtime-benchmarks',
 	'xcm-builder/runtime-benchmarks',
 ]
-state-version-0 = []
 std = [
 	'codec/std',
 	'cumulus-pallet-aura-ext/std',
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -43,22 +43,19 @@
 
 pub use runtime_common::*;
 
-pub const RUNTIME_NAME: &str = "opal";
 pub const TOKEN_SYMBOL: &str = "OPL";
 pub const DECIMALS: u8 = 18;
 
 /// This runtime version.
+#[sp_version::runtime_version]
 pub const VERSION: RuntimeVersion = RuntimeVersion {
-	spec_name: create_runtime_str!(RUNTIME_NAME),
-	impl_name: create_runtime_str!(RUNTIME_NAME),
+	spec_name: create_runtime_str!("opal"),
+	impl_name: create_runtime_str!("opal"),
 	authoring_version: 1,
 	spec_version: 943060,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
-	#[cfg(feature = "state-version-0")]
-	state_version: 0,
-	#[cfg(not(feature = "state-version-0"))]
 	state_version: 1,
 };
 
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -60,7 +60,6 @@
 	'sp-runtime/runtime-benchmarks',
 	'xcm-builder/runtime-benchmarks',
 ]
-state-version-0 = []
 std = [
 	'codec/std',
 	'cumulus-pallet-aura-ext/std',
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -43,25 +43,34 @@
 
 pub use runtime_common::*;
 
-#[cfg(feature = "become-sapphire")]
-pub const RUNTIME_NAME: &str = "sapphire";
-#[cfg(not(feature = "become-sapphire"))]
-pub const RUNTIME_NAME: &str = "quartz";
 pub const TOKEN_SYMBOL: &str = "QTZ";
 pub const DECIMALS: u8 = 18;
 
 /// This runtime version.
+#[cfg(not(feature = "become-sapphire"))]
+#[sp_version::runtime_version]
 pub const VERSION: RuntimeVersion = RuntimeVersion {
-	spec_name: create_runtime_str!(RUNTIME_NAME),
-	impl_name: create_runtime_str!(RUNTIME_NAME),
+	spec_name: create_runtime_str!("quartz"),
+	impl_name: create_runtime_str!("quartz"),
+
+	authoring_version: 1,
+	spec_version: 943060,
+	impl_version: 0,
+	apis: RUNTIME_API_VERSIONS,
+	transaction_version: 3,
+	state_version: 1,
+};
+#[cfg(feature = "become-sapphire")]
+#[sp_version::runtime_version]
+pub const VERSION: RuntimeVersion = RuntimeVersion {
+	spec_name: create_runtime_str!("sapphire"),
+	impl_name: create_runtime_str!("sapphire"),
+
 	authoring_version: 1,
 	spec_version: 943060,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
-	#[cfg(feature = "state-version-0")]
-	state_version: 0,
-	#[cfg(not(feature = "state-version-0"))]
 	state_version: 1,
 };
 
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -58,7 +58,6 @@
 	'up-data-structs/runtime-benchmarks',
 	'xcm-builder/runtime-benchmarks',
 ]
-state-version-0 = []
 std = [
 	'codec/std',
 	'cumulus-pallet-aura-ext/std',
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -43,22 +43,19 @@
 
 pub use runtime_common::*;
 
-pub const RUNTIME_NAME: &str = "unique";
 pub const TOKEN_SYMBOL: &str = "UNQ";
 pub const DECIMALS: u8 = 18;
 
 /// This runtime version.
+#[sp_version::runtime_version]
 pub const VERSION: RuntimeVersion = RuntimeVersion {
-	spec_name: create_runtime_str!(RUNTIME_NAME),
-	impl_name: create_runtime_str!(RUNTIME_NAME),
+	spec_name: create_runtime_str!("unique"),
+	impl_name: create_runtime_str!("unique"),
 	authoring_version: 1,
 	spec_version: 943060,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
-	#[cfg(feature = "state-version-0")]
-	state_version: 0,
-	#[cfg(not(feature = "state-version-0"))]
 	state_version: 1,
 };