Skip to content

Commit 1f94868

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

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

runtime/crab/src/migration.rs

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

4747
fn migrate() -> frame_support::weights::Weight {
48+
// Migrate the storage version.
49+
frame_support::traits::StorageVersion::new(2)
50+
.put::<cumulus_pallet_dmp_queue::Pallet<Runtime>>();
51+
4852
const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA";
4953

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

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

runtime/darwinia/src/migration.rs

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

4747
fn migrate() -> frame_support::weights::Weight {
48+
// Migrate the storage version.
49+
frame_support::traits::StorageVersion::new(2)
50+
.put::<cumulus_pallet_dmp_queue::Pallet<Runtime>>();
51+
4852
let _ = migration::clear_storage_prefix(
4953
b"BridgeKusamaGrandpa",
5054
b"ImportedHeaders",
@@ -64,7 +68,7 @@ fn migrate() -> frame_support::weights::Weight {
6468
const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA";
6569

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

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

0 commit comments

Comments
 (0)