Skip to content

Commit

Permalink
feat(mint): remove legacy store migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux authored and ccamel committed Dec 4, 2023
1 parent 90456d0 commit 83bfc00
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 77 deletions.
6 changes: 3 additions & 3 deletions x/mint/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/mint/exported"
v2 "github.com/okp4/okp4d/x/mint/migrations/v2"
v3 "github.com/okp4/okp4d/x/mint/migrations/v3"
)

type Migrator struct {
Expand All @@ -19,6 +19,6 @@ func NewMigrator(keeper Keeper, legacySubspace exported.Subspace) Migrator {
}
}

func (m Migrator) Migrate1to2(ctx sdk.Context) error {
return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacySubspace)
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
return v3.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacySubspace)
}
49 changes: 0 additions & 49 deletions x/mint/migrations/v2/migrations.go

This file was deleted.

31 changes: 31 additions & 0 deletions x/mint/migrations/v3/migrations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package v3

import (
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/mint/exported"
)

// MigrateStore migrates the x/mint module state from the consensus version 2 to
// version 3.
func MigrateStore(ctx sdk.Context,
storeKey storetypes.StoreKey,
cdc codec.BinaryCodec,
legacySubspace exported.Subspace,
) error {
logger := ctx.Logger().
With("module", "mint").
With("migration", "v3")

logger.Debug("starting module migration")

logger.Debug("migrate mint params")

// TODO:

logger.Debug("module migration done")

return nil
}
25 changes: 0 additions & 25 deletions x/mint/types/params_legacy.go

This file was deleted.

0 comments on commit 83bfc00

Please sign in to comment.