Files
wasmd/x/wasm/keeper/migrations.go
Alexander Peters cd66f786b2 SDK upgrade to v0.50 (branch) (#1611)
* Start implementation

* Add implementation + some e2e test

* Fix lint

* Squashed: sdk upgrade to v0.50

* rebuild protos with newer proto builder

(cherry picked from commit fd8f4c1d0d2163f0a504356c16cd2d250f6218f3)

* update ibc-go

(cherry picked from commit fb8667960fbeedb7d242baa644572986a154d4b6)

* bump cosmos-sdk and ibc in the v50 branch (#1616)

* tidy

* upgade ibc

* remove the toolchain command

* Bump sdk version

* Use correct bech32 prefix

* Bump SDK

* Enable fraud system test again

* Fix genesis param name

* Fix import/export simulations

* set log level for benchmarks

(cherry picked from commit 1cfb93008c596db62d22aba882f37a469546bfb9)

* Apply review comments

* Remove gov beta1 helpers

* Bump sdk version to latest in branch

* Fix linter

* Setup mergify for main

* Update mergify for better branch name

---------

Co-authored-by: Pino' Surace <pino.surace@live.it>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
2023-09-25 10:42:35 +02:00

39 lines
1.3 KiB
Go

package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/CosmWasm/wasmd/x/wasm/exported"
v1 "github.com/CosmWasm/wasmd/x/wasm/migrations/v1"
v2 "github.com/CosmWasm/wasmd/x/wasm/migrations/v2"
v3 "github.com/CosmWasm/wasmd/x/wasm/migrations/v3"
)
// Migrator is a struct for handling in-place store migrations.
type Migrator struct {
keeper Keeper
legacySubspace exported.Subspace
}
// NewMigrator returns a new Migrator.
func NewMigrator(keeper Keeper, legacySubspace exported.Subspace) Migrator {
return Migrator{keeper: keeper, legacySubspace: legacySubspace}
}
// Migrate1to2 migrates from version 1 to 2.
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
return v1.NewMigrator(m.keeper, m.keeper.addToContractCreatorSecondaryIndex).Migrate1to2(ctx)
}
// Migrate2to3 migrates the x/wasm module state from the consensus
// version 2 to version 3.
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
return v2.MigrateStore(ctx, m.keeper.storeService, m.legacySubspace, m.keeper.cdc)
}
// Migrate3to4 migrates the x/wasm module state from the consensus
// version 3 to version 4.
func (m Migrator) Migrate3to4(ctx sdk.Context) error {
return v3.NewMigrator(m.keeper, m.keeper.mustStoreCodeInfo).Migrate3to4(ctx, m.keeper.storeService, m.keeper.cdc)
}