Skip to content

Commit

Permalink
Use the default store loader when an upgrade doesn't need a custom on…
Browse files Browse the repository at this point in the history
…e. (#1852) (#1853)

* Make sure the store loader isn't nil.

* Add changelog entry.
  • Loading branch information
SpicyLemon committed Feb 22, 2024
1 parent 2c10fa0 commit b27b3f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* Prevent funds from going to or from a marker without the transfer agent having deposit or withdraw access (respectively) [#1834](https://github.com/provenance-io/provenance/issues/1834).
* Ensure the store loader isn't nil when the handling an upgrade [1852](https://github.com/provenance-io/provenance/pull/1852).

### API Breaking

Expand Down
1 change: 1 addition & 0 deletions RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Bug Fixes

* Prevent funds from going to or from a marker without the transfer agent having deposit or withdraw access (respectively) [#1834](https://github.com/provenance-io/provenance/issues/1834).
* Ensure the store loader isn't nil when the handling an upgrade [1852](https://github.com/provenance-io/provenance/pull/1852).

### API Breaking

Expand Down
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ func New(
}

// Currently in an upgrade hold for this block.
storeLoader := baseapp.DefaultStoreLoader
var storeLoader baseapp.StoreLoader
if upgradeInfo.Name != "" && upgradeInfo.Height == app.LastBlockHeight()+1 {
if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
app.Logger().Info("Skipping upgrade based on height",
Expand All @@ -1077,6 +1077,9 @@ func New(
storeLoader = GetUpgradeStoreLoader(app, upgradeInfo)
}
}
if storeLoader == nil {
storeLoader = baseapp.DefaultStoreLoader
}

// Verify configuration settings
storeLoader = ValidateWrapper(app.Logger(), appOpts, storeLoader)
Expand Down

0 comments on commit b27b3f0

Please sign in to comment.