github.com/Finschia/finschia-sdk@v0.48.1/x/distribution/legacy/v043/store.go (about)

     1  package v043
     2  
     3  import (
     4  	sdk "github.com/Finschia/finschia-sdk/types"
     5  	v040distribution "github.com/Finschia/finschia-sdk/x/distribution/legacy/v040"
     6  )
     7  
     8  // MigrateStore performs in-place store migrations from v0.40 to v0.43. The
     9  // migration includes:
    10  //
    11  // - Change addresses to be length-prefixed.
    12  func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey) error {
    13  	store := ctx.KVStore(storeKey)
    14  	MigratePrefixAddress(store, v040distribution.ValidatorOutstandingRewardsPrefix)
    15  	MigratePrefixAddress(store, v040distribution.DelegatorWithdrawAddrPrefix)
    16  	MigratePrefixAddressAddress(store, v040distribution.DelegatorStartingInfoPrefix)
    17  	MigratePrefixAddressBytes(store, v040distribution.ValidatorHistoricalRewardsPrefix)
    18  	MigratePrefixAddress(store, v040distribution.ValidatorCurrentRewardsPrefix)
    19  	MigratePrefixAddress(store, v040distribution.ValidatorAccumulatedCommissionPrefix)
    20  	MigratePrefixAddressBytes(store, v040distribution.ValidatorSlashEventPrefix)
    21  
    22  	return nil
    23  }