2021-03-08 14:36:06 -08:00
|
|
|
package v043
|
2021-02-25 02:43:31 -08:00
|
|
|
|
|
|
|
import (
|
2021-10-04 09:36:38 -07:00
|
|
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
2021-02-25 02:43:31 -08:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2021-07-05 07:55:51 -07:00
|
|
|
v040distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v040"
|
2021-02-25 02:43:31 -08:00
|
|
|
)
|
|
|
|
|
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.
|
2021-10-04 09:36:38 -07:00
|
|
|
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error {
|
2021-02-25 02:43:31 -08:00
|
|
|
store := ctx.KVStore(storeKey)
|
|
|
|
MigratePrefixAddress(store, v040distribution.ValidatorOutstandingRewardsPrefix)
|
|
|
|
MigratePrefixAddress(store, v040distribution.DelegatorWithdrawAddrPrefix)
|
|
|
|
MigratePrefixAddressAddress(store, v040distribution.DelegatorStartingInfoPrefix)
|
|
|
|
MigratePrefixAddressBytes(store, v040distribution.ValidatorHistoricalRewardsPrefix)
|
|
|
|
MigratePrefixAddress(store, v040distribution.ValidatorCurrentRewardsPrefix)
|
|
|
|
MigratePrefixAddress(store, v040distribution.ValidatorAccumulatedCommissionPrefix)
|
|
|
|
MigratePrefixAddressBytes(store, v040distribution.ValidatorSlashEventPrefix)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|