Skip to content

Commit

Permalink
feat(stargate-queries): add upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
SpekalsG3 committed Nov 20, 2024
1 parent 53d9cd2 commit 351de9a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/app_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/archway-network/archway/app/upgrades"
upgrade_0_6 "github.com/archway-network/archway/app/upgrades/06"
upgrade10_0_0 "github.com/archway-network/archway/app/upgrades/10_0_0"
upgrade1_0_0_rc_4 "github.com/archway-network/archway/app/upgrades/1_0_0_rc_4"
upgrade2_0_0 "github.com/archway-network/archway/app/upgrades/2_0_0"
upgrade3_0_0 "github.com/archway-network/archway/app/upgrades/3_0_0"
Expand All @@ -30,7 +31,8 @@ var Upgrades = []upgrades.Upgrade{
upgrade6_0_0.Upgrade, // v6.0.0
upgrade7_0_0.Upgrade, // v7.0.0
// upgrade8_0_0.Upgrade, // v8.0.0: was reserved for a consensus breaking wasmd upgrade
upgrade9_0_0.Upgrade, // v9.0.0
upgrade9_0_0.Upgrade, // v9.0.0
upgrade10_0_0.Upgrade, // v10.0.0

// constantine only
constantineupgrades.WASMD_50_Amino_Patch,
Expand Down
41 changes: 41 additions & 0 deletions app/upgrades/10_0_0/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package upgrade8_0_0

import (
"context"

Check failure on line 4 in app/upgrades/10_0_0/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed with -local github.com/archway-network/archway (goimports)
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},
},
}

0 comments on commit 351de9a

Please sign in to comment.