diff --git a/go.mod b/go.mod index 42bc59f5329..c65d6b2761d 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ module github.com/cosmos/ibc-go/v7 require ( cosmossdk.io/api v0.3.1 - cosmossdk.io/core v0.5.1 - cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.1 github.com/armon/go-metrics v0.4.1 @@ -34,6 +32,8 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect + cosmossdk.io/core v0.5.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/log v1.1.0 // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect diff --git a/modules/core/module.go b/modules/core/module.go index 27f50df6e42..501e5459f5b 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -5,25 +5,18 @@ import ( "encoding/json" "fmt" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" abci "github.com/cometbft/cometbft/abci/types" - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" clientkeeper "github.com/cosmos/ibc-go/v7/modules/core/02-client/keeper" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" @@ -107,14 +100,6 @@ type AppModule struct { keeper *keeper.Keeper } -var _ appmodule.AppModule = AppModule{} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - // NewAppModule creates a new AppModule object func NewAppModule(k *keeper.Keeper) AppModule { return AppModule{ @@ -214,54 +199,3 @@ func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } - -// App Wiring Setup - -func init() { - appmodule.Register(&modulev1.Module{}, - appmodule.Provide(ProvideModule), - ) -} - -type ModuleInputs struct { - depinject.In - - Config *modulev1.Module - Cdc codec.Codec - Key *store.KVStoreKey - - StakingKeeper clienttypes.StakingKeeper - UpgradeKeeper clienttypes.UpgradeKeeper - ScopedKeeper capabilitykeeper.ScopedKeeper - - // LegacySubspace is used solely for migration of x/params managed parameters - LegacySubspace paramtypes.Subspace `optional:"true"` -} - -type ModuleOutputs struct { - depinject.Out - - IbcKeeper *keeper.Keeper - Module appmodule.AppModule -} - -func ProvideModule(in ModuleInputs) ModuleOutputs { - // default to governance authority if not provided - authority := authtypes.NewModuleAddress(govtypes.ModuleName) - if in.Config.Authority != "" { - authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) - } - - keeper := keeper.NewKeeper( - in.Cdc, - in.Key, - in.LegacySubspace, - in.StakingKeeper, - in.UpgradeKeeper, - in.ScopedKeeper, - authority.String(), - ) - m := NewAppModule(keeper) - - return ModuleOutputs{IbcKeeper: keeper, Module: m} -} diff --git a/proto/ibc/core/module/v1/module.proto b/proto/ibc/core/module/v1/module.proto deleted file mode 100644 index cacb4d505e4..00000000000 --- a/proto/ibc/core/module/v1/module.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package ibc.core.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the core module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/ibc-go/modules/core" - }; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 1; -} \ No newline at end of file