Skip to content

Commit

Permalink
added empty upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
faneaatiku committed Jun 14, 2024
1 parent 8c416b6 commit 5afbbac
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
15 changes: 15 additions & 0 deletions app/upgrades/empty_upgrade_handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package upgrades

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// EmptyUpgradeHandler - should be used to create upgrade handler for gov software upgrades that require no migration
func EmptyUpgradeHandler() upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
//do nothing on purpose
return vm, nil
}
}
8 changes: 2 additions & 6 deletions app/upgrades/v512/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package v512

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/bze-alphateam/bze/app/upgrades"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const UpgradeName = "v5.1.2"

func CreateUpgradeHandler() upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
//do nothing on purpose
return vm, nil
}
return upgrades.EmptyUpgradeHandler()
}
8 changes: 2 additions & 6 deletions app/upgrades/v610/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package v610

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/bze-alphateam/bze/app/upgrades"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const UpgradeName = "v6.1.0"

func CreateUpgradeHandler() upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// nothing to do
return vm, nil
}
return upgrades.EmptyUpgradeHandler()
}

0 comments on commit 5afbbac

Please sign in to comment.