Skip to content

Commit

Permalink
v1.5 upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Oct 6, 2022
1 parent 1a956e7 commit 0160771
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ x/compute/internal/keeper/testdata/ibc.wasm
x/compute/internal/keeper/testdata/static-too-high-initial-memory.wasm
x/compute/internal/keeper/testdata/too-high-initial-memory.wasm
x/compute/internal/keeper/testdata/v1-contract.wasm
/github.com
/github.com
third_party/build
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/scrtlabs/SecretNetwork/app/upgrades"
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.4"
icaauthtypes "github.com/scrtlabs/SecretNetwork/x/mauth/types"

"github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -114,7 +115,7 @@ var (
distrtypes.ModuleName: true,
}

Upgrades = []upgrades.Upgrade{v1_3.Upgrade, v1_4.Upgrade}
Upgrades = []upgrades.Upgrade{v1_3.Upgrade, v1_4.Upgrade, v1_5.Upgrade}
)

// Verify app interface at compile time
Expand Down
26 changes: 26 additions & 0 deletions app/upgrades/v1.5/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package v1_4

import (
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.5"

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

func CreateUpgradeHandler(mm *module.Manager, keepers *keepers.SecretAppKeepers, configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Running module migrations for v1.5...")
return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit 0160771

Please sign in to comment.