do not start spec_version guard when version mode is set to auto (#1278)

This commit is contained in:
Svyatoslav Nikolsky
2022-01-12 10:19:46 +03:00
committed by Bastian Köcher
parent a7fa7a491f
commit c4837d2368
12 changed files with 153 additions and 61 deletions
@@ -528,6 +528,16 @@ macro_rules! declare_chain_options {
}
impl [<$chain ConnectionParams>] {
/// Returns `true` if version guard can be started.
///
/// There's no reason to run version guard when version mode is set to `Auto`. It can
/// lead to relay shutdown when chain is upgraded, even though we have explicitly
/// said that we don't want to shutdown.
#[allow(dead_code)]
pub fn can_start_version_guard(&self) -> bool {
self.[<$chain_prefix _runtime_version>].[<$chain_prefix _version_mode>] != RuntimeVersionType::Auto
}
/// Convert connection params into Substrate client.
pub async fn to_client<Chain: CliChain>(
&self,