From f127cd49e9de44124bd3feb363aa6182b1d96153 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Mon, 4 Mar 2024 08:27:53 -0800 Subject: [PATCH] refactor: remove dependency x/module -> sdk in InterfaceRegistry - refactor modules to use core/registry/LegacyRegistry - update `HasRegisterInterfaces` definition - fix core_module.go usage - rm unused import in mock code - cd simapp/v2 && go mod tidy - mv HasRegisterInterfaces interface to core - fix failing test to conform with mock - use protoiface.MessageV1 in interface registry --- codec/types/interface_registry.go | 30 +++++++-------------------- core/appmodule/module.go | 5 ++++- core/appmodule/v2/appmodule.go | 6 ++++++ core/registry/legacy.go | 25 ++++++++++++++++++++++ testutil/mock/types_mock_appmodule.go | 6 +++--- testutil/mock/types_module_module.go | 10 ++++----- types/module/core_module.go | 20 +++++++++--------- types/module/module.go | 15 +++++--------- types/module/module_test.go | 7 ++++--- types/msgservice/msg_service.go | 5 +++-- x/accounts/keeper.go | 5 +++-- x/accounts/module.go | 4 ++-- x/accounts/utils_test.go | 4 ++-- x/auth/module.go | 4 ++-- x/auth/types/codec.go | 4 ++-- x/auth/vesting/module.go | 4 ++-- x/auth/vesting/types/codec.go | 4 ++-- x/authz/codec.go | 4 ++-- x/authz/module/module.go | 15 +++++++------- x/bank/module.go | 18 ++++++++-------- x/bank/types/codec.go | 5 +++-- x/circuit/module.go | 12 +++++------ x/circuit/types/codec.go | 5 +++-- x/consensus/module.go | 12 +++++------ x/consensus/types/codec.go | 5 +++-- x/counter/module.go | 8 +++---- x/counter/types/codec.go | 5 +++-- x/crisis/module.go | 12 +++++------ x/crisis/types/codec.go | 5 +++-- x/distribution/module.go | 18 ++++++++-------- x/distribution/types/codec.go | 5 +++-- x/evidence/module.go | 16 +++++++------- x/evidence/types/codec.go | 4 ++-- x/feegrant/codec.go | 5 +++-- x/feegrant/module/module.go | 15 +++++++------- x/genutil/module.go | 4 ++-- x/gov/module.go | 18 ++++++++-------- x/gov/types/v1/codec.go | 5 +++-- x/gov/types/v1beta1/codec.go | 5 +++-- x/group/codec.go | 5 +++-- x/group/module/module.go | 17 ++++++++------- x/mint/module.go | 16 +++++++------- x/mint/types/codec.go | 5 +++-- x/nft/codec.go | 5 +++-- x/nft/module/module.go | 13 ++++++------ x/params/module.go | 14 ++++++------- x/params/types/proposal/codec.go | 4 ++-- x/protocolpool/module.go | 18 ++++++++-------- x/protocolpool/types/codec.go | 5 +++-- x/slashing/module.go | 15 +++++++------- x/slashing/types/codec.go | 5 +++-- x/staking/module.go | 20 +++++++++--------- x/staking/types/codec.go | 5 +++-- x/upgrade/module.go | 14 ++++++------- x/upgrade/types/codec.go | 5 +++-- 55 files changed, 282 insertions(+), 243 deletions(-) create mode 100644 core/registry/legacy.go diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index babd46a446d3..bc76a4f53da5 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -5,12 +5,15 @@ import ( "fmt" "reflect" - "github.com/cosmos/gogoproto/jsonpb" - "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/runtime/protoiface" + "cosmossdk.io/core/registry" "cosmossdk.io/x/tx/signing" + + "github.com/cosmos/gogoproto/jsonpb" + "github.com/cosmos/gogoproto/proto" ) var protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() @@ -33,24 +36,7 @@ type AnyUnpacker interface { type InterfaceRegistry interface { AnyUnpacker jsonpb.AnyResolver - - // RegisterInterface associates protoName as the public name for the - // interface passed in as iface. This is to be used primarily to create - // a public facing registry of interface implementations for clients. - // protoName should be a well-chosen public facing name that remains stable. - // RegisterInterface takes an optional list of impls to be registered - // as implementations of iface. - // - // Ex: - // registry.RegisterInterface("cosmos.base.v1beta1.Msg", (*sdk.Msg)(nil)) - RegisterInterface(protoName string, iface interface{}, impls ...proto.Message) - - // RegisterImplementations registers impls as concrete implementations of - // the interface iface. - // - // Ex: - // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) - RegisterImplementations(iface interface{}, impls ...proto.Message) + registry.LegacyRegistry // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -158,7 +144,7 @@ func NewInterfaceRegistryWithOptions(options InterfaceRegistryOptions) (Interfac }, nil } -func (registry *interfaceRegistry) RegisterInterface(protoName string, iface interface{}, impls ...proto.Message) { +func (registry *interfaceRegistry) RegisterInterface(protoName string, iface interface{}, impls ...protoiface.MessageV1) { typ := reflect.TypeOf(iface) if typ.Elem().Kind() != reflect.Interface { panic(fmt.Errorf("%T is not an interface type", iface)) @@ -188,7 +174,7 @@ func (registry *interfaceRegistry) EnsureRegistered(impl interface{}) error { // // This function PANICs if different concrete types are registered under the // same typeURL. -func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { +func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...protoiface.MessageV1) { for _, impl := range impls { typeURL := MsgTypeURL(impl) registry.registerImpl(iface, typeURL, impl) diff --git a/core/appmodule/module.go b/core/appmodule/module.go index 7f352a28e7b6..e36e271eab6f 100644 --- a/core/appmodule/module.go +++ b/core/appmodule/module.go @@ -6,7 +6,7 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/runtime/protoiface" - appmodule "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/appmodule/v2" ) // AppModule is a tag interface for app module implementations to use as a basis @@ -70,6 +70,9 @@ type HasBeginBlocker = appmodule.HasBeginBlocker // custom logic after transaction processing in a block. type HasEndBlocker = appmodule.HasEndBlocker +// HasRegisterInterfaces is the interface for modules to register their msg types. +type HasRegisterInterfaces = appmodule.HasRegisterInterfaces + // MsgHandlerRouter is implemented by the runtime provider. type MsgHandlerRouter interface { // RegisterHandler is called by modules to register msg handler functions. diff --git a/core/appmodule/v2/appmodule.go b/core/appmodule/v2/appmodule.go index eb44c9f513b8..b0bfb19d2fcc 100644 --- a/core/appmodule/v2/appmodule.go +++ b/core/appmodule/v2/appmodule.go @@ -3,6 +3,7 @@ package appmodule import ( "context" + "cosmossdk.io/core/registry" "cosmossdk.io/core/transaction" ) @@ -90,3 +91,8 @@ type ValidatorUpdate struct { PubKeyType string Power int64 // updated power of the validtor } + +// HasRegisterInterfaces is the interface for modules to register their msg types. +type HasRegisterInterfaces interface { + RegisterInterfaces(registry.LegacyRegistry) +} diff --git a/core/registry/legacy.go b/core/registry/legacy.go new file mode 100644 index 000000000000..0f921132c1c1 --- /dev/null +++ b/core/registry/legacy.go @@ -0,0 +1,25 @@ +package registry + +import ( + "google.golang.org/protobuf/runtime/protoiface" +) + +type LegacyRegistry interface { + // RegisterInterface associates protoName as the public name for the + // interface passed in as iface. This is to be used primarily to create + // a public facing registry of interface implementations for clients. + // protoName should be a well-chosen public facing name that remains stable. + // RegisterInterface takes an optional list of impls to be registered + // as implementations of iface. + // + // Ex: + // registry.RegisterInterface("cosmos.base.v1beta1.Msg", (*sdk.Msg)(nil)) + RegisterInterface(protoName string, iface interface{}, impls ...protoiface.MessageV1) + + // RegisterImplementations registers impls as concrete implementations of + // the interface iface. + // + // Ex: + // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) + RegisterImplementations(iface interface{}, impls ...protoiface.MessageV1) +} diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index 144576e2bf6a..3d3f3c06442f 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -10,10 +10,10 @@ import ( reflect "reflect" appmodule "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" types "github.com/cometbft/cometbft/abci/types" client "github.com/cosmos/cosmos-sdk/client" codec "github.com/cosmos/cosmos-sdk/codec" - types0 "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" @@ -150,7 +150,7 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -332,7 +332,7 @@ func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 2aac944f3138..044cca224fa5 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -9,10 +9,10 @@ import ( json "encoding/json" reflect "reflect" + "cosmossdk.io/core/registry" types "github.com/cometbft/cometbft/abci/types" client "github.com/cosmos/cosmos-sdk/client" codec "github.com/cosmos/cosmos-sdk/codec" - types0 "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" @@ -69,7 +69,7 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 i } // RegisterInterfaces mocks base method. -func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockAppModuleBasic) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -154,7 +154,7 @@ func (mr *MockAppModuleMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockAppModule) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -326,7 +326,7 @@ func (m *MockHasRegisterInterfaces) EXPECT() *MockHasRegisterInterfacesMockRecor } // RegisterInterfaces mocks base method. -func (m *MockHasRegisterInterfaces) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockHasRegisterInterfaces) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -740,7 +740,7 @@ func (mr *MockHasABCIEndBlockMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 registry.LegacyRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } diff --git a/types/module/core_module.go b/types/module/core_module.go index fa81659a16f0..ae3101043603 100644 --- a/types/module/core_module.go +++ b/types/module/core_module.go @@ -10,23 +10,23 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/genesis" + "cosmossdk.io/core/registry" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) var ( _ appmodule.AppModule = coreAppModuleAdaptor{} - _ HasName = coreAppModuleAdaptor{} - _ HasAminoCodec = coreAppModuleAdaptor{} - _ HasGRPCGateway = coreAppModuleAdaptor{} - _ HasRegisterInterfaces = coreAppModuleAdaptor{} - _ HasABCIGenesis = coreAppModuleAdaptor{} - _ HasServices = coreAppModuleAdaptor{} + _ HasName = coreAppModuleAdaptor{} + _ HasAminoCodec = coreAppModuleAdaptor{} + _ HasGRPCGateway = coreAppModuleAdaptor{} + _ appmodule.HasRegisterInterfaces = coreAppModuleAdaptor{} + _ HasABCIGenesis = coreAppModuleAdaptor{} + _ HasServices = coreAppModuleAdaptor{} ) // CoreAppModuleAdaptor wraps the core API module as an AppModule that this version of the SDK can use. @@ -171,11 +171,11 @@ func (c coreAppModuleAdaptor) RegisterGRPCGatewayRoutes(ctx client.Context, mux } // RegisterInterfaces implements HasRegisterInterfaces -func (c coreAppModuleAdaptor) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (c coreAppModuleAdaptor) RegisterInterfaces(reg registry.LegacyRegistry) { if mod, ok := c.module.(interface { - RegisterInterfaces(registry codectypes.InterfaceRegistry) + RegisterInterfaces(registry.LegacyRegistry) }); ok { - mod.RegisterInterfaces(registry) + mod.RegisterInterfaces(reg) } } diff --git a/types/module/module.go b/types/module/module.go index 7afba9f1211d..c2feef8ec579 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -33,12 +33,12 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/genesis" + "cosmossdk.io/core/registry" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -46,7 +46,7 @@ import ( // Deprecated: use the embed extension interfaces instead, when needed. type AppModuleBasic interface { HasName - HasRegisterInterfaces + appmodule.HasRegisterInterfaces HasGRPCGateway HasAminoCodec } @@ -58,7 +58,7 @@ type AppModule interface { appmodule.AppModule HasName - HasRegisterInterfaces + appmodule.HasRegisterInterfaces } // HasName allows the module to provide its own name for legacy purposes. @@ -82,11 +82,6 @@ type HasAminoCodec interface { RegisterLegacyAminoCodec(*codec.LegacyAmino) } -// HasRegisterInterfaces is the interface for modules to register their msg types. -type HasRegisterInterfaces interface { - RegisterInterfaces(types.InterfaceRegistry) -} - // HasGRPCGateway is the interface for modules to register their gRPC gateway routes. type HasGRPCGateway interface { RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) @@ -317,9 +312,9 @@ func (m *Manager) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers all module interface types -func (m *Manager) RegisterInterfaces(registry types.InterfaceRegistry) { +func (m *Manager) RegisterInterfaces(registry registry.LegacyRegistry) { for _, b := range m.Modules { - if mod, ok := b.(HasRegisterInterfaces); ok { + if mod, ok := b.(appmodule.HasRegisterInterfaces); ok { mod.RegisterInterfaces(registry) } } diff --git a/types/module/module_test.go b/types/module/module_test.go index 4853ca86e7dc..0e610576b437 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -7,6 +7,7 @@ import ( "io" "testing" + appmodulev2 "cosmossdk.io/core/appmodule/v2" abci "github.com/cometbft/cometbft/abci/types" "github.com/golang/mock/gomock" "github.com/spf13/cobra" @@ -270,15 +271,15 @@ func TestManager_EndBlock(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 3, len(mm.Modules)) - mockAppModule1.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]abci.ValidatorUpdate{{}}, nil) + mockAppModule1.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]appmodulev2.ValidatorUpdate{{}}, nil) mockAppModule2.EXPECT().EndBlock(gomock.Any()).Times(1) ret, err := mm.EndBlock(sdk.Context{}) require.NoError(t, err) require.Equal(t, []abci.ValidatorUpdate{{}}, ret.ValidatorUpdates) // test panic - mockAppModule1.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]abci.ValidatorUpdate{{}}, nil) - mockAppModule2.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]abci.ValidatorUpdate{{}}, nil) + mockAppModule1.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]appmodulev2.ValidatorUpdate{{}}, nil) + mockAppModule2.EXPECT().EndBlock(gomock.Any()).Times(1).Return([]appmodulev2.ValidatorUpdate{{}}, nil) _, err = mm.EndBlock(sdk.Context{}) require.Error(t, err) } diff --git a/types/msgservice/msg_service.go b/types/msgservice/msg_service.go index 46de830f0014..e8c08f98a617 100644 --- a/types/msgservice/msg_service.go +++ b/types/msgservice/msg_service.go @@ -14,14 +14,15 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "cosmossdk.io/core/registry" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" ) // RegisterMsgServiceDesc registers all type_urls from Msg services described // in `sd` into the registry. -func RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.ServiceDesc) { +func RegisterMsgServiceDesc(registry registry.LegacyRegistry, sd *grpc.ServiceDesc) { fdBytesUnzipped := unzip(proto.FileDescriptor(sd.Metadata.(string))) if fdBytesUnzipped == nil { panic(fmt.Errorf("error unzipping file description for MsgService %s", sd.ServiceName)) diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 010f5b495135..6a4779499819 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -10,6 +10,7 @@ import ( gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoiface" "cosmossdk.io/collections" "cosmossdk.io/core/address" @@ -56,8 +57,8 @@ type SignerProvider interface { } type InterfaceRegistry interface { - RegisterInterface(name string, iface any, impls ...gogoproto.Message) - RegisterImplementations(iface any, impls ...gogoproto.Message) + RegisterInterface(name string, iface any, impls ...protoiface.MessageV1) + RegisterImplementations(iface any, impls ...protoiface.MessageV1) } func NewKeeper( diff --git a/x/accounts/module.go b/x/accounts/module.go index 9d5288cf31ea..cb17a98521bb 100644 --- a/x/accounts/module.go +++ b/x/accounts/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" + "cosmossdk.io/core/registry" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -13,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -52,7 +52,7 @@ func (m AppModule) IsAppModule() {} func (AppModule) Name() string { return ModuleName } -func (m AppModule) RegisterInterfaces(registry types.InterfaceRegistry) { +func (m AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { msgservice.RegisterMsgServiceDesc(registry, v1.MsgServiceDesc()) } diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go index 5ee67365b6ec..97ee8828614f 100644 --- a/x/accounts/utils_test.go +++ b/x/accounts/utils_test.go @@ -43,9 +43,9 @@ var _ InterfaceRegistry = (*interfaceRegistry)(nil) type interfaceRegistry struct{} -func (i interfaceRegistry) RegisterInterface(string, any, ...gogoproto.Message) {} +func (i interfaceRegistry) RegisterInterface(string, any, ...protoiface.MessageV1) {} -func (i interfaceRegistry) RegisterImplementations(any, ...gogoproto.Message) {} +func (i interfaceRegistry) RegisterImplementations(any, ...protoiface.MessageV1) {} func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Keeper, context.Context) { t.Helper() diff --git a/x/auth/module.go b/x/auth/module.go index a0fb08b42b19..149882b97327 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/registry" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" @@ -15,7 +16,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -71,7 +71,7 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the auth module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 146ef5d2bff2..5e6a29986a97 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -1,11 +1,11 @@ package types import ( + "cosmossdk.io/core/registry" "cosmossdk.io/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -28,7 +28,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces associates protoName with AccountI interface // and creates a registry of it's concrete implementations -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterInterface( "cosmos.auth.v1beta1.AccountI", (*AccountI)(nil), diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 23066ae58787..128f1a36ae81 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -2,11 +2,11 @@ package vesting import ( "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/auth/keeper" "cosmossdk.io/x/auth/vesting/types" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -45,7 +45,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the module's interfaces and implementations with // the given interface registry. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 3db83da05211..431b511931c9 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -1,12 +1,12 @@ package types import ( + "cosmossdk.io/core/registry" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/auth/vesting/exported" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -27,7 +27,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterface associates protoName with AccountI and VestingAccount // Interfaces and creates a registry of it's concrete implementations -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterInterface( "cosmos.vesting.v1beta1.VestingAccount", (*exported.VestingAccount)(nil), diff --git a/x/authz/codec.go b/x/authz/codec.go index 2a6432512957..2d1d095f4e7e 100644 --- a/x/authz/codec.go +++ b/x/authz/codec.go @@ -1,12 +1,12 @@ package authz import ( + "cosmossdk.io/core/registry" bank "cosmossdk.io/x/bank/types" staking "cosmossdk.io/x/staking/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - types "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -23,7 +23,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgGrant{}, &MsgRevoke{}, diff --git a/x/authz/module/module.go b/x/authz/module/module.go index 31b7a35a1382..d11db1bcad8f 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/errors" "cosmossdk.io/x/authz" "cosmossdk.io/x/authz/client/cli" @@ -26,12 +27,12 @@ import ( const ConsensusVersion = 2 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -91,7 +92,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the authz module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { authz.RegisterInterfaces(registry) } diff --git a/x/bank/module.go b/x/bank/module.go index f233d0115b4c..184996dd82e4 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -11,6 +11,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/bank/client/cli" "cosmossdk.io/x/bank/keeper" "cosmossdk.io/x/bank/simulation" @@ -18,7 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -29,13 +29,13 @@ import ( const ConsensusVersion = 4 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.HasInvariants = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasInvariants = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasServices = AppModule{} @@ -82,7 +82,7 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/bank/types/codec.go b/x/bank/types/codec.go index 24730aa8a4ef..978d7d1baae7 100644 --- a/x/bank/types/codec.go +++ b/x/bank/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -20,7 +21,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&Params{}, "cosmos-sdk/x/bank/Params", nil) } -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}, diff --git a/x/circuit/module.go b/x/circuit/module.go index b52c1443cbb5..9468ce0c9f68 100644 --- a/x/circuit/module.go +++ b/x/circuit/module.go @@ -10,12 +10,12 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/circuit/keeper" "cosmossdk.io/x/circuit/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/telemetry" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -24,10 +24,10 @@ import ( const ConsensusVersion = 1 var ( - _ module.HasName = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasServices = AppModule{} @@ -53,7 +53,7 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the circuit module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/circuit/types/codec.go b/x/circuit/types/codec.go index 775eb1aee1c5..41bab1a4d89d 100644 --- a/x/circuit/types/codec.go +++ b/x/circuit/types/codec.go @@ -1,13 +1,14 @@ package types import ( - types "github.com/cosmos/cosmos-sdk/codec/types" + "cosmossdk.io/core/registry" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAuthorizeCircuitBreaker{}, &MsgResetCircuitBreaker{}, diff --git a/x/consensus/module.go b/x/consensus/module.go index 6ca759424673..107ac6431b3c 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -7,10 +7,10 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/consensus/keeper" "github.com/cosmos/cosmos-sdk/x/consensus/types" @@ -20,10 +20,10 @@ import ( const ConsensusVersion = 1 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} _ appmodule.AppModule = AppModule{} ) @@ -61,7 +61,7 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/consensus/types/codec.go b/x/consensus/types/codec.go index 048d9a427760..f9fa0a8f2a31 100644 --- a/x/consensus/types/codec.go +++ b/x/consensus/types/codec.go @@ -1,14 +1,15 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, diff --git a/x/counter/module.go b/x/counter/module.go index 89a4dda11f21..5f4ea4312498 100644 --- a/x/counter/module.go +++ b/x/counter/module.go @@ -4,16 +4,16 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/counter/keeper" "github.com/cosmos/cosmos-sdk/x/counter/types" ) var ( - _ module.HasName = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} + _ module.HasName = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} _ appmodule.AppModule = AppModule{} ) @@ -47,6 +47,6 @@ func (AppModule) ConsensusVersion() uint64 { return 1 } func (AppModule) Name() string { return types.ModuleName } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/counter/types/codec.go b/x/counter/types/codec.go index 36f13df3b9da..8776f0ff0dc3 100644 --- a/x/counter/types/codec.go +++ b/x/counter/types/codec.go @@ -1,12 +1,13 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec/types" + "cosmossdk.io/core/registry" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgIncreaseCounter{}, diff --git a/x/crisis/module.go b/x/crisis/module.go index 0d6864a0d353..1707baf033d7 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -10,10 +10,10 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/telemetry" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/crisis/keeper" @@ -24,10 +24,10 @@ import ( const ConsensusVersion = 2 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasEndBlocker = AppModule{} @@ -74,7 +74,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers interfaces and implementations of the crisis // module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/crisis/types/codec.go b/x/crisis/types/codec.go index 934b0b78b1d7..10f9fa317995 100644 --- a/x/crisis/types/codec.go +++ b/x/crisis/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -16,7 +17,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVerifyInvariant{}, &MsgUpdateParams{}, diff --git a/x/distribution/module.go b/x/distribution/module.go index c9e351eb93e4..3591b448b9bc 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/distribution/client/cli" "cosmossdk.io/x/distribution/keeper" "cosmossdk.io/x/distribution/simulation" @@ -17,7 +18,6 @@ import ( sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -27,13 +27,13 @@ import ( const ConsensusVersion = 4 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.HasInvariants = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasInvariants = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -92,7 +92,7 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces implements InterfaceModule -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 14181500aae2..3d05793aad8e 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -21,7 +22,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params", nil) } -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgWithdrawDelegatorReward{}, diff --git a/x/evidence/module.go b/x/evidence/module.go index b09183dbb50b..854ada04705a 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" eviclient "cosmossdk.io/x/evidence/client" "cosmossdk.io/x/evidence/client/cli" "cosmossdk.io/x/evidence/keeper" @@ -18,18 +19,17 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -82,7 +82,7 @@ func (am AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers the evidence module's interface types -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/evidence/types/codec.go b/x/evidence/types/codec.go index 62ffa37cfde4..15bb55568b3e 100644 --- a/x/evidence/types/codec.go +++ b/x/evidence/types/codec.go @@ -1,11 +1,11 @@ package types import ( + "cosmossdk.io/core/registry" "cosmossdk.io/x/evidence/exported" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -19,7 +19,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitEvidence{}) registry.RegisterInterface( "cosmos.evidence.v1beta1.Evidence", diff --git a/x/feegrant/codec.go b/x/feegrant/codec.go index 19c2d46f756d..a840e9eaf738 100644 --- a/x/feegrant/codec.go +++ b/x/feegrant/codec.go @@ -1,9 +1,10 @@ package feegrant import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -21,7 +22,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgGrantAllowance{}, &MsgRevokeAllowance{}, diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 73ca979403fc..d950ae6a285d 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/errors" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/client/cli" @@ -22,12 +23,12 @@ import ( ) var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasEndBlocker = AppModule{} @@ -70,7 +71,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the feegrant module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { feegrant.RegisterInterfaces(registry) } diff --git a/x/genutil/module.go b/x/genutil/module.go index bc0472da4d97..cfb3096d3881 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/registry" abci "github.com/cometbft/cometbft/abci/types" "cosmossdk.io/core/appmodule" @@ -12,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/genutil/types" ) @@ -98,4 +98,4 @@ func (am AppModule) GenTxValidator() types.MessageValidator { func (AppModule) ConsensusVersion() uint64 { return 1 } // RegisterInterfaces implements module.AppModule. -func (AppModule) RegisterInterfaces(codectypes.InterfaceRegistry) {} +func (AppModule) RegisterInterfaces(registry.LegacyRegistry) {} diff --git a/x/gov/module.go b/x/gov/module.go index 889ce865af99..f169e4b8c754 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" govclient "cosmossdk.io/x/gov/client" "cosmossdk.io/x/gov/client/cli" "cosmossdk.io/x/gov/keeper" @@ -20,7 +21,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -29,13 +29,13 @@ import ( const ConsensusVersion = 6 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.HasInvariants = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasInvariants = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasEndBlocker = AppModule{} @@ -110,7 +110,7 @@ func getProposalCLIHandlers(handlers []govclient.ProposalHandler) []*cobra.Comma } // RegisterInterfaces implements InterfaceModule.RegisterInterfaces -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { v1.RegisterInterfaces(registry) v1beta1.RegisterInterfaces(registry) } diff --git a/x/gov/types/v1/codec.go b/x/gov/types/v1/codec.go index bd8f7e042e24..6a3b96cc97a7 100644 --- a/x/gov/types/v1/codec.go +++ b/x/gov/types/v1/codec.go @@ -1,9 +1,10 @@ package v1 import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -23,7 +24,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgSubmitMultipleChoiceProposal{}, diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index d5b8b90880e2..9c6c4064c68f 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -1,9 +1,10 @@ package v1beta1 import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -20,7 +21,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgVote{}, diff --git a/x/group/codec.go b/x/group/codec.go index 937fea2a6c78..5c816ebebcc9 100644 --- a/x/group/codec.go +++ b/x/group/codec.go @@ -1,9 +1,10 @@ package group import ( + "cosmossdk.io/core/registry" + codectypes "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -33,7 +34,7 @@ func RegisterLegacyAminoCodec(cdc *codectypes.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGroup{}, &MsgUpdateGroupMembers{}, diff --git a/x/group/module/module.go b/x/group/module/module.go index 176ef28cf00a..4a232b9c142f 100644 --- a/x/group/module/module.go +++ b/x/group/module/module.go @@ -10,6 +10,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/group" "cosmossdk.io/x/group/client/cli" "cosmossdk.io/x/group/keeper" @@ -27,13 +28,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.HasInvariants = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasInvariants = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasEndBlocker = AppModule{} @@ -82,7 +83,7 @@ func (am AppModule) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux * } // RegisterInterfaces registers the group module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { group.RegisterInterfaces(registry) } diff --git a/x/mint/module.go b/x/mint/module.go index 3f8e9fbabfb8..8f228900c8d8 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -9,13 +9,13 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/mint/keeper" "cosmossdk.io/x/mint/simulation" "cosmossdk.io/x/mint/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -24,12 +24,12 @@ import ( const ConsensusVersion = 2 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -82,7 +82,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/mint/types/codec.go b/x/mint/types/codec.go index bdbe4b9f50bb..0f35aead639b 100644 --- a/x/mint/types/codec.go +++ b/x/mint/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -15,7 +16,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, diff --git a/x/nft/codec.go b/x/nft/codec.go index 12a4250cb308..c02cf391372c 100644 --- a/x/nft/codec.go +++ b/x/nft/codec.go @@ -1,13 +1,14 @@ package nft import ( - types "github.com/cosmos/cosmos-sdk/codec/types" + "cosmossdk.io/core/registry" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, ) diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 8f213b1305c9..b782d14c39fb 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -8,6 +8,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/errors" "cosmossdk.io/x/nft" "cosmossdk.io/x/nft/keeper" @@ -21,11 +22,11 @@ import ( ) var ( - _ module.HasName = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} ) @@ -70,7 +71,7 @@ func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { } // RegisterInterfaces registers the nft module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { nft.RegisterInterfaces(registry) } diff --git a/x/params/module.go b/x/params/module.go index f919fc1ec16c..5cd796cc867c 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -7,22 +7,22 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/params/keeper" "cosmossdk.io/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasServices = AppModule{} @@ -64,7 +64,7 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { proposal.RegisterInterfaces(registry) } diff --git a/x/params/types/proposal/codec.go b/x/params/types/proposal/codec.go index f9eda3bea5ba..9b6c448349ec 100644 --- a/x/params/types/proposal/codec.go +++ b/x/params/types/proposal/codec.go @@ -1,10 +1,10 @@ package proposal import ( + "cosmossdk.io/core/registry" govtypes "cosmossdk.io/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" ) // RegisterLegacyAminoCodec registers all necessary param module types with a given LegacyAmino codec. @@ -12,7 +12,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal", nil) } -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*govtypes.Content)(nil), &ParameterChangeProposal{}, diff --git a/x/protocolpool/module.go b/x/protocolpool/module.go index 0257e69960eb..03c56baed7ac 100644 --- a/x/protocolpool/module.go +++ b/x/protocolpool/module.go @@ -9,12 +9,12 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/protocolpool/keeper" "cosmossdk.io/x/protocolpool/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -22,13 +22,13 @@ import ( const ConsensusVersion = 1 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModule = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasServices = AppModule{} @@ -71,7 +71,7 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/protocolpool/types/codec.go b/x/protocolpool/types/codec.go index 30bef81c2f8d..71baad73ec06 100644 --- a/x/protocolpool/types/codec.go +++ b/x/protocolpool/types/codec.go @@ -1,12 +1,13 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec/types" + "cosmossdk.io/core/registry" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgFundCommunityPool{}, diff --git a/x/slashing/module.go b/x/slashing/module.go index cdadc1b03202..6c78a386166d 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/slashing/keeper" "cosmossdk.io/x/slashing/simulation" "cosmossdk.io/x/slashing/types" @@ -24,12 +25,12 @@ import ( const ConsensusVersion = 4 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -81,7 +82,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/slashing/types/codec.go b/x/slashing/types/codec.go index 4b494a79eba9..ed8838609b09 100644 --- a/x/slashing/types/codec.go +++ b/x/slashing/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -16,7 +17,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUnjail{}, &MsgUpdateParams{}, diff --git a/x/staking/module.go b/x/staking/module.go index 46d3875dd3f8..d3d28ce25043 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -11,6 +11,7 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/depinject" "cosmossdk.io/x/staking/client/cli" "cosmossdk.io/x/staking/keeper" @@ -18,7 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -28,14 +28,14 @@ const ( ) var ( - _ module.AppModuleSimulation = AppModule{} - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.HasInvariants = AppModule{} - _ module.HasABCIGenesis = AppModule{} - _ module.HasABCIEndBlock = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.HasInvariants = AppModule{} + _ module.HasABCIGenesis = AppModule{} + _ module.HasABCIEndBlock = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasBeginBlocker = AppModule{} @@ -82,7 +82,7 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 9f3bec47a742..7c019f3b5c3e 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -28,7 +29,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the x/staking interfaces types with the interface registry -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateValidator{}, &MsgEditValidator{}, diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 7a609ae4b25a..7ddebb6bc1e8 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -10,13 +10,13 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" "cosmossdk.io/x/upgrade/client/cli" "cosmossdk.io/x/upgrade/keeper" "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -28,11 +28,11 @@ func init() { const ConsensusVersion uint64 = 3 var ( - _ module.HasName = AppModule{} - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.HasRegisterInterfaces = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ appmodule.HasRegisterInterfaces = AppModule{} + _ module.HasGenesis = AppModule{} _ appmodule.AppModule = AppModule{} _ appmodule.HasPreBlocker = AppModule{} @@ -78,7 +78,7 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers interfaces and implementations of the upgrade module. -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { types.RegisterInterfaces(registry) } diff --git a/x/upgrade/types/codec.go b/x/upgrade/types/codec.go index 66ba3c2fe282..366bb3105b24 100644 --- a/x/upgrade/types/codec.go +++ b/x/upgrade/types/codec.go @@ -1,9 +1,10 @@ package types import ( + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -18,7 +19,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry registry.LegacyRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSoftwareUpgrade{}, &MsgCancelUpgrade{},