Skip to content

Commit

Permalink
merger v1.1.6-remove-onex
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Sep 21, 2024
2 parents 65e39de + ec916fc commit e2b93e0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/automated-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.22
id: go

- name: Checkout code
Expand All @@ -30,6 +30,7 @@ jobs:
release_name: ${{ github.ref }}
draft: false
prerelease: true
allowUpdates: true

# build & upload onomyd

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.22
id: go
- name: Install Rust components
run: |
Expand Down
45 changes: 6 additions & 39 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app

import (
"context"
// "context"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -46,7 +46,7 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
// authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
"github.com/cosmos/cosmos-sdk/x/crisis"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand All @@ -60,14 +60,7 @@ import (

"github.com/onomyprotocol/onomy/app/keepers"
"github.com/onomyprotocol/onomy/app/upgrades"
v1_0_1 "github.com/onomyprotocol/onomy/app/upgrades/v1.0.1"
v1_0_3 "github.com/onomyprotocol/onomy/app/upgrades/v1.0.3"
v1_0_3_4 "github.com/onomyprotocol/onomy/app/upgrades/v1.0.3.4"
v1_0_3_5 "github.com/onomyprotocol/onomy/app/upgrades/v1.0.3.5"
v1_1_1 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.1"
v1_1_2 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.2"
v1_1_4 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.4"
v1_1_5 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.5"
v1_1_6 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.6"
"github.com/onomyprotocol/onomy/docs"
)

Expand Down Expand Up @@ -470,29 +463,7 @@ func (app *OnomyApp) SimulationManager() *module.SimulationManager {
}

func (app *OnomyApp) setupUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(v1_0_1.Name, v1_0_1.UpgradeHandler)
app.UpgradeKeeper.SetUpgradeHandler(v1_0_3.Name, v1_0_3.UpgradeHandler)
app.UpgradeKeeper.SetUpgradeHandler(v1_0_3_4.Name, v1_0_3_4.UpgradeHandler)
app.UpgradeKeeper.SetUpgradeHandler(v1_0_3_5.Name, v1_0_3_5.UpgradeHandler)
// we need to have the reference to `app` which is why we need this `func` here.
app.UpgradeKeeper.SetUpgradeHandler(
v1_1_1.Name,
func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
for moduleName, eachModule := range app.mm.Modules {
m := eachModule.(module.GenesisOnlyAppModule)
fromVM[moduleName] = m.ConsensusVersion()
}

// This is critical for the chain upgrade to work.
sdkCtx := sdk.UnwrapSDKContext(ctx)
app.ProviderKeeper.InitGenesis(sdkCtx, providertypes.DefaultGenesisState())

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
app.UpgradeKeeper.SetUpgradeHandler(v1_1_2.Name, v1_1_2.UpgradeHandler)
app.UpgradeKeeper.SetUpgradeHandler(v1_1_4.Name, v1_1_4.UpgradeHandler)
app.UpgradeKeeper.SetUpgradeHandler(v1_1_5.Name, v1_1_5.CreateUpgradeHandler(app.mm, app.configurator, &app.AccountKeeper, &app.BankKeeper, app.StakingKeeper))
app.UpgradeKeeper.SetUpgradeHandler(v1_1_6.Name, v1_1_6.UpgradeHandler)

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
Expand All @@ -507,13 +478,9 @@ func (app *OnomyApp) setupUpgradeHandlers() {
var storeUpgrades *storetypes.StoreUpgrades

switch upgradeInfo.Name {
case v1_1_1.Name:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{providertypes.ModuleName, providertypes.StoreKey},
}
case v1_1_4.Name:
case v1_1_6.Name:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{authtypes.ModuleName, authzkeeper.StoreKey},
Deleted: []string{"provider"},
}
default:
// no store upgrades.
Expand Down
3 changes: 3 additions & 0 deletions app/upgrades/v1.1.6/constant.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package v1_1_6 //nolint:revive,stylecheck // app version

const Name = "v1.1.6"
13 changes: 13 additions & 0 deletions app/upgrades/v1.1.6/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package v1_1_6 //nolint:revive,stylecheck // app version

import (
"context"
// sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"
)

// UpgradeHandler is an x/upgrade handler.
func UpgradeHandler(_ context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return vm, nil
}

0 comments on commit e2b93e0

Please sign in to comment.