Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed May 23, 2023
1 parent 45d74c7 commit 80a490c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions x/ccv/consumer/keeper/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ func NewMigrator(ccvConsumerKeeper Keeper, ccvConsumerParamSpace paramtypes.Subs
return Migrator{ccvConsumerKeeper: ccvConsumerKeeper, ccvConsumerParamSpace: ccvConsumerParamSpace}
}

func (m Migrator) Migratev1p0To1p3(ctx sdk.Context) error {
func (m Migrator) Migratev1Tov2(ctx sdk.Context) error {
// Migrate params
MigrateParamsv1p0To1p3(ctx, m.ccvConsumerParamSpace)
MigrateParamsv1Tov2(ctx, m.ccvConsumerParamSpace)

return nil
}

// MigrateParamsv1p0To1p3 migrates the consumer CCV module params from v1.0.0 to v1.3.0,
// MigrateParamsv1Tov2 migrates the consumer CCV module params from v1.0.0 to v2.0.0,
// setting default values for new params.
func MigrateParamsv1p0To1p3(ctx sdk.Context, paramsSubspace paramtypes.Subspace) {
func MigrateParamsv1Tov2(ctx sdk.Context, paramsSubspace paramtypes.Subspace) {
// Get old params
var enabled bool
paramsSubspace.Get(ctx, v1consumertypes.KeyEnabled, &enabled)
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/consumer/keeper/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
tmdb "github.com/tendermint/tm-db"
)

func TestMigrateParamsv1p0To1p3(t *testing.T) {
func TestMigrateParamsv1Tov2(t *testing.T) {
// Setup raw store
db := tmdb.NewMemDB()
stateStore := store.NewCommitMultiStore(db)
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestMigrateParamsv1p0To1p3(t *testing.T) {
).WithKeyTable(v2consumertypes.ParamKeyTable()) // Use v2 key table, this would be set in keeper constructor upon app init

// Run migration
v2consumerkeeper.MigrateParamsv1p0To1p3(ctx, subspace)
v2consumerkeeper.MigrateParamsv1Tov2(ctx, subspace)

// Use v2 keeper to confirm params are set correctly
keeper := v2consumerkeeper.Keeper{}
Expand Down
8 changes: 4 additions & 4 deletions x/ccv/provider/keeper/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func NewMigrator(ccvProviderKeeper Keeper, stakingKeeper v2ccvtypes.StakingKeepe
return Migrator{ccvProviderKeeper: ccvProviderKeeper, ccvProviderParamSpace: ccvProviderParamSpace}
}

func (m Migrator) Migratev1p0To1p3(ctx sdk.Context) error {
func (m Migrator) Migratev1Tov2(ctx sdk.Context) error {
// Migrate params
MigrateParamsv1p0To1p3(ctx,
MigrateParamsv1Tov2(ctx,
m.ccvProviderParamSpace,
// See https://github.com/cosmos/interchain-security/blob/7861804cb311507ec6aebebbfad60ea42eb8ed4b/x/ccv/provider/keeper/params.go#L84
// The v1.1.0-multiden version of ICS hardcodes this param as 10 of bond type: k.stakingKeeper.BondDenom(ctx).
Expand All @@ -38,9 +38,9 @@ func (m Migrator) Migratev1p0To1p3(ctx sdk.Context) error {
return nil
}

// MigrateParamsv1p0To1p3 migrates the provider CCV module params from v1.0.0 to v1.3.0,
// MigrateParamsv1Tov2 migrates the provider CCV module params from v1.0.0 to v2.0.0,
// setting default values for new params.
func MigrateParamsv1p0To1p3(ctx sdk.Context, paramsSubspace paramtypes.Subspace, consumerRewardDenomRegistrationFee sdk.Coin) {
func MigrateParamsv1Tov2(ctx sdk.Context, paramsSubspace paramtypes.Subspace, consumerRewardDenomRegistrationFee sdk.Coin) {
// Get old params
var templateClient ibctmtypes.ClientState
paramsSubspace.Get(ctx, v1providertypes.KeyTemplateClient, &templateClient)
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/provider/keeper/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
tmdb "github.com/tendermint/tm-db"
)

func TestMigrateParamsv1p0To1p3(t *testing.T) {
func TestMigrateParamsv1Tov2(t *testing.T) {
// Setup raw store
db := tmdb.NewMemDB()
stateStore := store.NewCommitMultiStore(db)
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestMigrateParamsv1p0To1p3(t *testing.T) {
).WithKeyTable(v2providertypes.ParamKeyTable()) // Use v2 key table, this would be set in keeper constructor upon app init

// Run migration
v2providerkeeper.MigrateParamsv1p0To1p3(ctx, subspace, sdk.NewCoin("uatom", sdk.NewInt(100000)))
v2providerkeeper.MigrateParamsv1Tov2(ctx, subspace, sdk.NewCoin("uatom", sdk.NewInt(100000)))

// Use keeper to confirm params are set correctly
keeper := v2providerkeeper.Keeper{}
Expand Down

0 comments on commit 80a490c

Please sign in to comment.