Skip to content

Commit

Permalink
chore: rename migrations v045 -> v046 (#11210)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleem1314 authored Feb 17, 2022
1 parent 6d1525f commit f2fe1d6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions x/authz/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
v045 "github.com/cosmos/cosmos-sdk/x/authz/migrations/v045"
v046 "github.com/cosmos/cosmos-sdk/x/authz/migrations/v046"
)

// Migrator is a struct for handling in-place store migrations.
Expand All @@ -17,5 +17,5 @@ func NewMigrator(keeper Keeper) Migrator {

// Migrate1to2 migrates from version 1 to 2.
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
return v045.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc)
return v046.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v045
package v046

import (
"time"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v045
package v046

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v045
package v046

import (
"github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/authz"
)

// MigrateStore performs in-place store migrations from v0.44 to v0.45. The
// MigrateStore performs in-place store migrations from v0.45 to v0.46. The
// migration includes:
//
// - pruning expired authorizations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v045_test
package v046_test

import (
"testing"
Expand All @@ -10,7 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
v045 "github.com/cosmos/cosmos-sdk/x/authz/migrations/v045"
v046 "github.com/cosmos/cosmos-sdk/x/authz/migrations/v046"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -95,13 +95,13 @@ func TestMigration(t *testing.T) {

for _, g := range grants {
grant := g.authorization()
store.Set(v045.GrantStoreKey(g.grantee, g.granter, g.msgType), cdc.MustMarshal(&grant))
store.Set(v046.GrantStoreKey(g.grantee, g.granter, g.msgType), cdc.MustMarshal(&grant))
}

ctx = ctx.WithBlockTime(ctx.BlockTime().Add(1 * time.Hour))
require.NoError(t, v045.MigrateStore(ctx, authzKey, cdc))
require.NoError(t, v046.MigrateStore(ctx, authzKey, cdc))

require.NotNil(t, store.Get(v045.GrantStoreKey(grantee1, granter2, genericMsgType)))
require.NotNil(t, store.Get(v045.GrantStoreKey(grantee1, granter1, sendMsgType)))
require.Nil(t, store.Get(v045.GrantStoreKey(grantee2, granter2, genericMsgType)))
require.NotNil(t, store.Get(v046.GrantStoreKey(grantee1, granter2, genericMsgType)))
require.NotNil(t, store.Get(v046.GrantStoreKey(grantee1, granter1, sendMsgType)))
require.Nil(t, store.Get(v046.GrantStoreKey(grantee2, granter2, genericMsgType)))
}

0 comments on commit f2fe1d6

Please sign in to comment.