From efa80a309b59454e5bf7238c6a2584373f39ee3e Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@trentesaux.fr> Date: Mon, 22 May 2023 18:19:47 +0200 Subject: [PATCH] fix gtest runtime type name --- node/specs/gtest_client-specs.json | 6 +++--- node/src/command.rs | 4 +--- node/src/service.rs | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/node/specs/gtest_client-specs.json b/node/specs/gtest_client-specs.json index a554af2e6..b14c21695 100644 --- a/node/specs/gtest_client-specs.json +++ b/node/specs/gtest_client-specs.json @@ -1,6 +1,6 @@ { - "name": "Ğdev", - "id": "gdev", + "name": "ĞTest", + "id": "gtest", "chainType": "Live", "bootNodes": [ "/dns/gdev.p2p.legal/tcp/30334/p2p/12D3KooW9v5WsP38qU1kmafvA4CDw2vzYnFoWtdUqwonZtJK597r", @@ -15,6 +15,6 @@ ], "properties": { "tokenDecimals": 2, - "tokenSymbol": "ĞD" + "tokenSymbol": "ĞT" } } \ No newline at end of file diff --git a/node/src/command.rs b/node/src/command.rs index 4d4047c20..d151a7fb6 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -191,8 +191,6 @@ impl SubstrateCli for Cli { let runtime_type = if starts_with("g1") { RuntimeType::G1 - } else if starts_with("gdem") { - RuntimeType::GTest } else if starts_with("dev") || starts_with("gdev") { RuntimeType::GDev } else if starts_with("gt") { @@ -226,7 +224,7 @@ impl SubstrateCli for Cli { RuntimeType::GTest => >est_runtime::VERSION, #[cfg(feature = "gdev")] RuntimeType::GDev => &gdev_runtime::VERSION, - _ => panic!("unknown runtime"), + _ => panic!("unknown runtime {:?}", spec.runtime_type()), } } } diff --git a/node/src/service.rs b/node/src/service.rs index 30edcb7ae..6562b6584 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -98,6 +98,7 @@ impl sc_executor::NativeExecutionDispatch for G1Executor { } } +#[derive(Debug)] pub enum RuntimeType { G1, GDev, @@ -115,11 +116,9 @@ impl IdentifyRuntimeType for Box<dyn sc_chain_spec::ChainSpec> { fn runtime_type(&self) -> RuntimeType { if self.id().starts_with("g1") { RuntimeType::G1 - } else if self.id().starts_with("gdem") { - RuntimeType::GTest } else if self.id().starts_with("dev") || self.id().starts_with("gdev") { RuntimeType::GDev - } else if self.id().starts_with("gt") { + } else if self.id().starts_with("gtest") { RuntimeType::GTest } else { panic!("unknown runtime") -- GitLab