Skip to content

Commit

Permalink
v8 -> v9, tidy up old upgrade handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
the-frey committed Jul 28, 2022
1 parent ffce20d commit 2b6d053
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 145 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"
DOCKER := $(shell which docker)
BUILDDIR ?= $(CURDIR)/build
TEST_DOCKER_REPO=jackzampolin/junotest

export GO111MODULE = on

Expand Down
56 changes: 5 additions & 51 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

"github.com/CosmosContracts/juno/v8/docs"
"github.com/CosmosContracts/juno/v8/x/mint"
mintkeeper "github.com/CosmosContracts/juno/v8/x/mint/keeper"
minttypes "github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/docs"
"github.com/CosmosContracts/juno/v9/x/mint"
mintkeeper "github.com/CosmosContracts/juno/v9/x/mint/keeper"
minttypes "github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/rpc"
Expand Down Expand Up @@ -97,7 +97,6 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/prometheus/client_golang/prometheus"

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -795,52 +794,7 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {
}

// RegisterUpgradeHandlers returns upgrade handlers
func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
// left here for hysterical raisins - we should probably remove
// bankBaseKeeper, _ := app.BankKeeper.(bankkeeper.BaseKeeper)
// app.UpgradeKeeper.SetUpgradeHandler(veritas.UpgradeName, veritas.CreateUpgradeHandler(app.mm, cfg, &app.StakingKeeper, &bankBaseKeeper))
app.UpgradeKeeper.SetUpgradeHandler("multiverse", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {

vm[icatypes.ModuleName] = app.mm.Modules[icatypes.ModuleName].ConsensusVersion()

// create ICS27 Controller submodule params, controller module not enabled.
controllerParams := icacontrollertypes.Params{}

// create ICS27 Host submodule params
hostParams := icahosttypes.Params{
HostEnabled: true,
AllowMessages: []string{
sdk.MsgTypeURL(&banktypes.MsgSend{}),
sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgCreateValidator{}),
sdk.MsgTypeURL(&stakingtypes.MsgEditValidator{}),
sdk.MsgTypeURL(&distrtypes.MsgWithdrawDelegatorReward{}),
sdk.MsgTypeURL(&distrtypes.MsgSetWithdrawAddress{}),
sdk.MsgTypeURL(&distrtypes.MsgWithdrawValidatorCommission{}),
sdk.MsgTypeURL(&distrtypes.MsgFundCommunityPool{}),
sdk.MsgTypeURL(&govtypes.MsgVote{}),
sdk.MsgTypeURL(&authz.MsgExec{}),
sdk.MsgTypeURL(&authz.MsgGrant{}),
sdk.MsgTypeURL(&authz.MsgRevoke{}),
// wasm msgs here
// note we only support these three for now
sdk.MsgTypeURL(&wasmtypes.MsgStoreCode{}),
sdk.MsgTypeURL(&wasmtypes.MsgInstantiateContract{}),
sdk.MsgTypeURL(&wasmtypes.MsgExecuteContract{}),
},
}

// initialize ICS27 module
icamodule, correctTypecast := app.mm.Modules[icatypes.ModuleName].(ica.AppModule)
if !correctTypecast {
panic("mm.Modules[icatypes.ModuleName] is not of type ica.AppModule")
}
icamodule.InitModule(ctx, controllerParams, hostParams)

return app.mm.RunMigrations(ctx, cfg, vm)
})
}
func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {}

// GetMaccPerms returns a copy of the module account permissions
func GetMaccPerms() map[string][]string {
Expand Down
2 changes: 1 addition & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

// junoapp "github.com/CosmosContracts/juno/v8/app"
// junoapp "github.com/CosmosContracts/juno/v9/app"
"github.com/cosmos/cosmos-sdk/simapp"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
4 changes: 0 additions & 4 deletions app/upgrade/constants.go

This file was deleted.

47 changes: 0 additions & 47 deletions app/upgrade/upgrade_handler.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/junod/genwasm.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v9/app"
"github.com/cosmos/cosmos-sdk/client"
"github.com/spf13/cobra"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"
Expand Down
2 changes: 1 addition & 1 deletion cmd/junod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v9/app"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/CosmosContracts/juno/v8
module github.com/CosmosContracts/juno/v9

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
tmrand "github.com/tendermint/tendermint/libs/rand"
tmdb "github.com/tendermint/tm-db"

"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v9/app"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion testutil/simapp/simapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
tmtypes "github.com/tendermint/tendermint/types"
tmdb "github.com/tendermint/tm-db"

"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v9/app"
)

