Skip to content

Commit

Permalink
Patch to delay runtime switch.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheme committed Oct 21, 2021
1 parent 898bc13 commit d35f273
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
22 changes: 0 additions & 22 deletions primitives/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>` that holds the SCALE encoded hash.
fn root(&mut self) -> Vec<u8> {
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.
///
Expand Down Expand Up @@ -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<u8>` that holds the SCALE encoded hash.
#[version(2)]
fn root(&mut self, storage_key: &[u8]) -> Vec<u8> {
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.
Expand Down
7 changes: 1 addition & 6 deletions primitives/version/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit d35f273

Please sign in to comment.