diff --git a/CHANGELOG.md b/CHANGELOG.md index 38c0cb0611d4..dc5cd5d519e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -144,9 +144,9 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (types) [#18607](https://github.com/cosmos/cosmos-sdk/pull/18607) Removed address verifier from global config, moved verifier function to bech32 codec. * (server) [#18909](https://github.com/cosmos/cosmos-sdk/pull/18909) Remove configuration endpoint on grpc reflection endpoint in favour of auth module bech32prefix endpoint already exposed. * (crypto) [#19541](https://github.com/cosmos/cosmos-sdk/pull/19541) The deprecated `FromTmProtoPublicKey`, `ToTmProtoPublicKey`, `FromTmPubKeyInterface` and `ToTmPubKeyInterface` functions have been removed. Use their replacements (`Cmt` instead of `Tm`) instead. -* (types) [#19652](https://github.com/cosmos/cosmos-sdk/pull/19652) +* (types) [#19652](https://github.com/cosmos/cosmos-sdk/pull/19652) and [#19758](https://github.com/cosmos/cosmos-sdk/pull/19758) * Moved`types/module.HasRegisterInterfaces` to `cosmossdk.io/core`. - * Moved `RegisterInterfaces` and `RegisterImplementations` from `InterfaceRegistry` to `cosmossdk.io/core/registry.LegacyRegistry` interface. + * Moved `RegisterInterfaces` and `RegisterImplementations` from `InterfaceRegistry` to `cosmossdk.io/core/registry.InterfaceRegistrar` interface. * (types) [#19627](https://github.com/cosmos/cosmos-sdk/pull/19627) and [#19735](https://github.com/cosmos/cosmos-sdk/pull/19735) All genesis interfaces now don't take `codec.JsonCodec`. * Every module has the codec already, passing it created an unneeded dependency. * Additionally, to reflect this change, the module manager does not take a codec either. diff --git a/UPGRADING.md b/UPGRADING.md index 3a21dee49158..cdc28d55457f 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -166,11 +166,11 @@ If your module requires a message server or query server, it should be passed in +govKeeper := govkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[govtypes.StoreKey]), logger, runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), app.AuthKeeper, app.BankKeeper, app.StakingKeeper, app.PoolKeeper, govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ``` -The signature of the extension interface `HasRegisterInterfaces` has been changed to accept a `cosmossdk.io/core/registry.LegacyRegistry` instead of a `codec.InterfaceRegistry`. `HasRegisterInterfaces` is now a part of `cosmossdk.io/core/appmodule`. Modules should update their `HasRegisterInterfaces` implementation to accept a `cosmossdk.io/core/registry.LegacyRegistry` interface. +The signature of the extension interface `HasRegisterInterfaces` has been changed to accept a `cosmossdk.io/core/registry.InterfaceRegistrar` instead of a `codec.InterfaceRegistry`. `HasRegisterInterfaces` is now a part of `cosmossdk.io/core/appmodule`. Modules should update their `HasRegisterInterfaces` implementation to accept a `cosmossdk.io/core/registry.InterfaceRegistrar` interface. ```diff -func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) { -+func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { ++func (AppModule) RegisterInterfaces(registry registry.InterfaceRegistrar) { ``` ##### Dependency Injection diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index cbeb1913ace0..b621d7a19856 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -35,7 +35,7 @@ type AnyUnpacker interface { type InterfaceRegistry interface { AnyUnpacker jsonpb.AnyResolver - registry.LegacyRegistry + registry.InterfaceRegistrar // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string diff --git a/core/appmodule/v2/module.go b/core/appmodule/v2/module.go index 2fe0cc99f07b..47d581257753 100644 --- a/core/appmodule/v2/module.go +++ b/core/appmodule/v2/module.go @@ -102,5 +102,5 @@ type ValidatorUpdate struct { // HasRegisterInterfaces is the interface for modules to register their msg types. type HasRegisterInterfaces interface { - RegisterInterfaces(registry.LegacyRegistry) + RegisterInterfaces(registry.InterfaceRegistrar) } diff --git a/core/registry/legacy.go b/core/registry/legacy.go index 0f921132c1c1..eeb85afdecb4 100644 --- a/core/registry/legacy.go +++ b/core/registry/legacy.go @@ -4,7 +4,7 @@ import ( "google.golang.org/protobuf/runtime/protoiface" ) -type LegacyRegistry interface { +type InterfaceRegistrar 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. diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index 0d668299abfa..dacba1facdb1 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -150,7 +150,7 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 registry.LegacyRegistry) { +func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -334,7 +334,7 @@ func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 registry.LegacyRegistry) { +func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { 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 01a7e3219496..2fe80207569f 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -68,7 +68,7 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 i } // RegisterInterfaces mocks base method. -func (m *MockAppModuleBasic) RegisterInterfaces(arg0 registry.LegacyRegistry) { +func (m *MockAppModuleBasic) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -153,7 +153,7 @@ func (mr *MockAppModuleMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockAppModule) RegisterInterfaces(arg0 registry.LegacyRegistry) { +func (m *MockAppModule) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } @@ -578,7 +578,7 @@ func (mr *MockHasABCIEndBlockMockRecorder) Name() *gomock.Call { } // RegisterInterfaces mocks base method. -func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 registry.LegacyRegistry) { +func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { 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 398800f0fcb0..26acf836bd68 100644 --- a/types/module/core_module.go +++ b/types/module/core_module.go @@ -189,9 +189,9 @@ func (c coreAppModuleAdaptor) RegisterGRPCGatewayRoutes(ctx client.Context, mux } // RegisterInterfaces implements HasRegisterInterfaces -func (c coreAppModuleAdaptor) RegisterInterfaces(reg registry.LegacyRegistry) { +func (c coreAppModuleAdaptor) RegisterInterfaces(reg registry.InterfaceRegistrar) { if mod, ok := c.module.(interface { - RegisterInterfaces(registry.LegacyRegistry) + RegisterInterfaces(registry.InterfaceRegistrar) }); ok { mod.RegisterInterfaces(reg) } diff --git a/types/module/module.go b/types/module/module.go index fba59b89ea05..d64ca83e835e 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -312,10 +312,10 @@ func (m *Manager) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers all module interface types -func (m *Manager) RegisterInterfaces(registry registry.LegacyRegistry) { +func (m *Manager) RegisterInterfaces(registrar registry.InterfaceRegistrar) { for _, b := range m.Modules { if mod, ok := b.(appmodule.HasRegisterInterfaces); ok { - mod.RegisterInterfaces(registry) + mod.RegisterInterfaces(registrar) } } } diff --git a/types/msgservice/msg_service.go b/types/msgservice/msg_service.go index e8c08f98a617..4c39753022fa 100644 --- a/types/msgservice/msg_service.go +++ b/types/msgservice/msg_service.go @@ -22,7 +22,7 @@ import ( // RegisterMsgServiceDesc registers all type_urls from Msg services described // in `sd` into the registry. -func RegisterMsgServiceDesc(registry registry.LegacyRegistry, sd *grpc.ServiceDesc) { +func RegisterMsgServiceDesc(registrar registry.InterfaceRegistrar, 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)) @@ -51,8 +51,8 @@ func RegisterMsgServiceDesc(registry registry.LegacyRegistry, sd *grpc.ServiceDe respTyp := proto.MessageType(string(responseDesc.FullName())) // Register sdk.Msg and sdk.MsgResponse to the registry. - registry.RegisterImplementations((*sdk.Msg)(nil), reflect.New(reqTyp).Elem().Interface().(proto.Message)) - registry.RegisterImplementations((*tx.MsgResponse)(nil), reflect.New(respTyp).Elem().Interface().(proto.Message)) + registrar.RegisterImplementations((*sdk.Msg)(nil), reflect.New(reqTyp).Elem().Interface().(proto.Message)) + registrar.RegisterImplementations((*tx.MsgResponse)(nil), reflect.New(respTyp).Elem().Interface().(proto.Message)) } } diff --git a/x/accounts/module.go b/x/accounts/module.go index 6d19dde0a5ca..2a85cf47180a 100644 --- a/x/accounts/module.go +++ b/x/accounts/module.go @@ -50,8 +50,8 @@ func (m AppModule) IsAppModule() {} func (AppModule) Name() string { return ModuleName } -func (m AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - msgservice.RegisterMsgServiceDesc(registry, v1.MsgServiceDesc()) +func (m AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + msgservice.RegisterMsgServiceDesc(registrar, v1.MsgServiceDesc()) } // App module services diff --git a/x/auth/module.go b/x/auth/module.go index e46711451a7b..9adf511a096e 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -73,8 +73,8 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the auth module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 5e6a29986a97..685d9eb85dc5 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -28,35 +28,35 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces associates protoName with AccountI interface // and creates a registry of it's concrete implementations -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterInterface( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterInterface( "cosmos.auth.v1beta1.AccountI", (*AccountI)(nil), &BaseAccount{}, &ModuleAccount{}, ) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.auth.v1beta1.AccountI", (*sdk.AccountI)(nil), &BaseAccount{}, &ModuleAccount{}, ) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.auth.v1beta1.GenesisAccount", (*GenesisAccount)(nil), &BaseAccount{}, &ModuleAccount{}, ) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.auth.v1.ModuleCredential", (*cryptotypes.PubKey)(nil), &ModuleCredential{}, ) - registry.RegisterImplementations((*sdk.Msg)(nil), + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, ) } diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 128f1a36ae81..8835309db9ed 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -45,8 +45,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the module's interfaces and implementations with // the given interface registry. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // ConsensusVersion implements HasConsensusVersion. diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 431b511931c9..118d075d9238 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -27,8 +27,8 @@ 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 registry.LegacyRegistry) { - registry.RegisterInterface( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterInterface( "cosmos.vesting.v1beta1.VestingAccount", (*exported.VestingAccount)(nil), &ContinuousVestingAccount{}, @@ -37,7 +37,7 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &PermanentLockedAccount{}, ) - registry.RegisterImplementations( + registrar.RegisterImplementations( (*sdk.AccountI)(nil), &BaseVestingAccount{}, &DelayedVestingAccount{}, @@ -46,7 +46,7 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &PermanentLockedAccount{}, ) - registry.RegisterImplementations( + registrar.RegisterImplementations( (*authtypes.GenesisAccount)(nil), &BaseVestingAccount{}, &DelayedVestingAccount{}, @@ -55,11 +55,11 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &PermanentLockedAccount{}, ) - registry.RegisterImplementations( + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgCreateVestingAccount{}, &MsgCreatePermanentLockedAccount{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/authz/codec.go b/x/authz/codec.go index 2d1d095f4e7e..a82c67ce43e8 100644 --- a/x/authz/codec.go +++ b/x/authz/codec.go @@ -23,8 +23,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgGrant{}, &MsgRevoke{}, &MsgExec{}, @@ -34,12 +34,12 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { // and authz depends on x/bank and x/staking in other places, these registrations are placed here // to prevent a cyclic dependency. // see: https://github.com/cosmos/cosmos-sdk/pull/16509 - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.authz.v1beta1.Authorization", (*Authorization)(nil), &GenericAuthorization{}, &bank.SendAuthorization{}, &staking.StakeAuthorization{}, ) - msgservice.RegisterMsgServiceDesc(registry, MsgServiceDesc()) + msgservice.RegisterMsgServiceDesc(registrar, MsgServiceDesc()) } diff --git a/x/authz/module/module.go b/x/authz/module/module.go index 9eb34ac5fd06..a19447ba36c2 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -92,8 +92,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the authz module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - authz.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + authz.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the authz module. diff --git a/x/bank/module.go b/x/bank/module.go index 6390360f4b0f..d9db2b6abe96 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -80,8 +80,8 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/bank/types/codec.go b/x/bank/types/codec.go index 978d7d1baae7..eea6b27dbdcf 100644 --- a/x/bank/types/codec.go +++ b/x/bank/types/codec.go @@ -21,12 +21,12 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&Params{}, "cosmos-sdk/x/bank/Params", nil) } -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}, &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/circuit/module.go b/x/circuit/module.go index c33d1c69e8c8..5f14b29e4c8c 100644 --- a/x/circuit/module.go +++ b/x/circuit/module.go @@ -53,8 +53,8 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the circuit module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/circuit/types/codec.go b/x/circuit/types/codec.go index 41bab1a4d89d..0a7c6f415d89 100644 --- a/x/circuit/types/codec.go +++ b/x/circuit/types/codec.go @@ -8,11 +8,11 @@ import ( ) // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgAuthorizeCircuitBreaker{}, &MsgResetCircuitBreaker{}, &MsgTripCircuitBreaker{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/consensus/module.go b/x/consensus/module.go index c77502cc5ee3..adb87d404cd8 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -61,8 +61,8 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/consensus/types/codec.go b/x/consensus/types/codec.go index f9fa0a8f2a31..756ea4319f60 100644 --- a/x/consensus/types/codec.go +++ b/x/consensus/types/codec.go @@ -9,13 +9,13 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } // RegisterLegacyAminoCodec registers the necessary x/consensus interfaces and concrete types diff --git a/x/counter/module.go b/x/counter/module.go index 314db6ebefed..57340e44556b 100644 --- a/x/counter/module.go +++ b/x/counter/module.go @@ -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 registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } diff --git a/x/counter/types/codec.go b/x/counter/types/codec.go index 8776f0ff0dc3..d7b68a29feb9 100644 --- a/x/counter/types/codec.go +++ b/x/counter/types/codec.go @@ -7,11 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgIncreaseCounter{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/crisis/module.go b/x/crisis/module.go index ad7c10e6e894..807a276aca93 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -74,8 +74,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers interfaces and implementations of the crisis // module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // AddModuleInitFlags implements servertypes.ModuleInitFlags interface. diff --git a/x/crisis/types/codec.go b/x/crisis/types/codec.go index 10f9fa317995..039a0cb21d8e 100644 --- a/x/crisis/types/codec.go +++ b/x/crisis/types/codec.go @@ -17,11 +17,11 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgVerifyInvariant{}, &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/distribution/module.go b/x/distribution/module.go index 0d61ce1c47a1..eebf6ac2517d 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -92,8 +92,8 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces implements InterfaceModule -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterInvariants registers the distribution module invariants. diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 3d05793aad8e..0f47ec68a3e1 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -22,8 +22,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params", nil) } -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgWithdrawDelegatorReward{}, &MsgWithdrawValidatorCommission{}, @@ -32,5 +32,5 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &MsgDepositValidatorRewardsPool{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/evidence/module.go b/x/evidence/module.go index 54d0ded5353b..b78e0060a013 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -84,8 +84,8 @@ func (am AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers the evidence module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/evidence/types/codec.go b/x/evidence/types/codec.go index 15bb55568b3e..cb827d907419 100644 --- a/x/evidence/types/codec.go +++ b/x/evidence/types/codec.go @@ -19,13 +19,13 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitEvidence{}) - registry.RegisterInterface( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitEvidence{}) + registrar.RegisterInterface( "cosmos.evidence.v1beta1.Evidence", (*exported.Evidence)(nil), &Equivocation{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/feegrant/codec.go b/x/feegrant/codec.go index a840e9eaf738..09083ba23ed2 100644 --- a/x/feegrant/codec.go +++ b/x/feegrant/codec.go @@ -22,13 +22,13 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgGrantAllowance{}, &MsgRevokeAllowance{}, ) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.feegrant.v1beta1.FeeAllowanceI", (*FeeAllowanceI)(nil), &BasicAllowance{}, @@ -36,5 +36,5 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &AllowedMsgAllowance{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 4f4ce2f29da3..b02978dbd906 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -71,8 +71,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the feegrant module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - feegrant.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + feegrant.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the feegrant module. diff --git a/x/genutil/module.go b/x/genutil/module.go index a37b7f021d3e..069f2f67a45b 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -119,4 +119,4 @@ func (am AppModule) GenTxValidator() types.MessageValidator { func (AppModule) ConsensusVersion() uint64 { return 1 } // RegisterInterfaces implements module.AppModule. -func (AppModule) RegisterInterfaces(registry.LegacyRegistry) {} +func (AppModule) RegisterInterfaces(registry.InterfaceRegistrar) {} diff --git a/x/gov/module.go b/x/gov/module.go index d36627293a2c..6effa507b528 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -110,9 +110,9 @@ func getProposalCLIHandlers(handlers []govclient.ProposalHandler) []*cobra.Comma } // RegisterInterfaces implements InterfaceModule.RegisterInterfaces -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - v1.RegisterInterfaces(registry) - v1beta1.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + v1.RegisterInterfaces(registrar) + v1beta1.RegisterInterfaces(registrar) } // RegisterInvariants registers module invariants diff --git a/x/gov/types/v1/codec.go b/x/gov/types/v1/codec.go index 6a3b96cc97a7..33ea00178e1f 100644 --- a/x/gov/types/v1/codec.go +++ b/x/gov/types/v1/codec.go @@ -24,8 +24,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgSubmitMultipleChoiceProposal{}, &MsgVote{}, @@ -37,5 +37,5 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &MsgSudoExec{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index 9c6c4064c68f..37197b80aac3 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -21,18 +21,18 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, ) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.gov.v1beta1.Content", (*Content)(nil), &TextProposal{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/group/codec.go b/x/group/codec.go index 5c816ebebcc9..3cce8f4ed62c 100644 --- a/x/group/codec.go +++ b/x/group/codec.go @@ -34,8 +34,8 @@ func RegisterLegacyAminoCodec(cdc *codectypes.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateGroup{}, &MsgUpdateGroupMembers{}, &MsgUpdateGroupAdmin{}, @@ -52,9 +52,9 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &MsgLeaveGroup{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) - registry.RegisterInterface( + registrar.RegisterInterface( "cosmos.group.v1.DecisionPolicy", (*DecisionPolicy)(nil), &ThresholdDecisionPolicy{}, diff --git a/x/group/module/module.go b/x/group/module/module.go index 9a044274ec7c..92c7319b0fc0 100644 --- a/x/group/module/module.go +++ b/x/group/module/module.go @@ -83,8 +83,8 @@ func (am AppModule) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux * } // RegisterInterfaces registers the group module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - group.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + group.RegisterInterfaces(registrar) } // RegisterLegacyAminoCodec registers the group module's types for the given codec. diff --git a/x/mint/module.go b/x/mint/module.go index 49192c2230a8..ce3befee347f 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -82,8 +82,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the mint module. diff --git a/x/mint/types/codec.go b/x/mint/types/codec.go index 0f35aead639b..245733f2b053 100644 --- a/x/mint/types/codec.go +++ b/x/mint/types/codec.go @@ -16,11 +16,11 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/nft/codec.go b/x/nft/codec.go index c02cf391372c..e7c13ad7c90c 100644 --- a/x/nft/codec.go +++ b/x/nft/codec.go @@ -8,9 +8,9 @@ import ( ) // RegisterInterfaces registers the interfaces types with the interface registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 1c61a048f53d..7c662cec1229 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -71,8 +71,8 @@ func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { } // RegisterInterfaces registers the nft module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - nft.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + nft.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the nft module. diff --git a/x/params/module.go b/x/params/module.go index 6622e045a2e8..0ed3a514fb3c 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -64,8 +64,8 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - proposal.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + proposal.RegisterInterfaces(registrar) } // GenerateGenesisState performs a no-op. diff --git a/x/params/types/proposal/codec.go b/x/params/types/proposal/codec.go index 9b6c448349ec..78cbcb5c371d 100644 --- a/x/params/types/proposal/codec.go +++ b/x/params/types/proposal/codec.go @@ -12,8 +12,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal", nil) } -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*govtypes.Content)(nil), &ParameterChangeProposal{}, ) diff --git a/x/protocolpool/module.go b/x/protocolpool/module.go index c9683d2fa570..78b53339a215 100644 --- a/x/protocolpool/module.go +++ b/x/protocolpool/module.go @@ -70,8 +70,8 @@ func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwrunt } // RegisterInterfaces registers interfaces and implementations of the bank module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/protocolpool/types/codec.go b/x/protocolpool/types/codec.go index 71baad73ec06..7249c8a7193f 100644 --- a/x/protocolpool/types/codec.go +++ b/x/protocolpool/types/codec.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations( +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( (*sdk.Msg)(nil), &MsgFundCommunityPool{}, &MsgCommunityPoolSpend{}, @@ -19,5 +19,5 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &MsgWithdrawContinuousFund{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/slashing/module.go b/x/slashing/module.go index 1371ecdcee8e..dab442d3860d 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -82,8 +82,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashig module. diff --git a/x/slashing/types/codec.go b/x/slashing/types/codec.go index ed8838609b09..c852734a299a 100644 --- a/x/slashing/types/codec.go +++ b/x/slashing/types/codec.go @@ -17,11 +17,11 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgUnjail{}, &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/staking/module.go b/x/staking/module.go index 359b0beb83ac..0aead1899d38 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -81,8 +81,8 @@ func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the staking module. diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 7c019f3b5c3e..cbb527b980bd 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -29,8 +29,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the x/staking interfaces types with the interface registry -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateValidator{}, &MsgEditValidator{}, &MsgDelegate{}, @@ -40,5 +40,5 @@ func RegisterInterfaces(registry registry.LegacyRegistry) { &MsgUpdateParams{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 8f011f79449a..70e8bc0d3ee2 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -78,8 +78,8 @@ func (AppModule) GetTxCmd() *cobra.Command { } // RegisterInterfaces registers interfaces and implementations of the upgrade module. -func (AppModule) RegisterInterfaces(registry registry.LegacyRegistry) { - types.RegisterInterfaces(registry) +func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + types.RegisterInterfaces(registrar) } // RegisterServices registers module services. diff --git a/x/upgrade/types/codec.go b/x/upgrade/types/codec.go index 366bb3105b24..c29e42c6c5b1 100644 --- a/x/upgrade/types/codec.go +++ b/x/upgrade/types/codec.go @@ -19,11 +19,11 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the interfaces types with the Interface Registry. -func RegisterInterfaces(registry registry.LegacyRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), +func RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgSoftwareUpgrade{}, &MsgCancelUpgrade{}, ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) }