-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51bf4c0
commit 19cbd37
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/upgrades/v1.15-testnet-revert-proto-changes/upgrade.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package v1_15_testnet_revert_proto_changes | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
|
||
"cosmossdk.io/log" | ||
store "cosmossdk.io/store/types" | ||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
|
||
"github.com/scrtlabs/SecretNetwork/app/keepers" | ||
"github.com/scrtlabs/SecretNetwork/app/upgrades" | ||
) | ||
|
||
const upgradeName = "v1.15-testnet-revert-proto-changes" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: upgradeName, | ||
CreateUpgradeHandler: createUpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{}, | ||
} | ||
|
||
func createUpgradeHandler(mm *module.Manager, appKeepers *keepers.SecretAppKeepers, configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
logger := log.NewLogger(os.Stderr) | ||
logger.Info(` _ _ _____ _____ _____ _____ ______ `) | ||
logger.Info(`| | | | __ \ / ____| __ \ /\ | __ \| ____|`) | ||
logger.Info(`| | | | |__) | | __| |__) | / \ | | | | |__ `) | ||
logger.Info(`| | | | ___/| | |_ | _ / / /\ \ | | | | __| `) | ||
logger.Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `) | ||
logger.Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`) | ||
|
||
logger.Info(fmt.Sprintf("Running module migrations for %s...", upgradeName)) | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |