mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 05:31:02 +00:00
contracts: Add test to verify unique trie ids (#10914)
* Add test to verify unique trie ids * Rename trie_seed to nonce * Rename AccountCounter -> Nonce * fmt
This commit is contained in:
committed by
GitHub
parent
18aef02e87
commit
bef9b79d7b
@@ -19,6 +19,7 @@ use crate::{BalanceOf, CodeHash, Config, Pallet, TrieId, Weight};
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
codec, generate_storage_alias,
|
||||
pallet_prelude::*,
|
||||
storage::migration,
|
||||
traits::{Get, PalletInfoAccess},
|
||||
Identity, Twox64Concat,
|
||||
@@ -47,6 +48,11 @@ pub fn migrate<T: Config>() -> Weight {
|
||||
StorageVersion::new(6).put::<Pallet<T>>();
|
||||
}
|
||||
|
||||
if version < 7 {
|
||||
weight = weight.saturating_add(v7::migrate::<T>());
|
||||
StorageVersion::new(7).put::<Pallet<T>>();
|
||||
}
|
||||
|
||||
weight
|
||||
}
|
||||
|
||||
@@ -249,3 +255,21 @@ mod v6 {
|
||||
weight
|
||||
}
|
||||
}
|
||||
|
||||
/// Rename `AccountCounter` to `Nonce`.
|
||||
mod v7 {
|
||||
use super::*;
|
||||
|
||||
pub fn migrate<T: Config>() -> Weight {
|
||||
generate_storage_alias!(
|
||||
Contracts,
|
||||
AccountCounter => Value<u64, ValueQuery>
|
||||
);
|
||||
generate_storage_alias!(
|
||||
Contracts,
|
||||
Nonce => Value<u64, ValueQuery>
|
||||
);
|
||||
Nonce::set(AccountCounter::take());
|
||||
T::DbWeight::get().reads_writes(1, 2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user