Skip to content

Commit

Permalink
remove bech32 ibc (#1994)
Browse files Browse the repository at this point in the history
* remove bech32 ibc

* comment out in v5 upgrade code

* CHANGELOG
  • Loading branch information
sunnya97 authored Jul 7, 2022
1 parent ed55aeb commit c79f28b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* MsgExitPoolResponse: token_out field
* [#1825](https://github.com/osmosis-labs/osmosis/pull/1825) Fixes Interchain Accounts (host side) by adding it to AppModuleBasics
* [#1699](https://github.com/osmosis-labs/osmosis/pull/1699) Fixes bug in sig fig rounding on spot price queries for small values
* [#1994](https://github.com/osmosis-labs/osmosis/pull/1994) Removed bech32ibc module

#### Golang API breaks

Expand Down
24 changes: 0 additions & 24 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ import (

// IBC Transfer: Defines the "transfer" IBC port
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
"github.com/osmosis-labs/bech32-ibc/x/bech32ibc"
bech32ibckeeper "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/keeper"
bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types"
bech32ics20keeper "github.com/osmosis-labs/bech32-ibc/x/bech32ics20/keeper"

_ "github.com/osmosis-labs/osmosis/v7/client/docs/statik"
owasm "github.com/osmosis-labs/osmosis/v7/wasmbinding"
Expand Down Expand Up @@ -100,8 +96,6 @@ type AppKeepers struct {
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper *icahostkeeper.Keeper
TransferKeeper *ibctransferkeeper.Keeper
Bech32IBCKeeper *bech32ibckeeper.Keeper
Bech32ICS20Keeper *bech32ics20keeper.Keeper
EvidenceKeeper *evidencekeeper.Keeper
GAMMKeeper *gammkeeper.Keeper
LockupKeeper *lockupkeeper.Keeper
Expand Down Expand Up @@ -231,22 +225,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
// Note: the sealing is done after creating wasmd and wiring that up

appKeepers.Bech32IBCKeeper = bech32ibckeeper.NewKeeper(
appKeepers.IBCKeeper.ChannelKeeper, appCodec, appKeepers.keys[bech32ibctypes.StoreKey],
appKeepers.TransferKeeper,
)

// TODO: Should we be passing this instead of bank in many places?
// Where do we want send coins to be cross-chain?
appKeepers.Bech32ICS20Keeper = bech32ics20keeper.NewKeeper(
appKeepers.IBCKeeper.ChannelKeeper,
appKeepers.BankKeeper,
appKeepers.TransferKeeper,
appKeepers.Bech32IBCKeeper,
appKeepers.TransferKeeper,
appCodec,
)

// create evidence keeper with router
// If evidence needs to be handled for the app, set routes in router here and seal
appKeepers.EvidenceKeeper = evidencekeeper.NewKeeper(
Expand Down Expand Up @@ -374,7 +352,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(*appKeepers.UpgradeKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)).
AddRoute(poolincentivestypes.RouterKey, poolincentives.NewPoolIncentivesProposalHandler(*appKeepers.PoolIncentivesKeeper)).
AddRoute(bech32ibctypes.RouterKey, bech32ibc.NewBech32IBCProposalHandler(*appKeepers.Bech32IBCKeeper)).
AddRoute(txfeestypes.RouterKey, txfees.NewUpdateFeeTokenProposalHandler(*appKeepers.TxFeesKeeper)).
AddRoute(superfluidtypes.RouterKey, superfluid.NewSuperfluidProposalHandler(*appKeepers.SuperfluidKeeper, *appKeepers.EpochsKeeper))

Expand Down Expand Up @@ -539,7 +516,6 @@ func KVStoreKeys() []string {
authzkeeper.StoreKey,
txfeestypes.StoreKey,
superfluidtypes.StoreKey,
bech32ibctypes.StoreKey,
wasm.StoreKey,
tokenfactorytypes.StoreKey,
}
Expand Down
2 changes: 0 additions & 2 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
"github.com/osmosis-labs/bech32-ibc/x/bech32ibc"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -82,7 +81,6 @@ var AppModuleBasics = []module.AppModuleBasic{
epochs.AppModuleBasic{},
superfluid.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
bech32ibc.AppModuleBasic{},
wasm.AppModuleBasic{},
ica.AppModuleBasic{},
}
9 changes: 2 additions & 7 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
"github.com/osmosis-labs/bech32-ibc/x/bech32ibc"
bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types"
"github.com/osmosis-labs/bech32-ibc/x/bech32ics20"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand All @@ -20,6 +17,7 @@ import (
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/authz"
authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
Expand Down Expand Up @@ -105,7 +103,7 @@ func appModules(
),
auth.NewAppModule(appCodec, *app.AccountKeeper, nil),
vesting.NewAppModule(*app.AccountKeeper, app.BankKeeper),
bech32ics20.NewAppModule(appCodec, *app.Bech32ICS20Keeper),
bank.NewAppModule(appCodec, *app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants),
gov.NewAppModule(appCodec, *app.GovKeeper, app.AccountKeeper, app.BankKeeper),
Expand Down Expand Up @@ -138,7 +136,6 @@ func appModules(
app.EpochsKeeper,
),
tokenfactory.NewAppModule(appCodec, *app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
bech32ibc.NewAppModule(appCodec, *app.Bech32IBCKeeper),
}
}

Expand Down Expand Up @@ -175,7 +172,6 @@ func orderBeginBlockers() []string {
tokenfactorytypes.ModuleName,
// superfluid must come after distribution and epochs
superfluidtypes.ModuleName,
bech32ibctypes.ModuleName,
txfeestypes.ModuleName,
wasm.ModuleName,
}
Expand Down Expand Up @@ -210,7 +206,6 @@ func OrderInitGenesis(allModuleNames []string) []string {
upgradetypes.ModuleName,
vestingtypes.ModuleName,
ibctransfertypes.ModuleName,
bech32ibctypes.ModuleName, // comes after ibctransfertypes
poolincentivestypes.ModuleName,
superfluidtypes.ModuleName,
tokenfactorytypes.ModuleName,
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v5/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v5

import (
ibcconnectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"
bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types"
// bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -46,7 +46,7 @@ func CreateUpgradeHandler(
// Override versions for authz & bech32ibctypes module as to not skip their
// InitGenesis for txfees module, we will override txfees ourselves.
delete(fromVM, authz.ModuleName)
delete(fromVM, bech32ibctypes.ModuleName)
// delete(fromVM, bech32ibctypes.ModuleName)

newVM, err := mm.RunMigrations(ctx, configurator, fromVM)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ory/dockertest/v3 v3.9.1
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
Expand Down
4 changes: 1 addition & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
Expand Down Expand Up @@ -1040,8 +1040,6 @@ github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY=
github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM=
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1 h1:frHKHEdPfzoK2iMF2GeWKudLLzUXz+6GJcdZ/TMcs2k=
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1/go.mod h1:X5/FZHMPL+B3ufuVyY2/koxVjd4hIwyTLjYP1DZwppQ=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220620200611-3e46ff7501a1 h1:DGOm5SJcKVmgUVN8of2u4jj3vxEhAYs/+e+XqsxcrnQ=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220620200611-3e46ff7501a1/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74=
Expand Down
5 changes: 2 additions & 3 deletions osmoutils/partialord/partialord_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ func TestAPI(t *testing.T) {
moduleNames := []string{
"auth", "authz", "bank", "capabilities",
"staking", "distribution", "epochs", "mint", "upgrades", "wasm", "ibc",
"ibctransfers", "bech32ibc",
"ibctransfers",
}
beginBlockOrd := partialord.NewPartialOrdering(moduleNames)
beginBlockOrd.FirstElements("upgrades", "epochs", "capabilities")
beginBlockOrd.After("ibctransfers", "ibc")
beginBlockOrd.After("bech32ibc", "ibctransfers")
beginBlockOrd.Before("mint", "distribution")
// This is purely just to test last functionality, doesn't make sense in context
beginBlockOrd.LastElements("auth", "authz", "wasm")

totalOrd := beginBlockOrd.TotalOrdering()
expTotalOrd := []string{
"upgrades", "epochs", "capabilities",
"bank", "staking", "mint", "ibc", "distribution", "ibctransfers", "bech32ibc",
"bank", "staking", "mint", "ibc", "distribution", "ibctransfers",
"auth", "authz", "wasm",
}
require.Equal(t, expTotalOrd, totalOrd)
Expand Down

0 comments on commit c79f28b

Please sign in to comment.