v5_0

package
v5.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "v5.0"

Variables

View Source
var Upgrade = upgrades.Upgrade{
	UpgradeName: Name,
	CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler {
		return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

			fromVM[ecocredit.ModuleName] = 2
			fromVM[data.ModuleName] = 1

			oldIcaVersion := fromVM[icatypes.ModuleName]

			fromVM[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()

			controllerParams := icacontrollertypes.Params{ControllerEnabled: false}

			hostParams := icahosttypes.Params{
				HostEnabled:   false,
				AllowMessages: []string{},
			}

			mod, found := mm.Modules[icatypes.ModuleName]
			if !found {
				panic(fmt.Sprintf("module %s is not in the module manager", icatypes.ModuleName))
			}

			icaMod, ok := mod.(ica.AppModule)
			if !ok {
				panic(fmt.Sprintf("expected module %s to be type %T, got %T", icatypes.ModuleName, ica.AppModule{}, mod))
			}

			if oldIcaVersion != fromVM[icatypes.ModuleName] {
				icaMod.InitModule(ctx, controllerParams, hostParams)
			}

			return mm.RunMigrations(ctx, cfg, fromVM)
		}
	},
	StoreUpgrades: storetypes.StoreUpgrades{
		Added: []string{
			group.ModuleName,
			icahosttypes.StoreKey,
			ibcfeetypes.StoreKey,
			icacontrollertypes.StoreKey,
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL