2021-03-08 14:36:06 -08:00
|
|
|
package v043
|
2021-02-25 02:43:31 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2021-03-08 14:36:06 -08:00
|
|
|
v043distribution "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v043"
|
2021-02-25 02:43:31 -08:00
|
|
|
v040slashing "github.com/cosmos/cosmos-sdk/x/slashing/legacy/v040"
|
|
|
|
)
|
|
|
|
|
2021-06-01 00:48:19 -07:00
|
|
|
// MigrateStore performs in-place store migrations from v0.40 to v0.43. The
|
2021-02-25 02:43:31 -08:00
|
|
|
// migration includes:
|
|
|
|
//
|
|
|
|
// - Change addresses to be length-prefixed.
|
|
|
|
func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey) error {
|
|
|
|
store := ctx.KVStore(storeKey)
|
2021-03-08 14:36:06 -08:00
|
|
|
v043distribution.MigratePrefixAddress(store, v040slashing.ValidatorSigningInfoKeyPrefix)
|
|
|
|
v043distribution.MigratePrefixAddressBytes(store, v040slashing.ValidatorMissedBlockBitArrayKeyPrefix)
|
|
|
|
v043distribution.MigratePrefixAddress(store, v040slashing.AddrPubkeyRelationKeyPrefix)
|
2021-02-25 02:43:31 -08:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|