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 sdk.KVStore, cdc codec.BinaryCodec, prefixBz []byte, ...) (err error)
- 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 ¶ added in v0.38.0
func IterateMigrations(fn func(module string, version uint64, initfn NewMigrationFn))
func MigrateValue ¶
func MigrateValue(store sdk.KVStore, cdc codec.BinaryCodec, prefixBz []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 RegisterHeightPatch ¶
func RegisterHeightPatch(height int64, patch IHeightPatch)
func RegisterMigration ¶
func RegisterMigration(module string, version uint64, initFn NewMigrationFn)
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() sdk.StoreKey Codec() codec.BinaryCodec }
func NewMigrator ¶ added in v0.38.0
func NewMigrator(cdc codec.BinaryCodec, skey sdk.StoreKey) Migrator
type NewMigrationFn ¶
type ValueMigrator ¶
type ValueMigrator func(oldValueBz []byte, cdc codec.BinaryCodec) codec.ProtoMarshaler
ValueMigrator migrates a value to the new protobuf type given its old protobuf serialized bytes.
Click to show internal directories.
Click to hide internal directories.