Documentation
¶
Index ¶
- func GetHeightPatchesList() map[int64]IHeightPatch
- func GetUpgradesList() map[string]UpgradeInitFn
- func IterateMigrations(fn func(module string, version uint64, initfn NewMigrationFn))
- func MigrateValue(store storetypes.KVStore, cdc codec.BinaryCodec, prefixBz []byte, ...) (err error)
- func ModuleMigrations(module string, migrator Migrator, ...)
- func RegisterHeightPatch(height int64, patch IHeightPatch)
- func RegisterMigration(module string, version uint64, initFn NewMigrationFn)
- func RegisterUpgrade(name string, fn UpgradeInitFn)
- type IHeightPatch
- type IUpgrade
- type Migration
- type Migrator
- type NewMigrationFn
- type UpgradeInitFn
- type ValueMigrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHeightPatchesList ¶
func GetHeightPatchesList() map[int64]IHeightPatch
func GetUpgradesList ¶
func GetUpgradesList() map[string]UpgradeInitFn
func IterateMigrations ¶
func IterateMigrations(fn func(module string, version uint64, initfn NewMigrationFn))
func MigrateValue ¶
func MigrateValue(store storetypes.KVStore, cdc codec.BinaryCodec, prefixBz []byte, pStart, pEnd []byte, migrator ValueMigrator) (err error)
MigrateValue is a helper function that migrates values stored in a KV store for the given key prefix using the given value migrator function.
func ModuleMigrations ¶
func RegisterHeightPatch ¶
func RegisterHeightPatch(height int64, patch IHeightPatch)
func RegisterMigration ¶
func RegisterMigration(module string, version uint64, initFn NewMigrationFn)
RegisterMigration registers module migration within particular network upgrade
- module: module name
- version: current module version
- initFn: migrator fn
func RegisterUpgrade ¶
func RegisterUpgrade(name string, fn UpgradeInitFn)
Types ¶
type IHeightPatch ¶
type IHeightPatch interface {
Name() string
Begin(sdk.Context, *apptypes.AppKeepers)
}
IHeightPatch defines an interface for a non-software upgrade proposal Height Patch at a given height to implement. There is one time code that can be added for the start of the Patch, in `Begin`. Any other change in the code should be height-gated, if the goal is to have old and new binaries to be compatible prior to the upgrade height.
type IUpgrade ¶
type IUpgrade interface {
// StoreLoader add|rename|remove stores (aka modules)
// function may return nil if there is changes to stores
StoreLoader() *storetypes.StoreUpgrades
UpgradeHandler() upgradetypes.UpgradeHandler
}
IUpgrade defines an interface to run a SoftwareUpgradeProposal
type Migration ¶
type Migration interface {
GetHandler() sdkmodule.MigrationHandler
}
type Migrator ¶
type Migrator interface {
StoreKey() storetypes.StoreKey
Codec() codec.BinaryCodec
}
func NewMigrator ¶
func NewMigrator(cdc codec.BinaryCodec, skey storetypes.StoreKey) Migrator
type NewMigrationFn ¶
type ValueMigrator ¶
type ValueMigrator func(fromBz []byte, cdc codec.BinaryCodec) proto.Message
ValueMigrator migrates a value to the new protobuf type given its old protobuf serialized bytes.