Skip to content

Commit ccc597b

Browse files
committed
Set storage version
Signed-off-by: Xavier Lau <[email protected]>
1 parent df83f28 commit ccc597b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

runtime/crab/src/migration.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
4545
}
4646

4747
fn migrate() -> frame_support::weights::Weight {
48+
frame_support::traits::StorageVersion::new(2)
49+
.put::<cumulus_pallet_dmp_queue::Pallet<Runtime>>();
50+
4851
const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA";
4952

5053
#[cfg(feature = "try-runtime")]
51-
assert!(array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR).is_ok());
54+
assert!(array_bytes::hex_n_into::<_, AccountId, 20>(KTON_DAO_VAULT_ADDR).is_ok());
5255

5356
if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) {
5457
<darwinia_staking::KtonRewardDistributionContract<Runtime>>::put(w);

runtime/darwinia/src/migration.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
4545
}
4646

4747
fn migrate() -> frame_support::weights::Weight {
48+
frame_support::traits::StorageVersion::new(2)
49+
.put::<cumulus_pallet_dmp_queue::Pallet<Runtime>>();
50+
4851
let _ = migration::clear_storage_prefix(
4952
b"BridgeKusamaGrandpa",
5053
b"ImportedHeaders",
@@ -64,7 +67,7 @@ fn migrate() -> frame_support::weights::Weight {
6467
const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA";
6568

6669
#[cfg(feature = "try-runtime")]
67-
assert!(array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR).is_ok());
70+
assert!(array_bytes::hex_n_into::<_, AccountId, 20>(KTON_DAO_VAULT_ADDR).is_ok());
6871

6972
if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) {
7073
<darwinia_staking::KtonRewardDistributionContract<Runtime>>::put(w);

runtime/koi/src/migration.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
4545
}
4646

4747
fn migrate() -> frame_support::weights::Weight {
48-
let n = migration_helper::PalletCleaner {
49-
name: b"EthereumXcm",
50-
values: &[b"Nonce", b"EthereumXcmSuspended"],
51-
maps: &[],
52-
}
53-
.remove_storage_values();
48+
frame_support::traits::StorageVersion::new(2)
49+
.put::<cumulus_pallet_dmp_queue::Pallet<Runtime>>();
5450

5551
// frame_support::weights::Weight::zero()
56-
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(0, n)
52+
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(0, 1)
5753
}

0 commit comments

Comments
 (0)