/
store.go
25 lines (21 loc) · 1.03 KB
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package v043
import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
v042distribution "github.com/merlin-network/elysium-sdk/v2/x/lsnative/distribution/migrations/v042"
)
// MigrateStore performs in-place store migrations from v0.40 to v0.43. The
// migration includes:
//
// - Change addresses to be length-prefixed.
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error {
store := ctx.KVStore(storeKey)
MigratePrefixAddress(store, v042distribution.ValidatorOutstandingRewardsPrefix)
MigratePrefixAddress(store, v042distribution.DelegatorWithdrawAddrPrefix)
MigratePrefixAddressAddress(store, v042distribution.DelegatorStartingInfoPrefix)
MigratePrefixAddressBytes(store, v042distribution.ValidatorHistoricalRewardsPrefix)
MigratePrefixAddress(store, v042distribution.ValidatorCurrentRewardsPrefix)
MigratePrefixAddress(store, v042distribution.ValidatorAccumulatedCommissionPrefix)
MigratePrefixAddressBytes(store, v042distribution.ValidatorSlashEventPrefix)
return nil
}