Skip to content

Commit

Permalink
Add v1.14 upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau committed Aug 26, 2024
1 parent 418feb9 commit 13cd4c2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
v1_11 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.11"
v1_12 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.12"
v1_13 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.13"
v1_14 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.14"
v1_3 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.3"
v1_4 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.4"
v1_5 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.5"
Expand Down Expand Up @@ -109,6 +110,7 @@ var (
v1_11.Upgrade,
v1_12.Upgrade,
v1_13.Upgrade,
v1_14.Upgrade,
}
)

Expand Down
36 changes: 36 additions & 0 deletions app/upgrades/v1.14/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package v1_14

import (
"fmt"

store "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/scrtlabs/SecretNetwork/app/keepers"
"github.com/scrtlabs/SecretNetwork/app/upgrades"
)

const upgradeName = "v1.14"

var Upgrade = upgrades.Upgrade{
UpgradeName: upgradeName,
CreateUpgradeHandler: createUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info(` _ _ _____ _____ _____ _____ ______ `)
ctx.Logger().Info(`| | | | __ \ / ____| __ \ /\ | __ \| ____|`)
ctx.Logger().Info(`| | | | |__) | | __| |__) | / \ | | | | |__ `)
ctx.Logger().Info(`| | | | ___/| | |_ | _ / / /\ \ | | | | __| `)
ctx.Logger().Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `)
ctx.Logger().Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`)

ctx.Logger().Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))

return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit 13cd4c2

Please sign in to comment.