diff --git a/substrate/frame/staking/src/lib.rs b/substrate/frame/staking/src/lib.rs index 34b6a4f7958337b7bea77854e269626c04f580ae..d175c26e7aee5826aed7a5d9d0daba4d16b0ccdd 100644 --- a/substrate/frame/staking/src/lib.rs +++ b/substrate/frame/staking/src/lib.rs @@ -1246,8 +1246,12 @@ decl_module! { fn on_runtime_upgrade() -> Weight { // For Kusama the type hasn't actually changed as Moment was u64 and was the number of // millisecond since unix epoch. - StorageVersion::put(Releases::V3_0_0); - Self::migrate_last_reward_to_claimed_rewards(); + StorageVersion::mutate(|v| { + if matches!(v, Releases::V2_0_0) { + Self::migrate_last_reward_to_claimed_rewards(); + } + *v = Releases::V3_0_0; + }); 0 }