From d35f273b7d67b1b85a9e72973cab13c5c156c1d3 Mon Sep 17 00:00:00 2001 From: cheme Date: Thu, 21 Oct 2021 11:00:15 +0200 Subject: [PATCH] Patch to delay runtime switch. --- primitives/io/src/lib.rs | 22 ---------------------- primitives/version/src/lib.rs | 7 +------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/primitives/io/src/lib.rs b/primitives/io/src/lib.rs index 7e54b54dc73b3..acb98b9e03e66 100644 --- a/primitives/io/src/lib.rs +++ b/primitives/io/src/lib.rs @@ -195,16 +195,6 @@ pub trait Storage { self.storage_root(sp_core::StateVersion::V0) } - #[version(2)] - /// "Commit" all existing operations and compute the resulting storage root. - /// - /// The hashing algorithm is defined by the `Block`. - /// - /// Returns a `Vec` that holds the SCALE encoded hash. - fn root(&mut self) -> Vec { - self.storage_root(sp_core::StateVersion::V1) - } - /// "Commit" all existing operations and get the resulting storage change root. /// `parent_hash` is a SCALE encoded hash. /// @@ -393,18 +383,6 @@ pub trait DefaultChildStorage { self.child_storage_root(&child_info, sp_core::StateVersion::V0) } - /// Default child root calculation. - /// - /// "Commit" all existing operations and compute the resulting child storage root. - /// The hashing algorithm is defined by the `Block`. - /// - /// Returns a `Vec` that holds the SCALE encoded hash. - #[version(2)] - fn root(&mut self, storage_key: &[u8]) -> Vec { - let child_info = ChildInfo::new_default(storage_key); - self.child_storage_root(&child_info, sp_core::StateVersion::V1) - } - /// Child storage key iteration. /// /// Get the next key in storage after the given one in lexicographic order in child storage. diff --git a/primitives/version/src/lib.rs b/primitives/version/src/lib.rs index 10edbca4eb24f..e08d3a04cffa1 100644 --- a/primitives/version/src/lib.rs +++ b/primitives/version/src/lib.rs @@ -217,12 +217,7 @@ impl RuntimeVersion { /// Returns state version to use for update. pub fn state_version(&self) -> StateVersion { - let core_api_id = sp_runtime::hashing::blake2_64(b"Core"); - if self.has_api_with(&core_api_id, |v| v >= 4) { - StateVersion::V1 - } else { - StateVersion::V0 - } + StateVersion::V0 } }