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

Make sure staking migration code runs only for version = 2_0_0 #5768

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down