refactor: rename core.registry.LegacyRegistry -> core.registry.InterfaceRegistrar (#19758)
This commit is contained in:
parent
1b545a571f
commit
d54335e1f9
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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{},
|
||||
)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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())
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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) {}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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{},
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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{},
|
||||
)
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user