From 8adb7c9b0d65eda1203777fcfca370b773c88fa9 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Mon, 27 Jun 2022 09:23:07 +0200 Subject: [PATCH] chore: fix v4.0.0 upgrade store loader (#939) ## Description This PR fixed the v4.0.0 upgrade store loader to make sure there are no problems with the renamed posts store key. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- app/upgrades/v400/upgrade.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/upgrades/v400/upgrade.go b/app/upgrades/v400/upgrade.go index dc0adbe5c4..7afa01c2e9 100644 --- a/app/upgrades/v400/upgrade.go +++ b/app/upgrades/v400/upgrade.go @@ -52,9 +52,17 @@ func (u *Upgrade) Handler() upgradetypes.UpgradeHandler { func (u *Upgrade) StoreUpgrades() *storetypes.StoreUpgrades { return &storetypes.StoreUpgrades{ Added: []string{ - poststypes.StoreKey, reportstypes.StoreKey, reactionstypes.StoreKey, }, + + // The posts key is here because it was already registered (due to an error) inside v2.3.1 + // https://github.com/desmos-labs/desmos/blob/v2.3.1/app/app.go#L270 + Renamed: []storetypes.StoreRename{ + { + OldKey: "posts", + NewKey: poststypes.StoreKey, + }, + }, } }