Skip to content

Commit cca6b9b

Browse files
committed
feat: remove legacy migration and simplify deps
1 parent 0eed12e commit cca6b9b

File tree

4 files changed

+3
-37
lines changed

4 files changed

+3
-37
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ require (
148148
cosmossdk.io/x/tx v0.14.0
149149
cosmossdk.io/x/upgrade v0.2.0
150150
github.com/cosmos/cosmos-db v1.1.1
151-
github.com/cosmos/interchain-security/v6 v6.4.1
152151
github.com/informalsystems/itf-go v0.0.1
153152
github.com/spf13/viper v1.20.1
154153
golang.org/x/mod v0.24.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,6 @@ github.com/cosmos/ibc-go/v10 v10.2.0 h1:wlk/zqz2O0WRyE6UConoR1ci2HSW02P9ywamZCh5
829829
github.com/cosmos/ibc-go/v10 v10.2.0/go.mod h1:ijeyJ1FDvXoc5w+rlhpMntjhZ558EF02SBFjroW1hPo=
830830
github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU=
831831
github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0=
832-
github.com/cosmos/interchain-security/v6 v6.4.1 h1:DzBDjPQIYUJiF0ioNHkvmcS629htvCu9r5gFb+m7mms=
833-
github.com/cosmos/interchain-security/v6 v6.4.1/go.mod h1:yTbAxgcNKQ+/x2obvnHtxnOjQ5AcML4gb9V0P0e1rds=
834832
github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE=
835833
github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA=
836834
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package keeper
22

33
import (
4-
sdk "github.com/cosmos/cosmos-sdk/types"
54
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
6-
7-
v2 "github.com/cosmos/interchain-security/v5/x/ccv/consumer/migrations/v2"
8-
v3 "github.com/cosmos/interchain-security/v5/x/ccv/consumer/migrations/v3"
9-
v4 "github.com/cosmos/interchain-security/v6/x/ccv/consumer/migrations/v4"
105
)
116

127
// Migrator is a struct for handling in-place store migrations.
8+
// Note: This is a complete fork, so no migrations are implemented.
139
type Migrator struct {
1410
keeper Keeper
1511
paramSpace paramtypes.Subspace
@@ -19,25 +15,3 @@ type Migrator struct {
1915
func NewMigrator(keeper Keeper, paramspace paramtypes.Subspace) Migrator {
2016
return Migrator{keeper: keeper, paramSpace: paramspace}
2117
}
22-
23-
// Migrate1to2 migrates x/ccvconsumer state from consensus version 1 to 2.
24-
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
25-
store := ctx.KVStore(m.keeper.storeKey)
26-
return v2.MigrateConsumerPacketData(ctx, store)
27-
}
28-
29-
// Migrate2to3 migrates x/ccvconsumer from consensus version 2 to 3.
30-
// This migration is necessary to move the consumer module legacy params.
31-
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
32-
store := ctx.KVStore(m.keeper.storeKey)
33-
cdc := m.keeper.cdc
34-
return v3.MigrateLegacyParams(ctx, cdc, store, m.paramSpace)
35-
}
36-
37-
// Migrate3to4 migrates x/ccvconsumer from consensus version 3 to 4.
38-
func (m Migrator) Migrate3to4(ctx sdk.Context) error {
39-
store := ctx.KVStore(m.keeper.storeKey)
40-
v4.CleanupState(store)
41-
42-
return nil
43-
}

x/ccv/consumer/module.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
123123
consumertypes.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(&am.keeper))
124124
consumertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper)
125125

126-
m := keeper.NewMigrator(am.keeper, am.paramSpace)
127-
if err := cfg.RegisterMigration(consumertypes.ModuleName, 1, m.Migrate1to2); err != nil {
128-
panic(fmt.Sprintf("failed to register migrator for %s: %s", consumertypes.ModuleName, err))
129-
}
130-
if err := cfg.RegisterMigration(consumertypes.ModuleName, 2, m.Migrate2to3); err != nil {
131-
panic(fmt.Sprintf("failed to register migrator for %s: %s -- from 2 -> 3", consumertypes.ModuleName, err))
132-
}
126+
// No migrations needed for this fork
127+
_ = keeper.NewMigrator(am.keeper, am.paramSpace)
133128
}
134129

135130
// InitGenesis performs genesis initialization for the consumer module. It returns

0 commit comments

Comments
 (0)