// New creates application instance with in-memory database and disabled logging.
Expand Down
4 changes: 2 additions & 2 deletions x/mint/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package mint
import (
"time"

"github.com/CosmosContracts/juno/v8/x/mint/keeper"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/keeper"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
)
Expand Down
4 changes: 2 additions & 2 deletions x/mint/client/rest/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/suite"

"github.com/CosmosContracts/juno/v8/testutil/network"
minttypes "github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/testutil/network"
minttypes "github.com/CosmosContracts/juno/v9/x/mint/types"
)

type IntegrationTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion x/mint/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/gorilla/mux"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/types/rest"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package testutil
import (
"testing"

"github.com/CosmosContracts/juno/v8/testutil/network"
"github.com/CosmosContracts/juno/v9/testutil/network"

"github.com/stretchr/testify/suite"
)
Expand Down
6 changes: 3 additions & 3 deletions x/mint/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/suite"
tmcli "github.com/tendermint/tendermint/libs/cli"

"github.com/CosmosContracts/juno/v8/testutil/network"
"github.com/CosmosContracts/juno/v8/x/mint/client/cli"
minttypes "github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/testutil/network"
"github.com/CosmosContracts/juno/v9/x/mint/client/cli"
minttypes "github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/client/flags"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
4 changes: 2 additions & 2 deletions x/mint/genesis.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mint

import (
"github.com/CosmosContracts/juno/v8/x/mint/keeper"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/keeper"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keeper
import (
"context"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down
4 changes: 2 additions & 2 deletions x/mint/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/app"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
4 changes: 2 additions & 2 deletions x/mint/keeper/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

junoapp "github.com/CosmosContracts/juno/v8/app"
junoapp "github.com/CosmosContracts/juno/v9/app"
"github.com/cosmos/cosmos-sdk/simapp"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keeper
import (
"github.com/tendermint/tendermint/libs/log"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keeper
import (
abci "github.com/tendermint/tendermint/abci/types"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
4 changes: 2 additions & 2 deletions x/mint/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/stretchr/testify/require"

keep "github.com/CosmosContracts/juno/v8/x/mint/keeper"
"github.com/CosmosContracts/juno/v8/x/mint/types"
keep "github.com/CosmosContracts/juno/v9/x/mint/keeper"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"

abci "github.com/tendermint/tendermint/abci/types"
Expand Down
10 changes: 5 additions & 5 deletions x/mint/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/spf13/cobra"
abci "github.com/tendermint/tendermint/abci/types"

"github.com/CosmosContracts/juno/v8/x/mint/client/cli"
"github.com/CosmosContracts/juno/v8/x/mint/client/rest"
"github.com/CosmosContracts/juno/v8/x/mint/keeper"
"github.com/CosmosContracts/juno/v8/x/mint/simulation"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/client/cli"
"github.com/CosmosContracts/juno/v9/x/mint/client/rest"
"github.com/CosmosContracts/juno/v9/x/mint/keeper"
"github.com/CosmosContracts/juno/v9/x/mint/simulation"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
2 changes: 1 addition & 1 deletion x/mint/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
abcitypes "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/simapp"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/simulation/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"fmt"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
)
Expand Down
6 changes: 3 additions & 3 deletions x/mint/simulation/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"

"github.com/CosmosContracts/juno/v8/app"
"github.com/CosmosContracts/juno/v8/x/mint/simulation"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/app"
"github.com/CosmosContracts/juno/v9/x/mint/simulation"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
)
Expand Down
2 changes: 1 addition & 1 deletion x/mint/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"math/rand"

"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)
Expand Down
4 changes: 2 additions & 2 deletions x/mint/simulation/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/CosmosContracts/juno/v8/x/mint/simulation"
"github.com/CosmosContracts/juno/v8/x/mint/types"
"github.com/CosmosContracts/juno/v9/x/mint/simulation"
"github.com/CosmosContracts/juno/v9/x/mint/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
Loading

0 comments on commit 2b6d053

Please sign in to comment.