-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stargate-queries): add upgrade handler
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package upgrade8_0_0 | ||
|
||
import ( | ||
"context" | ||
wasmdTypes "github.com/CosmWasm/wasmd/x/wasm/types" | ||
|
||
storetypes "cosmossdk.io/store/types" | ||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/archway-network/archway/app/keepers" | ||
"github.com/archway-network/archway/app/upgrades" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
) | ||
|
||
const Name = "v10.0.0" | ||
const NameAsciiArt = ` | ||
# ### ### | ||
# # ## # # # # | ||
# # # # # # # | ||
# # # # # # | ||
### # ### # ### | ||
` | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: Name, | ||
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator, keepers keepers.ArchwayKeepers) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
migrations, err := mm.RunMigrations(ctx, cfg, fromVM) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
sdk.UnwrapSDKContext(ctx).Logger().Info(upgrades.ArchwayLogo + NameAsciiArt) | ||
return migrations, nil | ||
} | ||
}, | ||
StoreUpgrades: storetypes.StoreUpgrades{ | ||
Added: []string{wasmdTypes.StoreKey}, | ||
}, | ||
} |