chore: rename migrations v045 -> v046 (#11210)
This commit is contained in:
parent
6d1525f039
commit
f2fe1d6499
@ -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.
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package v045
|
||||
package v046
|
||||
|
||||
import (
|
||||
"time"
|
||||
@ -1,4 +1,4 @@
|
||||
package v045
|
||||
package v046
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -1,4 +1,4 @@
|
||||
package v045
|
||||
package v046
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -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
|
||||
@ -1,4 +1,4 @@
|
||||
package v045_test
|
||||
package v046_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -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"
|
||||
@ -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)))
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user