From b27b3f0fa2f794f37fc48a70c69bcb1b8ba12218 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 22 Feb 2024 12:43:55 -0700 Subject: [PATCH] Use the default store loader when an upgrade doesn't need a custom one. (#1852) (#1853) * Make sure the store loader isn't nil. * Add changelog entry. --- CHANGELOG.md | 1 + RELEASE_CHANGELOG.md | 1 + app/app.go | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a4898c933..7d8f65f131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/RELEASE_CHANGELOG.md b/RELEASE_CHANGELOG.md index 33ec5c58e7..ee1bae4376 100644 --- a/RELEASE_CHANGELOG.md +++ b/RELEASE_CHANGELOG.md @@ -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 diff --git a/app/app.go b/app/app.go index 10e65a95f7..c3a6dd2d82 100644 --- a/app/app.go +++ b/app/app.go @@ -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", @@ -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)