diff --git a/api/cosmos/app/v1alpha1/config.pulsar.go b/api/cosmos/app/v1alpha1/config.pulsar.go index e27c5b6bfbe9..7359179ac6ac 100644 --- a/api/cosmos/app/v1alpha1/config.pulsar.go +++ b/api/cosmos/app/v1alpha1/config.pulsar.go @@ -64,15 +64,68 @@ func (x *_Config_1_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Config_2_list)(nil) + +type _Config_2_list struct { + list *[]*GolangBinding +} + +func (x *_Config_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Config_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Config_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GolangBinding) + (*x.list)[i] = concreteValue +} + +func (x *_Config_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GolangBinding) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Config_2_list) AppendMutable() protoreflect.Value { + v := new(GolangBinding) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Config_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Config_2_list) NewElement() protoreflect.Value { + v := new(GolangBinding) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Config_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_Config protoreflect.MessageDescriptor - fd_Config_modules protoreflect.FieldDescriptor + md_Config protoreflect.MessageDescriptor + fd_Config_modules protoreflect.FieldDescriptor + fd_Config_golang_bindings protoreflect.FieldDescriptor ) func init() { file_cosmos_app_v1alpha1_config_proto_init() md_Config = File_cosmos_app_v1alpha1_config_proto.Messages().ByName("Config") fd_Config_modules = md_Config.Fields().ByName("modules") + fd_Config_golang_bindings = md_Config.Fields().ByName("golang_bindings") } var _ protoreflect.Message = (*fastReflection_Config)(nil) @@ -146,6 +199,12 @@ func (x *fastReflection_Config) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.GolangBindings) != 0 { + value := protoreflect.ValueOfList(&_Config_2_list{list: &x.GolangBindings}) + if !f(fd_Config_golang_bindings, value) { + return + } + } } // Has reports whether a field is populated. @@ -163,6 +222,8 @@ func (x *fastReflection_Config) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "cosmos.app.v1alpha1.Config.modules": return len(x.Modules) != 0 + case "cosmos.app.v1alpha1.Config.golang_bindings": + return len(x.GolangBindings) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -181,6 +242,8 @@ func (x *fastReflection_Config) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cosmos.app.v1alpha1.Config.modules": x.Modules = nil + case "cosmos.app.v1alpha1.Config.golang_bindings": + x.GolangBindings = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -203,6 +266,12 @@ func (x *fastReflection_Config) Get(descriptor protoreflect.FieldDescriptor) pro } listValue := &_Config_1_list{list: &x.Modules} return protoreflect.ValueOfList(listValue) + case "cosmos.app.v1alpha1.Config.golang_bindings": + if len(x.GolangBindings) == 0 { + return protoreflect.ValueOfList(&_Config_2_list{}) + } + listValue := &_Config_2_list{list: &x.GolangBindings} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -227,6 +296,10 @@ func (x *fastReflection_Config) Set(fd protoreflect.FieldDescriptor, value proto lv := value.List() clv := lv.(*_Config_1_list) x.Modules = *clv.list + case "cosmos.app.v1alpha1.Config.golang_bindings": + lv := value.List() + clv := lv.(*_Config_2_list) + x.GolangBindings = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -253,6 +326,12 @@ func (x *fastReflection_Config) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Config_1_list{list: &x.Modules} return protoreflect.ValueOfList(value) + case "cosmos.app.v1alpha1.Config.golang_bindings": + if x.GolangBindings == nil { + x.GolangBindings = []*GolangBinding{} + } + value := &_Config_2_list{list: &x.GolangBindings} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -269,6 +348,9 @@ func (x *fastReflection_Config) NewField(fd protoreflect.FieldDescriptor) protor case "cosmos.app.v1alpha1.Config.modules": list := []*ModuleConfig{} return protoreflect.ValueOfList(&_Config_1_list{list: &list}) + case "cosmos.app.v1alpha1.Config.golang_bindings": + list := []*GolangBinding{} + return protoreflect.ValueOfList(&_Config_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.Config")) @@ -344,6 +426,12 @@ func (x *fastReflection_Config) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.GolangBindings) > 0 { + for _, e := range x.GolangBindings { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -373,6 +461,22 @@ func (x *fastReflection_Config) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.GolangBindings) > 0 { + for iNdEx := len(x.GolangBindings) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.GolangBindings[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } if len(x.Modules) > 0 { for iNdEx := len(x.Modules) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Modules[iNdEx]) @@ -472,6 +576,40 @@ func (x *fastReflection_Config) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GolangBindings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GolangBindings = append(x.GolangBindings, &GolangBinding{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GolangBindings[len(x.GolangBindings)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -507,10 +645,62 @@ func (x *fastReflection_Config) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_ModuleConfig_3_list)(nil) + +type _ModuleConfig_3_list struct { + list *[]*GolangBinding +} + +func (x *_ModuleConfig_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ModuleConfig_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ModuleConfig_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GolangBinding) + (*x.list)[i] = concreteValue +} + +func (x *_ModuleConfig_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GolangBinding) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ModuleConfig_3_list) AppendMutable() protoreflect.Value { + v := new(GolangBinding) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ModuleConfig_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ModuleConfig_3_list) NewElement() protoreflect.Value { + v := new(GolangBinding) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ModuleConfig_3_list) IsValid() bool { + return x.list != nil +} + var ( - md_ModuleConfig protoreflect.MessageDescriptor - fd_ModuleConfig_name protoreflect.FieldDescriptor - fd_ModuleConfig_config protoreflect.FieldDescriptor + md_ModuleConfig protoreflect.MessageDescriptor + fd_ModuleConfig_name protoreflect.FieldDescriptor + fd_ModuleConfig_config protoreflect.FieldDescriptor + fd_ModuleConfig_golang_bindings protoreflect.FieldDescriptor ) func init() { @@ -518,6 +708,7 @@ func init() { md_ModuleConfig = File_cosmos_app_v1alpha1_config_proto.Messages().ByName("ModuleConfig") fd_ModuleConfig_name = md_ModuleConfig.Fields().ByName("name") fd_ModuleConfig_config = md_ModuleConfig.Fields().ByName("config") + fd_ModuleConfig_golang_bindings = md_ModuleConfig.Fields().ByName("golang_bindings") } var _ protoreflect.Message = (*fastReflection_ModuleConfig)(nil) @@ -597,6 +788,12 @@ func (x *fastReflection_ModuleConfig) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.GolangBindings) != 0 { + value := protoreflect.ValueOfList(&_ModuleConfig_3_list{list: &x.GolangBindings}) + if !f(fd_ModuleConfig_golang_bindings, value) { + return + } + } } // Has reports whether a field is populated. @@ -616,6 +813,8 @@ func (x *fastReflection_ModuleConfig) Has(fd protoreflect.FieldDescriptor) bool return x.Name != "" case "cosmos.app.v1alpha1.ModuleConfig.config": return x.Config != nil + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + return len(x.GolangBindings) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.ModuleConfig")) @@ -636,6 +835,8 @@ func (x *fastReflection_ModuleConfig) Clear(fd protoreflect.FieldDescriptor) { x.Name = "" case "cosmos.app.v1alpha1.ModuleConfig.config": x.Config = nil + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + x.GolangBindings = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.ModuleConfig")) @@ -658,6 +859,12 @@ func (x *fastReflection_ModuleConfig) Get(descriptor protoreflect.FieldDescripto case "cosmos.app.v1alpha1.ModuleConfig.config": value := x.Config return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + if len(x.GolangBindings) == 0 { + return protoreflect.ValueOfList(&_ModuleConfig_3_list{}) + } + listValue := &_ModuleConfig_3_list{list: &x.GolangBindings} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.ModuleConfig")) @@ -682,6 +889,10 @@ func (x *fastReflection_ModuleConfig) Set(fd protoreflect.FieldDescriptor, value x.Name = value.Interface().(string) case "cosmos.app.v1alpha1.ModuleConfig.config": x.Config = value.Message().Interface().(*anypb.Any) + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + lv := value.List() + clv := lv.(*_ModuleConfig_3_list) + x.GolangBindings = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.ModuleConfig")) @@ -707,6 +918,12 @@ func (x *fastReflection_ModuleConfig) Mutable(fd protoreflect.FieldDescriptor) p x.Config = new(anypb.Any) } return protoreflect.ValueOfMessage(x.Config.ProtoReflect()) + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + if x.GolangBindings == nil { + x.GolangBindings = []*GolangBinding{} + } + value := &_ModuleConfig_3_list{list: &x.GolangBindings} + return protoreflect.ValueOfList(value) case "cosmos.app.v1alpha1.ModuleConfig.name": panic(fmt.Errorf("field name of message cosmos.app.v1alpha1.ModuleConfig is not mutable")) default: @@ -727,6 +944,9 @@ func (x *fastReflection_ModuleConfig) NewField(fd protoreflect.FieldDescriptor) case "cosmos.app.v1alpha1.ModuleConfig.config": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.app.v1alpha1.ModuleConfig.golang_bindings": + list := []*GolangBinding{} + return protoreflect.ValueOfList(&_ModuleConfig_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.ModuleConfig")) @@ -804,6 +1024,12 @@ func (x *fastReflection_ModuleConfig) ProtoMethods() *protoiface.Methods { l = options.Size(x.Config) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.GolangBindings) > 0 { + for _, e := range x.GolangBindings { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -833,6 +1059,22 @@ func (x *fastReflection_ModuleConfig) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.GolangBindings) > 0 { + for iNdEx := len(x.GolangBindings) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.GolangBindings[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } if x.Config != nil { encoded, err := options.Marshal(x.Config) if err != nil { @@ -971,6 +1213,40 @@ func (x *fastReflection_ModuleConfig) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GolangBindings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GolangBindings = append(x.GolangBindings, &GolangBinding{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GolangBindings[len(x.GolangBindings)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1006,72 +1282,567 @@ func (x *fastReflection_ModuleConfig) ProtoMethods() *protoiface.Methods { } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/app/v1alpha1/config.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +var ( + md_GolangBinding protoreflect.MessageDescriptor + fd_GolangBinding_interface_type protoreflect.FieldDescriptor + fd_GolangBinding_implementation protoreflect.FieldDescriptor ) -// Config represents the configuration for a Cosmos SDK ABCI app. -// It is intended that all state machine logic including the version of -// baseapp and tx handlers (and possibly even Tendermint) that an app needs -// can be described in a config object. For compatibility, the framework should -// allow a mixture of declarative and imperative app wiring, however, apps -// that strive for the maximum ease of maintainability should be able to describe -// their state machine with a config object alone. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func init() { + file_cosmos_app_v1alpha1_config_proto_init() + md_GolangBinding = File_cosmos_app_v1alpha1_config_proto.Messages().ByName("GolangBinding") + fd_GolangBinding_interface_type = md_GolangBinding.Fields().ByName("interface_type") + fd_GolangBinding_implementation = md_GolangBinding.Fields().ByName("implementation") +} - // modules are the module configurations for the app. - Modules []*ModuleConfig `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"` +var _ protoreflect.Message = (*fastReflection_GolangBinding)(nil) + +type fastReflection_GolangBinding GolangBinding + +func (x *GolangBinding) ProtoReflect() protoreflect.Message { + return (*fastReflection_GolangBinding)(x) } -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_app_v1alpha1_config_proto_msgTypes[0] +func (x *GolangBinding) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_app_v1alpha1_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } + return mi.MessageOf(x) } -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) +var _fastReflection_GolangBinding_messageType fastReflection_GolangBinding_messageType +var _ protoreflect.MessageType = fastReflection_GolangBinding_messageType{} + +type fastReflection_GolangBinding_messageType struct{} + +func (x fastReflection_GolangBinding_messageType) Zero() protoreflect.Message { + return (*fastReflection_GolangBinding)(nil) +} +func (x fastReflection_GolangBinding_messageType) New() protoreflect.Message { + return new(fastReflection_GolangBinding) +} +func (x fastReflection_GolangBinding_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GolangBinding } -func (*Config) ProtoMessage() {} +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GolangBinding) Descriptor() protoreflect.MessageDescriptor { + return md_GolangBinding +} -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_cosmos_app_v1alpha1_config_proto_rawDescGZIP(), []int{0} +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GolangBinding) Type() protoreflect.MessageType { + return _fastReflection_GolangBinding_messageType } -func (x *Config) GetModules() []*ModuleConfig { - if x != nil { - return x.Modules - } - return nil +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GolangBinding) New() protoreflect.Message { + return new(fastReflection_GolangBinding) } -// ModuleConfig is a module configuration for an app. -type ModuleConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GolangBinding) Interface() protoreflect.ProtoMessage { + return (*GolangBinding)(x) +} - // name is the unique name of the module within the app. It should be a name - // that persists between different versions of a module so that modules - // can be smoothly upgraded to new versions. - // +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GolangBinding) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InterfaceType != "" { + value := protoreflect.ValueOfString(x.InterfaceType) + if !f(fd_GolangBinding_interface_type, value) { + return + } + } + if x.Implementation != "" { + value := protoreflect.ValueOfString(x.Implementation) + if !f(fd_GolangBinding_implementation, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GolangBinding) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + return x.InterfaceType != "" + case "cosmos.app.v1alpha1.GolangBinding.implementation": + return x.Implementation != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GolangBinding) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + x.InterfaceType = "" + case "cosmos.app.v1alpha1.GolangBinding.implementation": + x.Implementation = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GolangBinding) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + value := x.InterfaceType + return protoreflect.ValueOfString(value) + case "cosmos.app.v1alpha1.GolangBinding.implementation": + value := x.Implementation + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GolangBinding) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + x.InterfaceType = value.Interface().(string) + case "cosmos.app.v1alpha1.GolangBinding.implementation": + x.Implementation = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GolangBinding) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + panic(fmt.Errorf("field interface_type of message cosmos.app.v1alpha1.GolangBinding is not mutable")) + case "cosmos.app.v1alpha1.GolangBinding.implementation": + panic(fmt.Errorf("field implementation of message cosmos.app.v1alpha1.GolangBinding is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GolangBinding) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.app.v1alpha1.GolangBinding.interface_type": + return protoreflect.ValueOfString("") + case "cosmos.app.v1alpha1.GolangBinding.implementation": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.v1alpha1.GolangBinding")) + } + panic(fmt.Errorf("message cosmos.app.v1alpha1.GolangBinding does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GolangBinding) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.app.v1alpha1.GolangBinding", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GolangBinding) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GolangBinding) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GolangBinding) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GolangBinding) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GolangBinding) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.InterfaceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Implementation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GolangBinding) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Implementation) > 0 { + i -= len(x.Implementation) + copy(dAtA[i:], x.Implementation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Implementation))) + i-- + dAtA[i] = 0x12 + } + if len(x.InterfaceType) > 0 { + i -= len(x.InterfaceType) + copy(dAtA[i:], x.InterfaceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InterfaceType))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GolangBinding) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GolangBinding: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GolangBinding: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InterfaceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.InterfaceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Implementation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Implementation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/app/v1alpha1/config.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // modules are the module configurations for the app. + Modules []*ModuleConfig `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"` + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + GolangBindings []*GolangBinding `protobuf:"bytes,2,rep,name=golang_bindings,json=golangBindings,proto3" json:"golang_bindings,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_app_v1alpha1_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_cosmos_app_v1alpha1_config_proto_rawDescGZIP(), []int{0} +} + +func (x *Config) GetModules() []*ModuleConfig { + if x != nil { + return x.Modules + } + return nil +} + +func (x *Config) GetGolangBindings() []*GolangBinding { + if x != nil { + return x.GolangBindings + } + return nil +} + +// ModuleConfig is a module configuration for an app. +type ModuleConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // // For example, for the module cosmos.bank.module.v1.Module, we may chose // to simply name the module "bank" in the app. When we upgrade to // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same @@ -1079,9 +1850,13 @@ type ModuleConfig struct { // that the v1 module had. Note: modules should provide info on which versions // they can migrate from in the ModuleDescriptor.can_migration_from field. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // config is the config object for the module. Module config messages should + // config is the config object for the module. Module config messages shouldA // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. Config *anypb.Any `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + GolangBindings []*GolangBinding `protobuf:"bytes,3,rep,name=golang_bindings,json=golangBindings,proto3" json:"golang_bindings,omitempty"` } func (x *ModuleConfig) Reset() { @@ -1118,6 +1893,59 @@ func (x *ModuleConfig) GetConfig() *anypb.Any { return nil } +func (x *ModuleConfig) GetGolangBindings() []*GolangBinding { + if x != nil { + return x.GolangBindings + } + return nil +} + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +type GolangBinding struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // interface_type is the interface type which will be bound to a specific implementation type + InterfaceType string `protobuf:"bytes,1,opt,name=interface_type,json=interfaceType,proto3" json:"interface_type,omitempty"` + // implementation is the implementing type which will be supplied when an input of type interface is requested + Implementation string `protobuf:"bytes,2,opt,name=implementation,proto3" json:"implementation,omitempty"` +} + +func (x *GolangBinding) Reset() { + *x = GolangBinding{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_app_v1alpha1_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GolangBinding) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GolangBinding) ProtoMessage() {} + +// Deprecated: Use GolangBinding.ProtoReflect.Descriptor instead. +func (*GolangBinding) Descriptor() ([]byte, []int) { + return file_cosmos_app_v1alpha1_config_proto_rawDescGZIP(), []int{2} +} + +func (x *GolangBinding) GetInterfaceType() string { + if x != nil { + return x.InterfaceType + } + return "" +} + +func (x *GolangBinding) GetImplementation() string { + if x != nil { + return x.Implementation + } + return "" +} + var File_cosmos_app_v1alpha1_config_proto protoreflect.FileDescriptor var file_cosmos_app_v1alpha1_config_proto_rawDesc = []byte{ @@ -1126,29 +1954,45 @@ var file_cosmos_app_v1alpha1_config_proto_rawDesc = []byte{ 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x07, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, + 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x67, 0x6f, + 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x6f, 0x6c, 0x61, 0x6e, 0x67, + 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x42, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4b, 0x0a, 0x0f, 0x67, 0x6f, + 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x6f, 0x6c, 0x61, 0x6e, 0x67, + 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x42, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5e, 0x0a, 0x0d, 0x47, 0x6f, 0x6c, 0x61, 0x6e, + 0x67, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x26, 0x0a, 0x0e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xc6, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x50, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0xc6, 0x01, 0x0a, 0x17, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x70, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, - 0x70, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x61, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x70, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1163,20 +2007,23 @@ func file_cosmos_app_v1alpha1_config_proto_rawDescGZIP() []byte { return file_cosmos_app_v1alpha1_config_proto_rawDescData } -var file_cosmos_app_v1alpha1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_app_v1alpha1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_app_v1alpha1_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: cosmos.app.v1alpha1.Config - (*ModuleConfig)(nil), // 1: cosmos.app.v1alpha1.ModuleConfig - (*anypb.Any)(nil), // 2: google.protobuf.Any + (*Config)(nil), // 0: cosmos.app.v1alpha1.Config + (*ModuleConfig)(nil), // 1: cosmos.app.v1alpha1.ModuleConfig + (*GolangBinding)(nil), // 2: cosmos.app.v1alpha1.GolangBinding + (*anypb.Any)(nil), // 3: google.protobuf.Any } var file_cosmos_app_v1alpha1_config_proto_depIdxs = []int32{ 1, // 0: cosmos.app.v1alpha1.Config.modules:type_name -> cosmos.app.v1alpha1.ModuleConfig - 2, // 1: cosmos.app.v1alpha1.ModuleConfig.config:type_name -> google.protobuf.Any - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 2, // 1: cosmos.app.v1alpha1.Config.golang_bindings:type_name -> cosmos.app.v1alpha1.GolangBinding + 3, // 2: cosmos.app.v1alpha1.ModuleConfig.config:type_name -> google.protobuf.Any + 2, // 3: cosmos.app.v1alpha1.ModuleConfig.golang_bindings:type_name -> cosmos.app.v1alpha1.GolangBinding + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_app_v1alpha1_config_proto_init() } @@ -1209,6 +2056,18 @@ func file_cosmos_app_v1alpha1_config_proto_init() { return nil } } + file_cosmos_app_v1alpha1_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GolangBinding); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1216,7 +2075,7 @@ func file_cosmos_app_v1alpha1_config_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_app_v1alpha1_config_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/core/appconfig/config.go b/core/appconfig/config.go index c883e7117403..513c76440670 100644 --- a/core/appconfig/config.go +++ b/core/appconfig/config.go @@ -110,6 +110,14 @@ func Compose(appConfig *appv1alpha1.Config) depinject.Config { for _, invoker := range init.Invokers { opts = append(opts, depinject.InvokeInModule(module.Name, invoker)) } + + for _, binding := range module.GolangBindings { + opts = append(opts, depinject.BindInterfaceInModule(module.Name, binding.InterfaceType, binding.Implementation)) + } + } + + for _, binding := range appConfig.GolangBindings { + opts = append(opts, depinject.BindInterface(binding.InterfaceType, binding.Implementation)) } return depinject.Configs(opts...) diff --git a/core/appconfig/config_test.go b/core/appconfig/config_test.go index f48e5b74490a..d241be39a814 100644 --- a/core/appconfig/config_test.go +++ b/core/appconfig/config_test.go @@ -81,6 +81,24 @@ result: goodbye ` assert.Equal(t, expected, buf.String()) + opt = appconfig.LoadYAML([]byte(` +golang_bindings: + - interfaceType: interfaceType/package.name + implementation: implementationType/package.name + - interfaceType: interfaceType/package.nameTwo + implementation: implementationType/package.nameTwo +modules: + - name: a + config: + "@type": testpb.TestModuleA + golang_bindings: + - interfaceType: interfaceType/package.name + implementation: implementationType/package.name + - interfaceType: interfaceType/package.nameTwo + implementation: implementationType/package.nameTwo +`)) + assert.NilError(t, depinject.Inject(opt)) + // module registration failures: appmodule.Register(&testpb.TestNoModuleOptionModule{}) opt = appconfig.LoadYAML([]byte(` @@ -100,4 +118,5 @@ modules: "@type": testpb.TestNoGoImportModule `)) expectContainerErrorContains(t, opt, "module should have ModuleDescriptor.go_import specified") + } diff --git a/core/go.mod b/core/go.mod index bd74ecdc5dff..bb456cda6df5 100644 --- a/core/go.mod +++ b/core/go.mod @@ -21,12 +21,12 @@ require ( golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect golang.org/x/text v0.3.5 // indirect google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb // indirect - google.golang.org/grpc v1.46.2 // indirect + google.golang.org/grpc v1.47.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) replace ( - github.com/cosmos/cosmos-sdk/api => ../api + cosmossdk.io/api => ../api github.com/cosmos/cosmos-sdk/depinject => ../depinject ) diff --git a/core/go.sum b/core/go.sum index 185affe8386c..9f34a20f624e 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,9 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.1.0-alpha8 h1:Hr+8bLI4UphF+aMiDIVklrdzRm99dFaNq2inBKGDzNU= -cosmossdk.io/api v0.1.0-alpha8/go.mod h1:gIs3NW5OSNK5wKqxF8JHnGTL82QMsXpwGeKmu2i5xFA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -16,8 +15,11 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -29,6 +31,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -65,6 +68,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -145,8 +149,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -174,6 +178,7 @@ gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/proto/cosmos/app/v1alpha1/config.proto b/proto/cosmos/app/v1alpha1/config.proto index ed77500611aa..ee3e70659e4b 100644 --- a/proto/cosmos/app/v1alpha1/config.proto +++ b/proto/cosmos/app/v1alpha1/config.proto @@ -14,6 +14,11 @@ import "google/protobuf/any.proto"; message Config { // modules are the module configurations for the app. repeated ModuleConfig modules = 1; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + repeated GolangBinding golang_bindings = 2; } // ModuleConfig is a module configuration for an app. @@ -33,4 +38,18 @@ message ModuleConfig { // config is the config object for the module. Module config messages should // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. google.protobuf.Any config = 2; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + repeated GolangBinding golang_bindings = 3; } + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +message GolangBinding { + // interface_type is the interface type which will be bound to a specific implementation type + string interface_type = 1; + + // implementation is the implementing type which will be supplied when an input of type interface is requested + string implementation = 2; +} \ No newline at end of file