mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 20:25:40 +00:00
Expose storage_prefix logic, and remove duplicate code (#9621)
* expose storage prefix generation, remove duplicate code * remove more duplicate code * clean up import * fix io test * remove slicing * Update frame/support/src/storage/mod.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -124,14 +124,7 @@ pub trait OnRuntimeUpgradeHelpersExt {
|
||||
/// them. See [`Self::set_temp_storage`] and [`Self::get_temp_storage`].
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn storage_key(ident: &str) -> [u8; 32] {
|
||||
let prefix = sp_io::hashing::twox_128(ON_RUNTIME_UPGRADE_PREFIX);
|
||||
let ident = sp_io::hashing::twox_128(ident.as_bytes());
|
||||
|
||||
let mut final_key = [0u8; 32];
|
||||
final_key[..16].copy_from_slice(&prefix);
|
||||
final_key[16..].copy_from_slice(&ident);
|
||||
|
||||
final_key
|
||||
crate::storage::storage_prefix(ON_RUNTIME_UPGRADE_PREFIX, ident.as_bytes())
|
||||
}
|
||||
|
||||
/// Get temporary storage data written by [`Self::set_temp_storage`].
|
||||
|
||||
Reference in New Issue
Block a user