Skip to content

Commit

Permalink
Merge pull request #11 from bze-alphateam/feature/fix-update-client-r…
Browse files Browse the repository at this point in the history
…oute

fixed ibc client route
  • Loading branch information
faneaatiku committed Nov 21, 2022
2 parents 3edffbb + 66c025f commit 797e20f
Show file tree
Hide file tree
Showing 11 changed files with 42,244 additions and 13,157 deletions.
29 changes: 27 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app

import (
ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client"
"fmt"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -75,6 +75,8 @@ import (
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/modules/core"
ibcclient "github.com/cosmos/ibc-go/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper"
Expand Down Expand Up @@ -325,7 +327,7 @@ func New(
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
Expand Down Expand Up @@ -475,6 +477,8 @@ func New(
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()))

app.setupUpgradeHandlers()

// initialize stores
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
Expand Down Expand Up @@ -513,6 +517,27 @@ func New(
return app
}

func (app *App) setupUpgradeHandlers() {
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(fmt.Errorf("failed to read upgrade info from disk: %w", err))
}

if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
return
}

switch upgradeInfo.Name {
case "v5.1.2":
app.UpgradeKeeper.SetUpgradeHandler(
"v5.1.2",
func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
//do nothing on purpose
return vm, nil
})
}
}

// Name returns the name of the App
func (app *App) Name() string { return app.BaseApp.Name() }

Expand Down
14 changes: 13 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ genesis:
app_state:
staking:
params:
bond_denom: "utestbze"
bond_denom: "utestbze"
gov:
voting_params:
voting_period: "120s"
deposit_params:
min_deposit:
-
denom: "utestbze"
amount: "1000000"
tally_params:
quorum: "0.00001"
threshold: "0.001"
veto_threshold: "0.01"

0 comments on commit 797e20f

Please sign in to comment.