mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-21 22:36:37 +00:00

* fix: ConsensusVersion on machine module * fix: use correct key to store activated ta counter on migration --------- Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
27 lines
716 B
Go
27 lines
716 B
Go
package keeper
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
v2 "github.com/planetmint/planetmint-go/x/machine/migrations/v2"
|
|
v3 "github.com/planetmint/planetmint-go/x/machine/migrations/v3"
|
|
)
|
|
|
|
// Migrator is a struct for handling in-place store migrations.
|
|
type Migrator struct {
|
|
keeper Keeper
|
|
}
|
|
|
|
// NewMigrator returns a new Migrator.
|
|
func NewMigrator(keeper Keeper) Migrator {
|
|
return Migrator{keeper: keeper}
|
|
}
|
|
|
|
// Migrate1to2 migrates from version 1 to 2.
|
|
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
|
|
return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc)
|
|
}
|
|
|
|
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
|
|
return v3.MigrateStore(ctx, m.keeper.taStoreKey, m.keeper.storeKey)
|
|
}
|