Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 868c416

Browse files
authored
Contracts Rollback StorageMap hashing migration (#14661)
* Contracts Rollback StorageMap hashing migration * misc v13
1 parent 1612e39 commit 868c416

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

frame/contracts/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub mod pallet {
187187

188188
/// The current storage version.
189189
#[cfg(not(any(test, feature = "runtime-benchmarks")))]
190-
const STORAGE_VERSION: StorageVersion = StorageVersion::new(12);
190+
const STORAGE_VERSION: StorageVersion = StorageVersion::new(13);
191191

192192
/// Hard coded storage version for running tests that depend on the current storage version.
193193
#[cfg(any(test, feature = "runtime-benchmarks"))]
@@ -1022,7 +1022,7 @@ pub mod pallet {
10221022
/// TWOX-NOTE: SAFE since `AccountId` is a secure hash.
10231023
#[pallet::storage]
10241024
pub(crate) type ContractInfoOf<T: Config> =
1025-
StorageMap<_, Identity, T::AccountId, ContractInfo<T>>;
1025+
StorageMap<_, Twox64Concat, T::AccountId, ContractInfo<T>>;
10261026

10271027
/// Evicted contracts that await child trie deletion.
10281028
///

frame/contracts/src/migration/v13.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// limitations under the License.
1717

1818
//! Add `delegate_dependencies` to `ContractInfo`.
19-
//! Use `Identity` instead of `Twox64Concat` for hashing keys of the `ContractInfoOf` storage map
2019
//! See <https://github.com/paritytech/substrate/pull/14079>.
2120
2221
use crate::{
@@ -74,7 +73,7 @@ pub fn store_old_contract_info<T: Config>(account: T::AccountId, info: crate::Co
7473

7574
#[storage_alias]
7675
pub type ContractInfoOf<T: Config> =
77-
StorageMap<Pallet<T>, Identity, <T as frame_system::Config>::AccountId, ContractInfo<T>>;
76+
StorageMap<Pallet<T>, Twox64Concat, <T as frame_system::Config>::AccountId, ContractInfo<T>>;
7877

7978
#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
8079
#[scale_info(skip_type_params(T))]

0 commit comments

Comments
 (0)