Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: x/staking inplace store migration bug #9484

Merged
merged 4 commits into from
Jun 10, 2021
Merged
Changes from 1 commit
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
Next Next commit
test
  • Loading branch information
aleem1314 committed May 20, 2021
commit fbb50cfa0a437d5629348276a3809bb46f8636b0
8 changes: 6 additions & 2 deletions x/staking/legacy/v043/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ func migrateValidatorsByPowerIndexKey(store sdk.KVStore) {
}

func migrateParamsStore(ctx sdk.Context, paramstore paramtypes.Subspace) {
paramstore.WithKeyTable(types.ParamKeyTable())
paramstore.Set(ctx, types.KeyPowerReduction, sdk.DefaultPowerReduction)
if paramstore.HasKeyTable() {
paramstore.Set(ctx, types.KeyPowerReduction, sdk.DefaultPowerReduction)
} else {
paramstore.WithKeyTable(types.ParamKeyTable())
paramstore.Set(ctx, types.KeyPowerReduction, sdk.DefaultPowerReduction)
}
}

// MigrateStore performs in-place store migrations from v0.40 to v0.43. The
Expand Down