github.com/cosmos/cosmos-sdk@v0.50.10/x/distribution/migrations/v2/store.go (about) 1 package v2 2 3 import ( 4 "cosmossdk.io/core/store" 5 6 "github.com/cosmos/cosmos-sdk/runtime" 7 sdk "github.com/cosmos/cosmos-sdk/types" 8 v1 "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v1" 9 ) 10 11 // MigrateStore performs in-place store migrations from v0.40 to v0.43. The 12 // migration includes: 13 // 14 // - Change addresses to be length-prefixed. 15 func MigrateStore(ctx sdk.Context, storeService store.KVStoreService) error { 16 store := runtime.KVStoreAdapter(storeService.OpenKVStore(ctx)) 17 MigratePrefixAddress(store, v1.ValidatorOutstandingRewardsPrefix) 18 MigratePrefixAddress(store, v1.DelegatorWithdrawAddrPrefix) 19 MigratePrefixAddressAddress(store, v1.DelegatorStartingInfoPrefix) 20 MigratePrefixAddressBytes(store, v1.ValidatorHistoricalRewardsPrefix) 21 MigratePrefixAddress(store, v1.ValidatorCurrentRewardsPrefix) 22 MigratePrefixAddress(store, v1.ValidatorAccumulatedCommissionPrefix) 23 MigratePrefixAddressBytes(store, v1.ValidatorSlashEventPrefix) 24 25 return nil 26 }