Skip to content

Commit

Permalink
refactor: inline upgradeName constants
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Aug 28, 2023
1 parent 9a1ffb0 commit b4df1ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 9 additions & 4 deletions golang/cosmos/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,18 @@ func NewAgoricApp(
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)

const (
upgradeName = "agoric-upgrade-12"
upgradeNameTest = "agorictest-upgrade-12"
)

app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
upgrade11Handler(app, upgradeName),
upgrade12Handler(app, upgradeName),
)
app.UpgradeKeeper.SetUpgradeHandler(
upgradeNameTest,
upgrade11Handler(app, upgradeNameTest),
upgrade12Handler(app, upgradeNameTest),
)

if loadLatest {
Expand Down Expand Up @@ -855,8 +860,8 @@ func (eventHandler swingStoreMigrationEventHandler) OnExportRetrieved(provider s
return nil
}

// upgrade11Handler performs standard upgrade actions plus custom actions for upgrade-11.
func upgrade11Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
// upgrade12Handler performs standard upgrade actions plus custom actions for upgrade-12.
func upgrade12Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
app.CheckControllerInited(false)
// Record the plan to send to SwingSet
Expand Down
6 changes: 0 additions & 6 deletions golang/cosmos/app/const.go

This file was deleted.

0 comments on commit b4df1ea

Please sign in to comment.