git.delta.rocks / unique-network / refs/commits / 7e0ba1d9645e

difftreelog

Adjust node name according to used runtime

Daniel Shiposha2022-03-05parent: #4657e25.patch.diff
in: master

4 files changed

modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -79,7 +79,7 @@
 impl SubstrateCli for Cli {
 	// TODO use args
 	fn impl_name() -> String {
-		"Opal Node".into()
+		format!("{} Node", runtime::RUNTIME_NAME)
 	}
 
 	fn impl_version() -> String {
@@ -88,10 +88,11 @@
 	// TODO use args
 	fn description() -> String {
 		format!(
-			"Opal Node\n\nThe command-line arguments provided first will be \
+			"{} Node\n\nThe command-line arguments provided first will be \
 		passed to the parachain node, while the arguments provided after -- will be passed \
 		to the relaychain node.\n\n\
 		{} [parachain-args] -- [relaychain-args]",
+			runtime::RUNTIME_NAME,
 			Self::executable_name()
 		)
 	}
@@ -121,7 +122,7 @@
 impl SubstrateCli for RelayChainCli {
 	// TODO use args
 	fn impl_name() -> String {
-		"Opal Node".into()
+		format!("{} Node", runtime::RUNTIME_NAME)
 	}
 
 	fn impl_version() -> String {
@@ -129,11 +130,13 @@
 	}
 	// TODO use args
 	fn description() -> String {
-		"Opal Node\n\nThe command-line arguments provided first will be \
+		format!(
+			"{} Node\n\nThe command-line arguments provided first will be \
 		passed to the parachain node, while the arguments provided after -- will be passed \
 		to the relaychain node.\n\n\
-		parachain-collator [parachain-args] -- [relaychain-args]"
-			.into()
+		parachain-collator [parachain-args] -- [relaychain-args]",
+			runtime::RUNTIME_NAME
+		)
 	}
 
 	fn author() -> String {
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -123,6 +123,8 @@
 // mod chain_extension;
 // use crate::chain_extension::{NFTExtension, Imbalance};
 
+pub const RUNTIME_NAME: &'static str = "Opal";
+
 pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
 
 /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
111// mod chain_extension;111// mod chain_extension;
112// use crate::chain_extension::{NFTExtension, Imbalance};112// use crate::chain_extension::{NFTExtension, Imbalance};
113
114pub const RUNTIME_NAME: &'static str = "Quartz";
113115
114pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;116pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
115117
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -111,6 +111,8 @@
 // mod chain_extension;
 // use crate::chain_extension::{NFTExtension, Imbalance};
 
+pub const RUNTIME_NAME: &'static str = "Unique";
+
 pub type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
 
 /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know