From b9ff5a61580ec93a34042171d37f8983e450a884 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Sat, 7 May 2022 10:47:49 -0400 Subject: [PATCH 1/6] feat: app wiring MVP --- api/cosmos/auth/module/v1/module.pulsar.go | 1336 +++++++++++++++++ api/cosmos/auth/v1beta1/query.pulsar.go | 24 +- api/cosmos/auth/v1beta1/query_grpc.pb.go | 16 +- api/cosmos/bank/module/v1/module.pulsar.go | 1243 +++++++++++++++ api/cosmos/base/runtime/v1/module.pulsar.go | 980 ++++++++++++ api/cosmos/genutil/module/v1.pulsar.go | 503 +++++++ api/cosmos/nft/module/v1/module.pulsar.go | 501 +++++++ api/cosmos/params/module/v1/module.pulsar.go | 503 +++++++ api/cosmos/staking/module/v1/module.pulsar.go | 503 +++++++ api/cosmos/upgrade/v1beta1/query_grpc.pb.go | 4 + baseapp/runtime/module.go | 175 +++ baseapp/runtime/runtime.go | 78 + container/container.go | 13 +- container/container_test.go | 6 +- container/debug.go | 21 +- core/appconfig/config.go | 109 ++ core/appconfig/config_test.go | 58 + core/appmodule/option.go | 34 + core/appmodule/register.go | 25 + core/go.mod | 32 + core/go.sum | 190 +++ core/internal/registry.go | 18 + go.mod | 10 + go.sum | 15 +- proto/cosmos/auth/module/v1/module.proto | 19 + proto/cosmos/bank/module/v1/module.proto | 18 + proto/cosmos/base/runtime/v1/module.proto | 16 + proto/cosmos/genutil/module/v1.proto | 11 + proto/cosmos/nft/module/v1/module.proto | 11 + proto/cosmos/params/module/v1/module.proto | 11 + proto/cosmos/staking/module/v1/module.proto | 11 + types/module/module.go | 8 + types/msgservice/msg.pb.go | 31 +- x/auth/module.go | 75 + x/auth/types/query.pb.go | 40 +- x/bank/module.go | 31 + x/genutil/module.go | 34 + x/nft/client/testutil/app.yaml | 33 + x/nft/client/testutil/cli_test.go | 33 +- x/nft/module/module.go | 57 +- x/params/module.go | 38 + x/staking/module.go | 28 + 42 files changed, 6859 insertions(+), 43 deletions(-) create mode 100644 api/cosmos/auth/module/v1/module.pulsar.go create mode 100644 api/cosmos/bank/module/v1/module.pulsar.go create mode 100644 api/cosmos/base/runtime/v1/module.pulsar.go create mode 100644 api/cosmos/genutil/module/v1.pulsar.go create mode 100644 api/cosmos/nft/module/v1/module.pulsar.go create mode 100644 api/cosmos/params/module/v1/module.pulsar.go create mode 100644 api/cosmos/staking/module/v1/module.pulsar.go create mode 100644 baseapp/runtime/module.go create mode 100644 baseapp/runtime/runtime.go create mode 100644 core/appconfig/config.go create mode 100644 core/appconfig/config_test.go create mode 100644 core/appmodule/option.go create mode 100644 core/appmodule/register.go create mode 100644 core/go.mod create mode 100644 core/go.sum create mode 100644 core/internal/registry.go create mode 100644 proto/cosmos/auth/module/v1/module.proto create mode 100644 proto/cosmos/bank/module/v1/module.proto create mode 100644 proto/cosmos/base/runtime/v1/module.proto create mode 100644 proto/cosmos/genutil/module/v1.proto create mode 100644 proto/cosmos/nft/module/v1/module.proto create mode 100644 proto/cosmos/params/module/v1/module.proto create mode 100644 proto/cosmos/staking/module/v1/module.proto create mode 100644 x/nft/client/testutil/app.yaml diff --git a/api/cosmos/auth/module/v1/module.pulsar.go b/api/cosmos/auth/module/v1/module.pulsar.go new file mode 100644 index 000000000000..337836eea484 --- /dev/null +++ b/api/cosmos/auth/module/v1/module.pulsar.go @@ -0,0 +1,1336 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Module_3_list)(nil) + +type _Module_3_list struct { + list *[]*ModuleAccountPermission +} + +func (x *_Module_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Module_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ModuleAccountPermission) + (*x.list)[i] = concreteValue +} + +func (x *_Module_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ModuleAccountPermission) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_3_list) AppendMutable() protoreflect.Value { + v := new(ModuleAccountPermission) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Module_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Module_3_list) NewElement() protoreflect.Value { + v := new(ModuleAccountPermission) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Module_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_bech32_prefix protoreflect.FieldDescriptor + fd_Module_module_account_permissions protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_module_v1_module_proto_init() + md_Module = File_cosmos_auth_module_v1_module_proto.Messages().ByName("Module") + fd_Module_bech32_prefix = md_Module.Fields().ByName("bech32_prefix") + fd_Module_module_account_permissions = md_Module.Fields().ByName("module_account_permissions") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bech32Prefix != "" { + value := protoreflect.ValueOfString(x.Bech32Prefix) + if !f(fd_Module_bech32_prefix, value) { + return + } + } + if len(x.ModuleAccountPermissions) != 0 { + value := protoreflect.ValueOfList(&_Module_3_list{list: &x.ModuleAccountPermissions}) + if !f(fd_Module_module_account_permissions, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.module.v1.Module.bech32_prefix": + return x.Bech32Prefix != "" + case "cosmos.auth.module.v1.Module.module_account_permissions": + return len(x.ModuleAccountPermissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.module.v1.Module.bech32_prefix": + x.Bech32Prefix = "" + case "cosmos.auth.module.v1.Module.module_account_permissions": + x.ModuleAccountPermissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.module.v1.Module.bech32_prefix": + value := x.Bech32Prefix + return protoreflect.ValueOfString(value) + case "cosmos.auth.module.v1.Module.module_account_permissions": + if len(x.ModuleAccountPermissions) == 0 { + return protoreflect.ValueOfList(&_Module_3_list{}) + } + listValue := &_Module_3_list{list: &x.ModuleAccountPermissions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.module.v1.Module.bech32_prefix": + x.Bech32Prefix = value.Interface().(string) + case "cosmos.auth.module.v1.Module.module_account_permissions": + lv := value.List() + clv := lv.(*_Module_3_list) + x.ModuleAccountPermissions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.module.v1.Module.module_account_permissions": + if x.ModuleAccountPermissions == nil { + x.ModuleAccountPermissions = []*ModuleAccountPermission{} + } + value := &_Module_3_list{list: &x.ModuleAccountPermissions} + return protoreflect.ValueOfList(value) + case "cosmos.auth.module.v1.Module.bech32_prefix": + panic(fmt.Errorf("field bech32_prefix of message cosmos.auth.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.module.v1.Module.bech32_prefix": + return protoreflect.ValueOfString("") + case "cosmos.auth.module.v1.Module.module_account_permissions": + list := []*ModuleAccountPermission{} + return protoreflect.ValueOfList(&_Module_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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.Bech32Prefix) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ModuleAccountPermissions) > 0 { + for _, e := range x.ModuleAccountPermissions { + l = options.Size(e) + 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().(*Module) + 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.ModuleAccountPermissions) > 0 { + for iNdEx := len(x.ModuleAccountPermissions) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ModuleAccountPermissions[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 len(x.Bech32Prefix) > 0 { + i -= len(x.Bech32Prefix) + copy(dAtA[i:], x.Bech32Prefix) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bech32Prefix))) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 Bech32Prefix", 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.Bech32Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ModuleAccountPermissions", 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.ModuleAccountPermissions = append(x.ModuleAccountPermissions, &ModuleAccountPermission{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ModuleAccountPermissions[len(x.ModuleAccountPermissions)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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, + } +} + +var _ protoreflect.List = (*_ModuleAccountPermission_2_list)(nil) + +type _ModuleAccountPermission_2_list struct { + list *[]string +} + +func (x *_ModuleAccountPermission_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ModuleAccountPermission_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_ModuleAccountPermission_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ModuleAccountPermission_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ModuleAccountPermission_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ModuleAccountPermission at list field Permissions as it is not of Message kind")) +} + +func (x *_ModuleAccountPermission_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ModuleAccountPermission_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_ModuleAccountPermission_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ModuleAccountPermission protoreflect.MessageDescriptor + fd_ModuleAccountPermission_account protoreflect.FieldDescriptor + fd_ModuleAccountPermission_permissions protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_module_v1_module_proto_init() + md_ModuleAccountPermission = File_cosmos_auth_module_v1_module_proto.Messages().ByName("ModuleAccountPermission") + fd_ModuleAccountPermission_account = md_ModuleAccountPermission.Fields().ByName("account") + fd_ModuleAccountPermission_permissions = md_ModuleAccountPermission.Fields().ByName("permissions") +} + +var _ protoreflect.Message = (*fastReflection_ModuleAccountPermission)(nil) + +type fastReflection_ModuleAccountPermission ModuleAccountPermission + +func (x *ModuleAccountPermission) ProtoReflect() protoreflect.Message { + return (*fastReflection_ModuleAccountPermission)(x) +} + +func (x *ModuleAccountPermission) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_module_v1_module_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ModuleAccountPermission_messageType fastReflection_ModuleAccountPermission_messageType +var _ protoreflect.MessageType = fastReflection_ModuleAccountPermission_messageType{} + +type fastReflection_ModuleAccountPermission_messageType struct{} + +func (x fastReflection_ModuleAccountPermission_messageType) Zero() protoreflect.Message { + return (*fastReflection_ModuleAccountPermission)(nil) +} +func (x fastReflection_ModuleAccountPermission_messageType) New() protoreflect.Message { + return new(fastReflection_ModuleAccountPermission) +} +func (x fastReflection_ModuleAccountPermission_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ModuleAccountPermission +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ModuleAccountPermission) Descriptor() protoreflect.MessageDescriptor { + return md_ModuleAccountPermission +} + +// 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_ModuleAccountPermission) Type() protoreflect.MessageType { + return _fastReflection_ModuleAccountPermission_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ModuleAccountPermission) New() protoreflect.Message { + return new(fastReflection_ModuleAccountPermission) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ModuleAccountPermission) Interface() protoreflect.ProtoMessage { + return (*ModuleAccountPermission)(x) +} + +// 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_ModuleAccountPermission) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Account != "" { + value := protoreflect.ValueOfString(x.Account) + if !f(fd_ModuleAccountPermission_account, value) { + return + } + } + if len(x.Permissions) != 0 { + value := protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{list: &x.Permissions}) + if !f(fd_ModuleAccountPermission_permissions, 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_ModuleAccountPermission) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + return x.Account != "" + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + return len(x.Permissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + x.Account = "" + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + x.Permissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + value := x.Account + return protoreflect.ValueOfString(value) + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + if len(x.Permissions) == 0 { + return protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{}) + } + listValue := &_ModuleAccountPermission_2_list{list: &x.Permissions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + x.Account = value.Interface().(string) + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + lv := value.List() + clv := lv.(*_ModuleAccountPermission_2_list) + x.Permissions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + if x.Permissions == nil { + x.Permissions = []string{} + } + value := &_ModuleAccountPermission_2_list{list: &x.Permissions} + return protoreflect.ValueOfList(value) + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + panic(fmt.Errorf("field account of message cosmos.auth.module.v1.ModuleAccountPermission is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.module.v1.ModuleAccountPermission.account": + return protoreflect.ValueOfString("") + case "cosmos.auth.module.v1.ModuleAccountPermission.permissions": + list := []string{} + return protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.auth.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.module.v1.ModuleAccountPermission", 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_ModuleAccountPermission) 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_ModuleAccountPermission) 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_ModuleAccountPermission) 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_ModuleAccountPermission) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ModuleAccountPermission) + 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.Account) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Permissions) > 0 { + for _, s := range x.Permissions { + l = len(s) + 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().(*ModuleAccountPermission) + 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.Permissions) > 0 { + for iNdEx := len(x.Permissions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Permissions[iNdEx]) + copy(dAtA[i:], x.Permissions[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Permissions[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Account) > 0 { + i -= len(x.Account) + copy(dAtA[i:], x.Account) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account))) + 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().(*ModuleAccountPermission) + 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: ModuleAccountPermission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ModuleAccountPermission: 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 Account", 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.Account = 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 Permissions", 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.Permissions = append(x.Permissions, 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/auth/module/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bech32Prefix string `protobuf:"bytes,1,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` + ModuleAccountPermissions []*ModuleAccountPermission `protobuf:"bytes,3,rep,name=module_account_permissions,json=moduleAccountPermissions,proto3" json:"module_account_permissions,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_auth_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetBech32Prefix() string { + if x != nil { + return x.Bech32Prefix + } + return "" +} + +func (x *Module) GetModuleAccountPermissions() []*ModuleAccountPermission { + if x != nil { + return x.ModuleAccountPermissions + } + return nil +} + +type ModuleAccountPermission struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (x *ModuleAccountPermission) Reset() { + *x = ModuleAccountPermission{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_module_v1_module_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModuleAccountPermission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModuleAccountPermission) ProtoMessage() {} + +// Deprecated: Use ModuleAccountPermission.ProtoReflect.Descriptor instead. +func (*ModuleAccountPermission) Descriptor() ([]byte, []int) { + return file_cosmos_auth_module_v1_module_proto_rawDescGZIP(), []int{1} +} + +func (x *ModuleAccountPermission) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *ModuleAccountPermission) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +var File_cosmos_auth_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_auth_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x01, + 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x65, 0x63, 0x68, + 0x33, 0x32, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x6c, 0x0a, + 0x1a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x18, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x2b, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x78, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x22, 0x55, 0x0a, 0x17, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, + 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, + 0xe0, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x41, 0x4d, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, + 0x68, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, + 0x68, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_auth_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_auth_module_v1_module_proto_rawDescData = file_cosmos_auth_module_v1_module_proto_rawDesc +) + +func file_cosmos_auth_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_auth_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_auth_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_auth_module_v1_module_proto_rawDescData) + }) + return file_cosmos_auth_module_v1_module_proto_rawDescData +} + +var file_cosmos_auth_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_auth_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.auth.module.v1.Module + (*ModuleAccountPermission)(nil), // 1: cosmos.auth.module.v1.ModuleAccountPermission +} +var file_cosmos_auth_module_v1_module_proto_depIdxs = []int32{ + 1, // 0: cosmos.auth.module.v1.Module.module_account_permissions:type_name -> cosmos.auth.module.v1.ModuleAccountPermission + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_auth_module_v1_module_proto_init() } +func file_cosmos_auth_module_v1_module_proto_init() { + if File_cosmos_auth_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_auth_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_module_v1_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModuleAccountPermission); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_auth_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_auth_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_auth_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_auth_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_auth_module_v1_module_proto = out.File + file_cosmos_auth_module_v1_module_proto_rawDesc = nil + file_cosmos_auth_module_v1_module_proto_goTypes = nil + file_cosmos_auth_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/auth/v1beta1/query.pulsar.go b/api/cosmos/auth/v1beta1/query.pulsar.go index 38d7bed61743..848c27850177 100644 --- a/api/cosmos/auth/v1beta1/query.pulsar.go +++ b/api/cosmos/auth/v1beta1/query.pulsar.go @@ -6282,7 +6282,9 @@ func (x *QueryModuleAccountsResponse) GetAccounts() []*anypb.Any { return nil } -// Bech32PrefixRequest is the request type for Bech32Prefix rpc method +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 type Bech32PrefixRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6309,7 +6311,9 @@ func (*Bech32PrefixRequest) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{8} } -// Bech32PrefixResponse is the response type for Bech32Prefix rpc method +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 type Bech32PrefixResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6345,7 +6349,9 @@ func (x *Bech32PrefixResponse) GetBech32Prefix() string { return "" } -// AddressBytesToStringRequest is the request type for AddressString rpc method +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 type AddressBytesToStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6381,7 +6387,9 @@ func (x *AddressBytesToStringRequest) GetAddressBytes() []byte { return nil } -// AddressBytesToStringResponse is the response type for AddressString rpc method +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 type AddressBytesToStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6417,7 +6425,9 @@ func (x *AddressBytesToStringResponse) GetAddressString() string { return "" } -// AddressStringToBytesRequest is the request type for AccountBytes rpc method +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 type AddressStringToBytesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6453,7 +6463,9 @@ func (x *AddressStringToBytesRequest) GetAddressString() string { return "" } -// AddressStringToBytesResponse is the response type for AddressBytes rpc method +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 type AddressStringToBytesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/auth/v1beta1/query_grpc.pb.go b/api/cosmos/auth/v1beta1/query_grpc.pb.go index 842ee3392559..a14fc7899473 100644 --- a/api/cosmos/auth/v1beta1/query_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/query_grpc.pb.go @@ -32,11 +32,17 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) - // Bech32 queries bech32Prefix + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) } @@ -125,11 +131,17 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. ModuleAccounts(context.Context, *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) - // Bech32 queries bech32Prefix + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 Bech32Prefix(context.Context, *Bech32PrefixRequest) (*Bech32PrefixResponse, error) // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 AddressBytesToString(context.Context, *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 AddressStringToBytes(context.Context, *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/cosmos/bank/module/v1/module.pulsar.go b/api/cosmos/bank/module/v1/module.pulsar.go new file mode 100644 index 000000000000..d89712fdcbac --- /dev/null +++ b/api/cosmos/bank/module/v1/module.pulsar.go @@ -0,0 +1,1243 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Module_1_list)(nil) + +type _Module_1_list struct { + list *[]string +} + +func (x *_Module_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field BlockedAddresses as it is not of Message kind")) +} + +func (x *_Module_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_blocked_addresses protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_module_v1_module_proto_init() + md_Module = File_cosmos_bank_module_v1_module_proto.Messages().ByName("Module") + fd_Module_blocked_addresses = md_Module.Fields().ByName("blocked_addresses") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.BlockedAddresses) != 0 { + value := protoreflect.ValueOfList(&_Module_1_list{list: &x.BlockedAddresses}) + if !f(fd_Module_blocked_addresses, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + return len(x.BlockedAddresses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + x.BlockedAddresses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + if len(x.BlockedAddresses) == 0 { + return protoreflect.ValueOfList(&_Module_1_list{}) + } + listValue := &_Module_1_list{list: &x.BlockedAddresses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + lv := value.List() + clv := lv.(*_Module_1_list) + x.BlockedAddresses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + if x.BlockedAddresses == nil { + x.BlockedAddresses = []string{} + } + value := &_Module_1_list{list: &x.BlockedAddresses} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.module.v1.Module.blocked_addresses": + list := []string{} + return protoreflect.ValueOfList(&_Module_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.BlockedAddresses) > 0 { + for _, s := range x.BlockedAddresses { + l = len(s) + 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().(*Module) + 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.BlockedAddresses) > 0 { + for iNdEx := len(x.BlockedAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.BlockedAddresses[iNdEx]) + copy(dAtA[i:], x.BlockedAddresses[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BlockedAddresses[iNdEx]))) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 BlockedAddresses", 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.BlockedAddresses = append(x.BlockedAddresses, 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, + } +} + +var _ protoreflect.List = (*_ModuleAccountPermission_2_list)(nil) + +type _ModuleAccountPermission_2_list struct { + list *[]string +} + +func (x *_ModuleAccountPermission_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ModuleAccountPermission_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_ModuleAccountPermission_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ModuleAccountPermission_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ModuleAccountPermission_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ModuleAccountPermission at list field Permissions as it is not of Message kind")) +} + +func (x *_ModuleAccountPermission_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ModuleAccountPermission_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_ModuleAccountPermission_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ModuleAccountPermission protoreflect.MessageDescriptor + fd_ModuleAccountPermission_module protoreflect.FieldDescriptor + fd_ModuleAccountPermission_permissions protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_module_v1_module_proto_init() + md_ModuleAccountPermission = File_cosmos_bank_module_v1_module_proto.Messages().ByName("ModuleAccountPermission") + fd_ModuleAccountPermission_module = md_ModuleAccountPermission.Fields().ByName("module") + fd_ModuleAccountPermission_permissions = md_ModuleAccountPermission.Fields().ByName("permissions") +} + +var _ protoreflect.Message = (*fastReflection_ModuleAccountPermission)(nil) + +type fastReflection_ModuleAccountPermission ModuleAccountPermission + +func (x *ModuleAccountPermission) ProtoReflect() protoreflect.Message { + return (*fastReflection_ModuleAccountPermission)(x) +} + +func (x *ModuleAccountPermission) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_module_v1_module_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ModuleAccountPermission_messageType fastReflection_ModuleAccountPermission_messageType +var _ protoreflect.MessageType = fastReflection_ModuleAccountPermission_messageType{} + +type fastReflection_ModuleAccountPermission_messageType struct{} + +func (x fastReflection_ModuleAccountPermission_messageType) Zero() protoreflect.Message { + return (*fastReflection_ModuleAccountPermission)(nil) +} +func (x fastReflection_ModuleAccountPermission_messageType) New() protoreflect.Message { + return new(fastReflection_ModuleAccountPermission) +} +func (x fastReflection_ModuleAccountPermission_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ModuleAccountPermission +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ModuleAccountPermission) Descriptor() protoreflect.MessageDescriptor { + return md_ModuleAccountPermission +} + +// 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_ModuleAccountPermission) Type() protoreflect.MessageType { + return _fastReflection_ModuleAccountPermission_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ModuleAccountPermission) New() protoreflect.Message { + return new(fastReflection_ModuleAccountPermission) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ModuleAccountPermission) Interface() protoreflect.ProtoMessage { + return (*ModuleAccountPermission)(x) +} + +// 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_ModuleAccountPermission) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Module != "" { + value := protoreflect.ValueOfString(x.Module) + if !f(fd_ModuleAccountPermission_module, value) { + return + } + } + if len(x.Permissions) != 0 { + value := protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{list: &x.Permissions}) + if !f(fd_ModuleAccountPermission_permissions, 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_ModuleAccountPermission) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + return x.Module != "" + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + return len(x.Permissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + x.Module = "" + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + x.Permissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + value := x.Module + return protoreflect.ValueOfString(value) + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + if len(x.Permissions) == 0 { + return protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{}) + } + listValue := &_ModuleAccountPermission_2_list{list: &x.Permissions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + x.Module = value.Interface().(string) + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + lv := value.List() + clv := lv.(*_ModuleAccountPermission_2_list) + x.Permissions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + if x.Permissions == nil { + x.Permissions = []string{} + } + value := &_ModuleAccountPermission_2_list{list: &x.Permissions} + return protoreflect.ValueOfList(value) + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + panic(fmt.Errorf("field module of message cosmos.bank.module.v1.ModuleAccountPermission is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.module.v1.ModuleAccountPermission.module": + return protoreflect.ValueOfString("") + case "cosmos.bank.module.v1.ModuleAccountPermission.permissions": + list := []string{} + return protoreflect.ValueOfList(&_ModuleAccountPermission_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.ModuleAccountPermission")) + } + panic(fmt.Errorf("message cosmos.bank.module.v1.ModuleAccountPermission 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_ModuleAccountPermission) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.module.v1.ModuleAccountPermission", 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_ModuleAccountPermission) 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_ModuleAccountPermission) 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_ModuleAccountPermission) 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_ModuleAccountPermission) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ModuleAccountPermission) + 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.Module) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Permissions) > 0 { + for _, s := range x.Permissions { + l = len(s) + 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().(*ModuleAccountPermission) + 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.Permissions) > 0 { + for iNdEx := len(x.Permissions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Permissions[iNdEx]) + copy(dAtA[i:], x.Permissions[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Permissions[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Module) > 0 { + i -= len(x.Module) + copy(dAtA[i:], x.Module) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Module))) + 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().(*ModuleAccountPermission) + 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: ModuleAccountPermission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ModuleAccountPermission: 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 Module", 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.Module = 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 Permissions", 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.Permissions = append(x.Permissions, 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/bank/module/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockedAddresses []string `protobuf:"bytes,1,rep,name=blocked_addresses,json=blockedAddresses,proto3" json:"blocked_addresses,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_bank_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetBlockedAddresses() []string { + if x != nil { + return x.BlockedAddresses + } + return nil +} + +type ModuleAccountPermission struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (x *ModuleAccountPermission) Reset() { + *x = ModuleAccountPermission{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_module_v1_module_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModuleAccountPermission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModuleAccountPermission) ProtoMessage() {} + +// Deprecated: Use ModuleAccountPermission.ProtoReflect.Descriptor instead. +func (*ModuleAccountPermission) Descriptor() ([]byte, []int) { + return file_cosmos_bank_module_v1_module_proto_rawDescGZIP(), []int{1} +} + +func (x *ModuleAccountPermission) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *ModuleAccountPermission) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +var File_cosmos_bank_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x62, 0x0a, + 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x3a, 0x2b, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, + 0x6b, 0x22, 0x53, 0x0a, 0x17, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xe0, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, + 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, + 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_bank_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_bank_module_v1_module_proto_rawDescData = file_cosmos_bank_module_v1_module_proto_rawDesc +) + +func file_cosmos_bank_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_bank_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_bank_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_bank_module_v1_module_proto_rawDescData) + }) + return file_cosmos_bank_module_v1_module_proto_rawDescData +} + +var file_cosmos_bank_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_bank_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.bank.module.v1.Module + (*ModuleAccountPermission)(nil), // 1: cosmos.bank.module.v1.ModuleAccountPermission +} +var file_cosmos_bank_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_bank_module_v1_module_proto_init() } +func file_cosmos_bank_module_v1_module_proto_init() { + if File_cosmos_bank_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_bank_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_module_v1_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModuleAccountPermission); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_bank_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_bank_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_bank_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_bank_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_bank_module_v1_module_proto = out.File + file_cosmos_bank_module_v1_module_proto_rawDesc = nil + file_cosmos_bank_module_v1_module_proto_goTypes = nil + file_cosmos_bank_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/base/runtime/v1/module.pulsar.go b/api/cosmos/base/runtime/v1/module.pulsar.go new file mode 100644 index 000000000000..a0b59fc18d0c --- /dev/null +++ b/api/cosmos/base/runtime/v1/module.pulsar.go @@ -0,0 +1,980 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package runtimev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Module_2_list)(nil) + +type _Module_2_list struct { + list *[]string +} + +func (x *_Module_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field BeginBlockers as it is not of Message kind")) +} + +func (x *_Module_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Module_3_list)(nil) + +type _Module_3_list struct { + list *[]string +} + +func (x *_Module_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field EndBlockers as it is not of Message kind")) +} + +func (x *_Module_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Module_4_list)(nil) + +type _Module_4_list struct { + list *[]string +} + +func (x *_Module_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field InitGenesis as it is not of Message kind")) +} + +func (x *_Module_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_app_name protoreflect.FieldDescriptor + fd_Module_begin_blockers protoreflect.FieldDescriptor + fd_Module_end_blockers protoreflect.FieldDescriptor + fd_Module_init_genesis protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_runtime_v1_module_proto_init() + md_Module = File_cosmos_base_runtime_v1_module_proto.Messages().ByName("Module") + fd_Module_app_name = md_Module.Fields().ByName("app_name") + fd_Module_begin_blockers = md_Module.Fields().ByName("begin_blockers") + fd_Module_end_blockers = md_Module.Fields().ByName("end_blockers") + fd_Module_init_genesis = md_Module.Fields().ByName("init_genesis") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_runtime_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AppName != "" { + value := protoreflect.ValueOfString(x.AppName) + if !f(fd_Module_app_name, value) { + return + } + } + if len(x.BeginBlockers) != 0 { + value := protoreflect.ValueOfList(&_Module_2_list{list: &x.BeginBlockers}) + if !f(fd_Module_begin_blockers, value) { + return + } + } + if len(x.EndBlockers) != 0 { + value := protoreflect.ValueOfList(&_Module_3_list{list: &x.EndBlockers}) + if !f(fd_Module_end_blockers, value) { + return + } + } + if len(x.InitGenesis) != 0 { + value := protoreflect.ValueOfList(&_Module_4_list{list: &x.InitGenesis}) + if !f(fd_Module_init_genesis, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.runtime.v1.Module.app_name": + return x.AppName != "" + case "cosmos.base.runtime.v1.Module.begin_blockers": + return len(x.BeginBlockers) != 0 + case "cosmos.base.runtime.v1.Module.end_blockers": + return len(x.EndBlockers) != 0 + case "cosmos.base.runtime.v1.Module.init_genesis": + return len(x.InitGenesis) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.runtime.v1.Module.app_name": + x.AppName = "" + case "cosmos.base.runtime.v1.Module.begin_blockers": + x.BeginBlockers = nil + case "cosmos.base.runtime.v1.Module.end_blockers": + x.EndBlockers = nil + case "cosmos.base.runtime.v1.Module.init_genesis": + x.InitGenesis = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.runtime.v1.Module.app_name": + value := x.AppName + return protoreflect.ValueOfString(value) + case "cosmos.base.runtime.v1.Module.begin_blockers": + if len(x.BeginBlockers) == 0 { + return protoreflect.ValueOfList(&_Module_2_list{}) + } + listValue := &_Module_2_list{list: &x.BeginBlockers} + return protoreflect.ValueOfList(listValue) + case "cosmos.base.runtime.v1.Module.end_blockers": + if len(x.EndBlockers) == 0 { + return protoreflect.ValueOfList(&_Module_3_list{}) + } + listValue := &_Module_3_list{list: &x.EndBlockers} + return protoreflect.ValueOfList(listValue) + case "cosmos.base.runtime.v1.Module.init_genesis": + if len(x.InitGenesis) == 0 { + return protoreflect.ValueOfList(&_Module_4_list{}) + } + listValue := &_Module_4_list{list: &x.InitGenesis} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.runtime.v1.Module.app_name": + x.AppName = value.Interface().(string) + case "cosmos.base.runtime.v1.Module.begin_blockers": + lv := value.List() + clv := lv.(*_Module_2_list) + x.BeginBlockers = *clv.list + case "cosmos.base.runtime.v1.Module.end_blockers": + lv := value.List() + clv := lv.(*_Module_3_list) + x.EndBlockers = *clv.list + case "cosmos.base.runtime.v1.Module.init_genesis": + lv := value.List() + clv := lv.(*_Module_4_list) + x.InitGenesis = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.runtime.v1.Module.begin_blockers": + if x.BeginBlockers == nil { + x.BeginBlockers = []string{} + } + value := &_Module_2_list{list: &x.BeginBlockers} + return protoreflect.ValueOfList(value) + case "cosmos.base.runtime.v1.Module.end_blockers": + if x.EndBlockers == nil { + x.EndBlockers = []string{} + } + value := &_Module_3_list{list: &x.EndBlockers} + return protoreflect.ValueOfList(value) + case "cosmos.base.runtime.v1.Module.init_genesis": + if x.InitGenesis == nil { + x.InitGenesis = []string{} + } + value := &_Module_4_list{list: &x.InitGenesis} + return protoreflect.ValueOfList(value) + case "cosmos.base.runtime.v1.Module.app_name": + panic(fmt.Errorf("field app_name of message cosmos.base.runtime.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.runtime.v1.Module.app_name": + return protoreflect.ValueOfString("") + case "cosmos.base.runtime.v1.Module.begin_blockers": + list := []string{} + return protoreflect.ValueOfList(&_Module_2_list{list: &list}) + case "cosmos.base.runtime.v1.Module.end_blockers": + list := []string{} + return protoreflect.ValueOfList(&_Module_3_list{list: &list}) + case "cosmos.base.runtime.v1.Module.init_genesis": + list := []string{} + return protoreflect.ValueOfList(&_Module_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + } + panic(fmt.Errorf("message cosmos.base.runtime.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.runtime.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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.AppName) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.BeginBlockers) > 0 { + for _, s := range x.BeginBlockers { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.EndBlockers) > 0 { + for _, s := range x.EndBlockers { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.InitGenesis) > 0 { + for _, s := range x.InitGenesis { + l = len(s) + 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().(*Module) + 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.InitGenesis) > 0 { + for iNdEx := len(x.InitGenesis) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.InitGenesis[iNdEx]) + copy(dAtA[i:], x.InitGenesis[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InitGenesis[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.EndBlockers) > 0 { + for iNdEx := len(x.EndBlockers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.EndBlockers[iNdEx]) + copy(dAtA[i:], x.EndBlockers[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EndBlockers[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.BeginBlockers) > 0 { + for iNdEx := len(x.BeginBlockers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.BeginBlockers[iNdEx]) + copy(dAtA[i:], x.BeginBlockers[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BeginBlockers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.AppName) > 0 { + i -= len(x.AppName) + copy(dAtA[i:], x.AppName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppName))) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 AppName", 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.AppName = 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 BeginBlockers", 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.BeginBlockers = append(x.BeginBlockers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndBlockers", 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.EndBlockers = append(x.EndBlockers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitGenesis", 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.InitGenesis = append(x.InitGenesis, 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/base/runtime/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppName string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` + BeginBlockers []string `protobuf:"bytes,2,rep,name=begin_blockers,json=beginBlockers,proto3" json:"begin_blockers,omitempty"` + EndBlockers []string `protobuf:"bytes,3,rep,name=end_blockers,json=endBlockers,proto3" json:"end_blockers,omitempty"` + InitGenesis []string `protobuf:"bytes,4,rep,name=init_genesis,json=initGenesis,proto3" json:"init_genesis,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_runtime_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_base_runtime_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAppName() string { + if x != nil { + return x.AppName + } + return "" +} + +func (x *Module) GetBeginBlockers() []string { + if x != nil { + return x.BeginBlockers + } + return nil +} + +func (x *Module) GetEndBlockers() []string { + if x != nil { + return x.EndBlockers + } + return nil +} + +func (x *Module) GetInitGenesis() []string { + if x != nil { + return x.InitGenesis + } + return nil +} + +var File_cosmos_base_runtime_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_base_runtime_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xc6, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, + 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, + 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x62, + 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x61, 0x70, 0x70, + 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0xe7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x52, 0xaa, + 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, + 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, + 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_base_runtime_v1_module_proto_rawDescOnce sync.Once + file_cosmos_base_runtime_v1_module_proto_rawDescData = file_cosmos_base_runtime_v1_module_proto_rawDesc +) + +func file_cosmos_base_runtime_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_base_runtime_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_base_runtime_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_base_runtime_v1_module_proto_rawDescData) + }) + return file_cosmos_base_runtime_v1_module_proto_rawDescData +} + +var file_cosmos_base_runtime_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_base_runtime_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.base.runtime.v1.Module +} +var file_cosmos_base_runtime_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_base_runtime_v1_module_proto_init() } +func file_cosmos_base_runtime_v1_module_proto_init() { + if File_cosmos_base_runtime_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_base_runtime_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_base_runtime_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_base_runtime_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_base_runtime_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_base_runtime_v1_module_proto_msgTypes, + }.Build() + File_cosmos_base_runtime_v1_module_proto = out.File + file_cosmos_base_runtime_v1_module_proto_rawDesc = nil + file_cosmos_base_runtime_v1_module_proto_goTypes = nil + file_cosmos_base_runtime_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/genutil/module/v1.pulsar.go b/api/cosmos/genutil/module/v1.pulsar.go new file mode 100644 index 000000000000..f90941d6ec64 --- /dev/null +++ b/api/cosmos/genutil/module/v1.pulsar.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_genutil_module_v1_proto_init() + md_Module = File_cosmos_genutil_module_v1_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_genutil_module_v1_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.genutil.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.genutil.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.genutil.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = 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().(*Module) + 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 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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/genutil/module/v1.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_genutil_module_v1_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_genutil_module_v1_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_genutil_module_v1_proto protoreflect.FileDescriptor + +var file_cosmos_genutil_module_v1_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x06, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x61, 0x73, + 0x65, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0xeb, 0x01, 0x0a, + 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x65, 0x6e, 0x75, + 0x74, 0x69, 0x6c, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x56, + 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x4d, 0xaa, + 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, + 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, + 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x65, 0x6e, 0x75, 0x74, 0x69, 0x6c, 0x3a, 0x3a, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_cosmos_genutil_module_v1_proto_rawDescOnce sync.Once + file_cosmos_genutil_module_v1_proto_rawDescData = file_cosmos_genutil_module_v1_proto_rawDesc +) + +func file_cosmos_genutil_module_v1_proto_rawDescGZIP() []byte { + file_cosmos_genutil_module_v1_proto_rawDescOnce.Do(func() { + file_cosmos_genutil_module_v1_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_genutil_module_v1_proto_rawDescData) + }) + return file_cosmos_genutil_module_v1_proto_rawDescData +} + +var file_cosmos_genutil_module_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_genutil_module_v1_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.genutil.module.v1.Module +} +var file_cosmos_genutil_module_v1_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_genutil_module_v1_proto_init() } +func file_cosmos_genutil_module_v1_proto_init() { + if File_cosmos_genutil_module_v1_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_genutil_module_v1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_genutil_module_v1_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_genutil_module_v1_proto_goTypes, + DependencyIndexes: file_cosmos_genutil_module_v1_proto_depIdxs, + MessageInfos: file_cosmos_genutil_module_v1_proto_msgTypes, + }.Build() + File_cosmos_genutil_module_v1_proto = out.File + file_cosmos_genutil_module_v1_proto_rawDesc = nil + file_cosmos_genutil_module_v1_proto_goTypes = nil + file_cosmos_genutil_module_v1_proto_depIdxs = nil +} diff --git a/api/cosmos/nft/module/v1/module.pulsar.go b/api/cosmos/nft/module/v1/module.pulsar.go new file mode 100644 index 000000000000..e645a6f3fbd4 --- /dev/null +++ b/api/cosmos/nft/module/v1/module.pulsar.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_nft_module_v1_module_proto_init() + md_Module = File_cosmos_nft_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_nft_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.nft.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.nft.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.nft.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = 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().(*Module) + 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 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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/nft/module/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_nft_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_nft_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_nft_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_nft_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6e, 0x66, 0x74, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x06, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x61, 0x73, 0x65, + 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0xda, 0x01, 0x0a, 0x18, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4e, 0x4d, 0xaa, 0x02, 0x14, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4e, 0x66, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4e, 0x66, + 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4e, 0x66, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4e, 0x66, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_nft_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_nft_module_v1_module_proto_rawDescData = file_cosmos_nft_module_v1_module_proto_rawDesc +) + +func file_cosmos_nft_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_nft_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_nft_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_nft_module_v1_module_proto_rawDescData) + }) + return file_cosmos_nft_module_v1_module_proto_rawDescData +} + +var file_cosmos_nft_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_nft_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.nft.module.v1.Module +} +var file_cosmos_nft_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_nft_module_v1_module_proto_init() } +func file_cosmos_nft_module_v1_module_proto_init() { + if File_cosmos_nft_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_nft_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_nft_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_nft_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_nft_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_nft_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_nft_module_v1_module_proto = out.File + file_cosmos_nft_module_v1_module_proto_rawDesc = nil + file_cosmos_nft_module_v1_module_proto_goTypes = nil + file_cosmos_nft_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/params/module/v1/module.pulsar.go b/api/cosmos/params/module/v1/module.pulsar.go new file mode 100644 index 000000000000..2fa9f3d15d3c --- /dev/null +++ b/api/cosmos/params/module/v1/module.pulsar.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_params_module_v1_module_proto_init() + md_Module = File_cosmos_params_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_params_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.params.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.params.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.params.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = 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().(*Module) + 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 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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/params/module/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_params_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_params_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_params_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_params_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x37, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2d, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x27, 0x0a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x78, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xec, 0x01, 0x0a, 0x1b, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x50, 0x4d, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_params_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_params_module_v1_module_proto_rawDescData = file_cosmos_params_module_v1_module_proto_rawDesc +) + +func file_cosmos_params_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_params_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_params_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_params_module_v1_module_proto_rawDescData) + }) + return file_cosmos_params_module_v1_module_proto_rawDescData +} + +var file_cosmos_params_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_params_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.params.module.v1.Module +} +var file_cosmos_params_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_params_module_v1_module_proto_init() } +func file_cosmos_params_module_v1_module_proto_init() { + if File_cosmos_params_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_params_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_params_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_params_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_params_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_params_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_params_module_v1_module_proto = out.File + file_cosmos_params_module_v1_module_proto_rawDesc = nil + file_cosmos_params_module_v1_module_proto_goTypes = nil + file_cosmos_params_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/staking/module/v1/module.pulsar.go b/api/cosmos/staking/module/v1/module.pulsar.go new file mode 100644 index 000000000000..6b64e2dd50aa --- /dev/null +++ b/api/cosmos/staking/module/v1/module.pulsar.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_staking_module_v1_module_proto_init() + md_Module = File_cosmos_staking_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_staking_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.staking.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = 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().(*Module) + 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 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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/staking/module/v1/module.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) +) + +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_staking_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_staking_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_staking_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_staking_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x34, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x42, 0xf2, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x4d, 0xaa, 0x02, 0x18, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_staking_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_staking_module_v1_module_proto_rawDescData = file_cosmos_staking_module_v1_module_proto_rawDesc +) + +func file_cosmos_staking_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_staking_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_staking_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_staking_module_v1_module_proto_rawDescData) + }) + return file_cosmos_staking_module_v1_module_proto_rawDescData +} + +var file_cosmos_staking_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_staking_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.staking.module.v1.Module +} +var file_cosmos_staking_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_staking_module_v1_module_proto_init() } +func file_cosmos_staking_module_v1_module_proto_init() { + if File_cosmos_staking_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_staking_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_staking_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_staking_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_staking_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_staking_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_staking_module_v1_module_proto = out.File + file_cosmos_staking_module_v1_module_proto_rawDesc = nil + file_cosmos_staking_module_v1_module_proto_goTypes = nil + file_cosmos_staking_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/upgrade/v1beta1/query_grpc.pb.go b/api/cosmos/upgrade/v1beta1/query_grpc.pb.go index 69626cd2fbdb..b8c7cb3dbb1f 100644 --- a/api/cosmos/upgrade/v1beta1/query_grpc.pb.go +++ b/api/cosmos/upgrade/v1beta1/query_grpc.pb.go @@ -39,6 +39,8 @@ type QueryClient interface { // Since: cosmos-sdk 0.43 ModuleVersions(ctx context.Context, in *QueryModuleVersionsRequest, opts ...grpc.CallOption) (*QueryModuleVersionsResponse, error) // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 Authority(ctx context.Context, in *QueryAuthorityRequest, opts ...grpc.CallOption) (*QueryAuthorityResponse, error) } @@ -117,6 +119,8 @@ type QueryServer interface { // Since: cosmos-sdk 0.43 ModuleVersions(context.Context, *QueryModuleVersionsRequest) (*QueryModuleVersionsResponse, error) // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 Authority(context.Context, *QueryAuthorityRequest) (*QueryAuthorityResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/baseapp/runtime/module.go b/baseapp/runtime/module.go new file mode 100644 index 000000000000..4145af4959b1 --- /dev/null +++ b/baseapp/runtime/module.go @@ -0,0 +1,175 @@ +package runtime + +import ( + "fmt" + "io" + + "github.com/gogo/protobuf/grpc" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "cosmossdk.io/core/appmodule" + + runtimev1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/runtime/v1" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/container" + "github.com/cosmos/cosmos-sdk/std" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/version" +) + +type BaseAppOption func(*baseapp.BaseApp) + +func (b BaseAppOption) IsAutoGroupType() {} + +type appBuilder struct { + storeKeys []storetypes.StoreKey + interfaceRegistry codectypes.InterfaceRegistry + cdc codec.Codec + amino *codec.LegacyAmino +} + +func (a *appBuilder) registerStoreKey(key storetypes.StoreKey) { + a.storeKeys = append(a.storeKeys, key) +} + +func init() { + appmodule.Register(&runtimev1.Module{}, + appmodule.Provide( + provideBuilder, + provideApp, + provideKVStoreKey, + provideTransientStoreKey, + provideMemoryStoreKey, + ), + ) +} + +func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) ( + codectypes.InterfaceRegistry, + codec.Codec, + *codec.LegacyAmino, + *appBuilder, + codec.ProtoCodecMarshaler) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + amino := codec.NewLegacyAmino() + + // build codecs + for _, wrapper := range moduleBasics { + wrapper.RegisterInterfaces(interfaceRegistry) + wrapper.RegisterLegacyAminoCodec(amino) + } + std.RegisterInterfaces(interfaceRegistry) + std.RegisterLegacyAminoCodec(amino) + + cdc := codec.NewProtoCodec(interfaceRegistry) + builder := &appBuilder{ + storeKeys: nil, + interfaceRegistry: interfaceRegistry, + cdc: cdc, + amino: amino, + } + + return interfaceRegistry, cdc, amino, builder, cdc +} + +type AppCreator struct { + app *App +} + +func (a *AppCreator) RegisterModules(modules ...module.AppModule) error { + for _, appModule := range modules { + if _, ok := a.app.mm.Modules[appModule.Name()]; ok { + return fmt.Errorf("module named %q already exists", appModule.Name()) + } + a.app.mm.Modules[appModule.Name()] = appModule + } + return nil +} + +func (a *AppCreator) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { + for _, option := range a.app.baseAppOptions { + baseAppOptions = append(baseAppOptions, option) + } + bApp := baseapp.NewBaseApp(a.app.config.AppName, logger, db, baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(a.app.builder.interfaceRegistry) + bApp.MountStores(a.app.builder.storeKeys...) + bApp.SetTxHandler(a.app.txHandler) + + a.app.BaseApp = bApp + return a.app +} + +func (a *AppCreator) Finish(loadLatest bool) error { + if a.app == nil { + return fmt.Errorf("app not created yet, can't finish") + } + + configurator := module.NewConfigurator(a.app.builder.cdc, a.app.msgServiceRegistrar, a.app.GRPCQueryRouter()) + a.app.mm.RegisterServices(configurator) + a.app.mm.SetOrderInitGenesis(a.app.config.InitGenesis...) + a.app.mm.SetOrderBeginBlockers(a.app.config.BeginBlockers...) + a.app.mm.SetOrderEndBlockers(a.app.config.EndBlockers...) + a.app.SetBeginBlocker(a.app.mm.BeginBlock) + a.app.SetEndBlocker(a.app.mm.EndBlock) + a.app.SetInitChainer(a.app.InitChainer) + + if loadLatest { + if err := a.app.LoadLatestVersion(); err != nil { + return err + } + } + + return nil +} + +func provideApp( + config *runtimev1.Module, + builder *appBuilder, + modules map[string]module.AppModuleWiringWrapper, + baseAppOptions []BaseAppOption, + txHandler tx.Handler, + msgServiceRegistrar grpc.Server, +) *AppCreator { + mm := &module.Manager{Modules: map[string]module.AppModule{}} + for name, wrapper := range modules { + mm.Modules[name] = wrapper.AppModule + } + return &AppCreator{ + app: &App{ + BaseApp: nil, + baseAppOptions: baseAppOptions, + config: config, + builder: builder, + mm: mm, + beginBlockers: nil, + endBlockers: nil, + txHandler: txHandler, + msgServiceRegistrar: msgServiceRegistrar, + }, + } +} + +func provideKVStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.KVStoreKey { + storeKey := storetypes.NewKVStoreKey(key.Name()) + builder.registerStoreKey(storeKey) + return storeKey +} + +func provideTransientStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.TransientStoreKey { + storeKey := storetypes.NewTransientStoreKey(fmt.Sprintf("transient:%s", key.Name())) + builder.registerStoreKey(storeKey) + return storeKey +} + +func provideMemoryStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.MemoryStoreKey { + storeKey := storetypes.NewMemoryStoreKey(fmt.Sprintf("memory:%s", key.Name())) + builder.registerStoreKey(storeKey) + return storeKey +} diff --git a/baseapp/runtime/runtime.go b/baseapp/runtime/runtime.go new file mode 100644 index 000000000000..a470d4872fbf --- /dev/null +++ b/baseapp/runtime/runtime.go @@ -0,0 +1,78 @@ +package runtime + +import ( + "encoding/json" + + "github.com/gogo/protobuf/grpc" + abci "github.com/tendermint/tendermint/abci/types" + + runtimev1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/runtime/v1" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server/api" + "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/tx" +) + +type App struct { + *baseapp.BaseApp + config *runtimev1.Module + builder *appBuilder + mm *module.Manager + beginBlockers []func(sdk.Context, abci.RequestBeginBlock) + endBlockers []func(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate + baseAppOptions []BaseAppOption + txHandler tx.Handler + msgServiceRegistrar grpc.Server +} + +func (a App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + var genesisState map[string]json.RawMessage + if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } + // TODO: app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + return a.mm.InitGenesis(ctx, a.builder.cdc, genesisState) +} + +func (a App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error) { + //TODO implement me + panic("implement me") +} + +func (a App) SimulationManager() *module.SimulationManager { + //TODO implement me + panic("implement me") +} + +var _ SimappLikeApp = &App{} + +func (a App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + clientCtx := apiSvr.ClientCtx + basics := module.BasicManager{} + + for name, mod := range a.mm.Modules { + basics[name] = mod + } + + basics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) +} + +func (a App) RegisterTxService(clientCtx client.Context) {} + +func (a App) RegisterTendermintService(clientCtx client.Context) {} + +var _ servertypes.Application = &App{} + +type SimappLikeApp interface { + // Exports the state of the application for a genesis file. + ExportAppStateAndValidators( + forZeroHeight bool, jailAllowedAddrs []string, + ) (servertypes.ExportedApp, error) + + // Helper for the simulation framework. + SimulationManager() *module.SimulationManager +} diff --git a/container/container.go b/container/container.go index 700b6b88ceb8..532fdaac83f2 100644 --- a/container/container.go +++ b/container/container.go @@ -170,7 +170,7 @@ func (c *container) addNode(provider *ProviderDescriptor, key *moduleKey) (inter c.addGraphEdge(typeGraphNode, providerGraphNode) } - if key != nil || !hasModuleKeyParam { + if !hasModuleKeyParam { c.logf("Registering %s", provider.Location.String()) c.indentLogger() defer c.dedentLogger() @@ -214,9 +214,10 @@ func (c *container) addNode(provider *ProviderDescriptor, key *moduleKey) (inter } vr = &simpleResolver{ - node: sp, - typ: typ, - graphNode: typeGraphNode, + node: sp, + typ: typ, + graphNode: typeGraphNode, + idxInValues: i, } c.resolvers[typ] = vr } @@ -325,8 +326,8 @@ func (c *container) resolve(in ProviderInput, moduleKey *moduleKey, caller Locat } markGraphNodeAsFailed(typeGraphNode) - return reflect.Value{}, errors.Errorf("can't resolve type %v for %s:\n%s", - in.Type, caller, c.formatResolveStack()) + return reflect.Value{}, errors.Errorf("can't resolve type %s for %s:\n%s", + moreUsefulTypeString(in.Type), caller, c.formatResolveStack()) } res, err := vr.resolve(c, moduleKey, caller) diff --git a/container/container_test.go b/container/container_test.go index 15d8d1a3b6d9..3eb7e367b121 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -461,6 +461,7 @@ type TestOutput struct { container.Out X string + Y int64 } func TestStructArgs(t *testing.T) { @@ -485,11 +486,12 @@ func TestStructArgs(t *testing.T) { )) require.NoError(t, container.Run( - func(x string) { + func(x string, y int64) { require.Equal(t, "A", x) + require.Equal(t, int64(-10), y) }, container.Provide(func() (TestOutput, error) { - return TestOutput{X: "A"}, nil + return TestOutput{X: "A", Y: -10}, nil }), )) diff --git a/container/debug.go b/container/debug.go index 26862c08c555..d3f7b79c4263 100644 --- a/container/debug.go +++ b/container/debug.go @@ -72,7 +72,6 @@ func Logger(logger func(string)) DebugOption { func Debug() DebugOption { return DebugOptions( StdoutLogger(), - LogVisualizer(), FileVisualizer("container_dump.svg", "svg"), ) } @@ -210,7 +209,7 @@ func (c *debugConfig) locationGraphNode(location Location, key *moduleKey) (*cgr } func (c *debugConfig) typeGraphNode(typ reflect.Type) (*cgraph.Node, error) { - node, found, err := c.findOrCreateGraphNode(c.graph, typ.String()) + node, found, err := c.findOrCreateGraphNode(c.graph, moreUsefulTypeString(typ)) if err != nil { return nil, err } @@ -223,6 +222,22 @@ func (c *debugConfig) typeGraphNode(typ reflect.Type) (*cgraph.Node, error) { return node, err } +// moreUsefulTypeString is more useful than reflect.Type.String() +func moreUsefulTypeString(ty reflect.Type) string { + switch ty.Kind() { + case reflect.Struct, reflect.Interface: + return fmt.Sprintf("%s.%s", ty.PkgPath(), ty.Name()) + case reflect.Pointer: + return fmt.Sprintf("*%s", moreUsefulTypeString(ty.Elem())) + case reflect.Map: + return fmt.Sprintf("map[%s]%s", moreUsefulTypeString(ty.Key()), moreUsefulTypeString(ty.Elem())) + case reflect.Slice: + return fmt.Sprintf("[]%s", moreUsefulTypeString(ty.Elem())) + default: + return ty.String() + } +} + func (c *debugConfig) findOrCreateGraphNode(subGraph *cgraph.Graph, name string) (node *cgraph.Node, found bool, err error) { node, err = c.graph.Node(name) if err != nil { @@ -246,7 +261,7 @@ func (c *debugConfig) moduleSubGraph(key *moduleKey) *cgraph.Graph { if key != nil { gname := fmt.Sprintf("cluster_%s", key.name) graph = c.graph.SubGraph(gname, 1) - graph.SetLabel(fmt.Sprintf("ModuleKey: %s", key.name)) + graph.SetLabel(fmt.Sprintf("Module: %s", key.name)) } return graph } diff --git a/core/appconfig/config.go b/core/appconfig/config.go new file mode 100644 index 000000000000..5c3dd4e5e5d0 --- /dev/null +++ b/core/appconfig/config.go @@ -0,0 +1,109 @@ +package appconfig + +import ( + "fmt" + "reflect" + "strings" + + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/known/anypb" + "sigs.k8s.io/yaml" + + "github.com/cosmos/cosmos-sdk/container" + + appv1alpha1 "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + + "cosmossdk.io/core/internal" +) + +func LoadJSON(bz []byte) container.Option { + config := &appv1alpha1.Config{} + err := protojson.Unmarshal(bz, config) + if err != nil { + return container.Error(err) + } + + return Compose(config) +} + +func LoadYAML(bz []byte) container.Option { + j, err := yaml.YAMLToJSON(bz) + if err != nil { + return container.Error(err) + } + + return LoadJSON(j) +} + +func Compose(appConfig *appv1alpha1.Config) container.Option { + opts := []container.Option{ + container.Supply(appConfig), + } + + for _, module := range appConfig.Modules { + if module.Name == "" { + return container.Error(fmt.Errorf("module is missing name")) + } + + if module.Config == nil { + return container.Error(fmt.Errorf("module %s is missing a config object", module.Name)) + } + + msgType, err := protoregistry.GlobalTypes.FindMessageByURL(module.Config.TypeUrl) + if err != nil { + return container.Error(err) + } + + init, ok := internal.ModuleRegistry[msgType.Descriptor().FullName()] + if !ok { + modDesc := proto.GetExtension(msgType.Descriptor().Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor) + if modDesc == nil { + return container.Error(fmt.Errorf("no module registered for type URL %s and that protobuf type does not have the option %s", + module.Config.TypeUrl, appv1alpha1.E_Module.TypeDescriptor().FullName())) + } + + return container.Error(fmt.Errorf("no module registered for type URL %s, did you forget to import %s\n\n%s", + module.Config.TypeUrl, modDesc.GoImport, dumpRegisteredModules())) + } + + config := init.ConfigProtoType.New().Interface() + err = anypb.UnmarshalTo(module.Config, config, proto.UnmarshalOptions{}) + if err != nil { + + return container.Error(err) + } + + opts = append(opts, container.Provide(container.ProviderDescriptor{ + Inputs: nil, + Outputs: []container.ProviderOutput{{Type: init.ConfigGoType}}, + Fn: func(values []reflect.Value) ([]reflect.Value, error) { + return []reflect.Value{reflect.ValueOf(config)}, nil + }, + Location: container.LocationFromCaller(0), + })) + + for _, provider := range init.Providers { + opts = append(opts, container.ProvideInModule(module.Name, provider)) + } + } + + return container.Options(opts...) +} + +func dumpRegisteredModules() string { + var mods []string + for name := range internal.ModuleRegistry { + mods = append(mods, " "+string(name)) + } + return fmt.Sprintf("modules are:\n%s", strings.Join(mods, "\n")) +} + +func MustWrapAny(message proto.Message) *anypb.Any { + a, err := anypb.New(message) + if err != nil { + panic(err) + } + return a +} diff --git a/core/appconfig/config_test.go b/core/appconfig/config_test.go new file mode 100644 index 000000000000..22ab688d380d --- /dev/null +++ b/core/appconfig/config_test.go @@ -0,0 +1,58 @@ +package appconfig_test + +import ( + "testing" + + "gotest.tools/v3/assert" + + "github.com/cosmos/cosmos-sdk/container" + + appv1alpha1 "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/auth/module/v1" + + "cosmossdk.io/core/appconfig" +) + +func expectContainerErrorContains(t *testing.T, option container.Option, contains string) { + t.Helper() + err := container.Run(func() {}, option) + assert.ErrorContains(t, err, contains) +} + +func TestComposeErrors(t *testing.T) { + opt := appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + {}, + }, + }) + expectContainerErrorContains(t, opt, "module is missing name") + + opt = appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + { + Name: "auth", + }, + }, + }) + expectContainerErrorContains(t, opt, "missing a config object") + + opt = appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + { + Name: "auth", + Config: appconfig.MustWrapAny(&appv1alpha1.ModuleConfig{}), + }, + }, + }) + expectContainerErrorContains(t, opt, "does not have the option") + + opt = appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + { + Name: "auth", + Config: appconfig.MustWrapAny(&modulev1.Module{}), + }, + }, + }) + expectContainerErrorContains(t, opt, "did you forget to import") +} diff --git a/core/appmodule/option.go b/core/appmodule/option.go new file mode 100644 index 000000000000..ea02e8c9cd75 --- /dev/null +++ b/core/appmodule/option.go @@ -0,0 +1,34 @@ +package appmodule + +import ( + "github.com/cosmos/cosmos-sdk/container" + + "cosmossdk.io/core/internal" +) + +type Option interface { + apply(*internal.ModuleInitializer) error +} + +type funcOption func(initializer *internal.ModuleInitializer) error + +func (f funcOption) apply(initializer *internal.ModuleInitializer) error { + return f(initializer) +} + +// Provide registers providers with the dependency injection system. See +// github.com/cosmos/cosmos-sdk/container for more documentation on the +// dependency injection system. +func Provide(providers ...interface{}) Option { + return funcOption(func(initializer *internal.ModuleInitializer) error { + for _, provider := range providers { + desc, err := container.ExtractProviderDescriptor(provider) + if err != nil { + return err + } + + initializer.Providers = append(initializer.Providers, desc) + } + return nil + }) +} diff --git a/core/appmodule/register.go b/core/appmodule/register.go new file mode 100644 index 000000000000..7ef4255e6d9b --- /dev/null +++ b/core/appmodule/register.go @@ -0,0 +1,25 @@ +package appmodule + +import ( + "reflect" + + "google.golang.org/protobuf/proto" + + "cosmossdk.io/core/internal" +) + +func Register(msg proto.Message, options ...Option) { + init := &internal.ModuleInitializer{ + ConfigProtoType: msg.ProtoReflect().Type(), + ConfigGoType: reflect.TypeOf(msg), + } + + internal.ModuleRegistry[msg.ProtoReflect().Descriptor().FullName()] = init + + for _, option := range options { + init.Error = option.apply(init) + if init.Error != nil { + return + } + } +} diff --git a/core/go.mod b/core/go.mod new file mode 100644 index 000000000000..a660c5a3358d --- /dev/null +++ b/core/go.mod @@ -0,0 +1,32 @@ +module cosmossdk.io/core + +go 1.18 + +require ( + github.com/cosmos/cosmos-sdk/api v0.1.0 + github.com/cosmos/cosmos-sdk/container v1.0.0-alpha.2 + google.golang.org/protobuf v1.28.0 + gotest.tools/v3 v3.2.0 + sigs.k8s.io/yaml v1.3.0 +) + +require ( + github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect + github.com/fogleman/gg v1.3.0 // indirect + github.com/goccy/go-graphviz v0.0.9 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect + golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect + golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // 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.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 diff --git a/core/go.sum b/core/go.sum new file mode 100644 index 000000000000..0c39db667d19 --- /dev/null +++ b/core/go.sum @@ -0,0 +1,190 @@ +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= +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/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= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +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/corona10/goimagehash v1.0.2 h1:pUfB0LnsJASMPGEZLj7tGY251vF+qLGqOgEP4rUs6kA= +github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= +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/cosmos/cosmos-sdk/container v1.0.0-alpha.2 h1:zDfdiQhZqqUNozEyJ+4l4q1HbYFGss8J/+zsnLo1fko= +github.com/cosmos/cosmos-sdk/container v1.0.0-alpha.2/go.mod h1:8y/mORO0eQiQU1ZhJxxQGYlhTtSpGq7yev1fD2dS1aE= +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= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +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/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/goccy/go-graphviz v0.0.9 h1:s/FMMJ1Joj6La3S5ApO3Jk2cwM4LpXECC2muFx3IPQQ= +github.com/goccy/go-graphviz v0.0.9/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +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= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5 h1:BvoENQQU+fZ9uukda/RzCAL/191HHwJA5b13R6diVlY= +github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/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= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +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.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= +google.golang.org/grpc v1.46.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= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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/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/core/internal/registry.go b/core/internal/registry.go new file mode 100644 index 000000000000..19f3b27881e6 --- /dev/null +++ b/core/internal/registry.go @@ -0,0 +1,18 @@ +package internal + +import ( + "reflect" + + "google.golang.org/protobuf/reflect/protoreflect" + + "github.com/cosmos/cosmos-sdk/container" +) + +var ModuleRegistry = map[protoreflect.FullName]*ModuleInitializer{} + +type ModuleInitializer struct { + ConfigGoType reflect.Type + ConfigProtoType protoreflect.MessageType + Error error + Providers []container.ProviderDescriptor +} diff --git a/go.mod b/go.mod index 015429f40419..2d250148ad9c 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ go 1.18 module github.com/cosmos/cosmos-sdk require ( + cosmossdk.io/core v0.0.0 cosmossdk.io/errors v1.0.0-beta.6 cosmossdk.io/math v1.0.0-beta.2 github.com/99designs/keyring v1.1.6 @@ -60,6 +61,8 @@ require ( sigs.k8s.io/yaml v1.3.0 ) +require github.com/cosmos/cosmos-sdk/container v1.0.0-alpha.2 + require ( cloud.google.com/go v0.100.2 // indirect cloud.google.com/go/compute v1.5.0 // indirect @@ -85,9 +88,12 @@ require ( github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/fogleman/gg v1.3.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-kit/kit v0.12.0 // indirect + github.com/goccy/go-graphviz v0.0.9 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect @@ -135,6 +141,7 @@ require ( github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect + golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect @@ -151,7 +158,10 @@ require ( ) replace ( + cosmossdk.io/core => ./core github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + github.com/cosmos/cosmos-sdk/api => ./api + github.com/cosmos/cosmos-sdk/container => ./container github.com/cosmos/cosmos-sdk/db => ./db // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. diff --git a/go.sum b/go.sum index d311fbdf6eb7..dee4c9a60d16 100644 --- a/go.sum +++ b/go.sum @@ -286,12 +286,12 @@ github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/corona10/goimagehash v1.0.2 h1:pUfB0LnsJASMPGEZLj7tGY251vF+qLGqOgEP4rUs6kA= +github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= 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/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= -github.com/cosmos/cosmos-sdk/api v0.1.0/go.mod h1:CupqQBskAOiTXO1XDZ/wrtWzN/wTxUvbQmOqdUhR8wI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/iavl v0.18.0 h1:02ur4vnalMR2GuWCFNkuseUcl/BCVmg9tOeHOGiZOkE= @@ -401,6 +401,8 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -477,6 +479,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-graphviz v0.0.9 h1:s/FMMJ1Joj6La3S5ApO3Jk2cwM4LpXECC2muFx3IPQQ= +github.com/goccy/go-graphviz v0.0.9/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -489,6 +493,7 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -980,6 +985,8 @@ github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= +github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5 h1:BvoENQQU+fZ9uukda/RzCAL/191HHwJA5b13R6diVlY= +github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= @@ -1411,6 +1418,7 @@ golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1450,6 +1458,8 @@ golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8H golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -2074,6 +2084,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/proto/cosmos/auth/module/v1/module.proto b/proto/cosmos/auth/module/v1/module.proto new file mode 100644 index 000000000000..cb6275b260c0 --- /dev/null +++ b/proto/cosmos/auth/module/v1/module.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package cosmos.auth.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth" + }; + + string bech32_prefix = 1; + repeated ModuleAccountPermission module_account_permissions = 3; +} + +message ModuleAccountPermission { + string account = 1; + repeated string permissions = 2; +} diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto new file mode 100644 index 000000000000..74bcd3db0f8e --- /dev/null +++ b/proto/cosmos/bank/module/v1/module.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package cosmos.bank.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/bank" + }; + + repeated string blocked_addresses = 1; +} + +message ModuleAccountPermission { + string module = 1; + repeated string permissions = 2; +} diff --git a/proto/cosmos/base/runtime/v1/module.proto b/proto/cosmos/base/runtime/v1/module.proto new file mode 100644 index 000000000000..24eb7222cb34 --- /dev/null +++ b/proto/cosmos/base/runtime/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package cosmos.base.runtime.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + }; + + string app_name = 1; + repeated string begin_blockers = 2; + repeated string end_blockers = 3; + repeated string init_genesis = 4; +} \ No newline at end of file diff --git a/proto/cosmos/genutil/module/v1.proto b/proto/cosmos/genutil/module/v1.proto new file mode 100644 index 000000000000..6703cddd3d32 --- /dev/null +++ b/proto/cosmos/genutil/module/v1.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package cosmos.genutil.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + }; +} diff --git a/proto/cosmos/nft/module/v1/module.proto b/proto/cosmos/nft/module/v1/module.proto new file mode 100644 index 000000000000..681d19fb0e7e --- /dev/null +++ b/proto/cosmos/nft/module/v1/module.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package cosmos.nft.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + }; +} diff --git a/proto/cosmos/params/module/v1/module.proto b/proto/cosmos/params/module/v1/module.proto new file mode 100644 index 000000000000..0930f7a0ee79 --- /dev/null +++ b/proto/cosmos/params/module/v1/module.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package cosmos.params.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/params" + }; +} diff --git a/proto/cosmos/staking/module/v1/module.proto b/proto/cosmos/staking/module/v1/module.proto new file mode 100644 index 000000000000..9513e3a8e197 --- /dev/null +++ b/proto/cosmos/staking/module/v1/module.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package cosmos.staking.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + }; +} diff --git a/types/module/module.go b/types/module/module.go index 60c524a39f09..8e760b5283b9 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -547,3 +547,11 @@ func DefaultMigrationsOrder(modules []string) []string { } return out } + +type AppModuleBasicWiringWrapper struct{ AppModuleBasic } + +func (AppModuleBasicWiringWrapper) IsOnePerModuleType() {} + +type AppModuleWiringWrapper struct{ AppModule } + +func (AppModuleWiringWrapper) IsOnePerModuleType() {} diff --git a/types/msgservice/msg.pb.go b/types/msgservice/msg.pb.go index 287951e772ad..6e09a2d54156 100644 --- a/types/msgservice/msg.pb.go +++ b/types/msgservice/msg.pb.go @@ -21,6 +21,15 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +var E_Service = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 11110001, + Name: "cosmos.msg.v1.service", + Tag: "varint,11110001,opt,name=service", + Filename: "cosmos/msg/v1/msg.proto", +} + var E_Signer = &proto.ExtensionDesc{ ExtendedType: (*descriptorpb.MessageOptions)(nil), ExtensionType: ([]string)(nil), @@ -31,24 +40,26 @@ var E_Signer = &proto.ExtensionDesc{ } func init() { + proto.RegisterExtension(E_Service) proto.RegisterExtension(E_Signer) } func init() { proto.RegisterFile("cosmos/msg/v1/msg.proto", fileDescriptor_5c08b83ea858d203) } var fileDescriptor_5c08b83ea858d203 = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 217 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0xd7, 0x2f, 0x33, 0x04, 0x51, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x10, 0x09, 0x3d, 0x90, 0x48, 0x99, 0xa1, 0x94, 0x42, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x58, 0x32, 0xa9, 0x34, 0x4d, 0x3f, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0xa0, - 0x24, 0xbf, 0x08, 0xa2, 0xc1, 0xca, 0x8a, 0x8b, 0xad, 0x38, 0x33, 0x3d, 0x2f, 0xb5, 0x48, 0x48, - 0x5e, 0x0f, 0xa2, 0x58, 0x0f, 0xa6, 0x58, 0xcf, 0x37, 0xb5, 0xb8, 0x38, 0x31, 0x3d, 0xd5, 0xbf, - 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0xe2, 0x43, 0xcf, 0x32, 0x56, 0x05, 0x66, 0x0d, 0xce, 0x20, - 0xa8, 0x0e, 0x27, 0xf7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, - 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4d, - 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0x3a, 0x15, 0x42, 0xe9, 0x16, - 0xa7, 0x64, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x82, 0xdd, 0x5e, 0x9c, 0x5a, 0x54, 0x96, 0x99, 0x9c, - 0x9a, 0xc4, 0x06, 0xb6, 0xd2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x61, 0xff, 0xf0, 0x90, 0xd7, - 0x00, 0x00, 0x00, + 0x24, 0xbf, 0x08, 0xa2, 0xc1, 0xca, 0x86, 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, + 0x48, 0x5e, 0x0f, 0xa2, 0x5a, 0x0f, 0xa6, 0x5a, 0x2f, 0x18, 0x22, 0xe3, 0x5f, 0x50, 0x92, 0x99, + 0x9f, 0x57, 0x2c, 0xf1, 0xb1, 0x67, 0x19, 0xab, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x4c, 0x8b, 0x95, + 0x15, 0x17, 0x5b, 0x71, 0x66, 0x7a, 0x5e, 0x6a, 0x11, 0x16, 0xcd, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, + 0xe9, 0x70, 0xcd, 0x1f, 0x40, 0x9a, 0x99, 0x35, 0x38, 0x83, 0xa0, 0x3a, 0x9c, 0xdc, 0x4f, 0x3c, + 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, + 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x37, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, + 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xea, 0x51, 0x08, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x52, 0x59, + 0x90, 0x0a, 0xf6, 0x39, 0xd4, 0x11, 0x49, 0x6c, 0x60, 0x2b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x27, 0xda, 0xca, 0x33, 0x15, 0x01, 0x00, 0x00, } diff --git a/x/auth/module.go b/x/auth/module.go index e1b7ceec2a7c..17c74aad42cf 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -6,11 +6,23 @@ import ( "fmt" "math/rand" + "github.com/gogo/protobuf/grpc" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/core/appmodule" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/auth/module/v1" + "github.com/cosmos/cosmos-sdk/container" + store "github.com/cosmos/cosmos-sdk/store/types" + txtypes "github.com/cosmos/cosmos-sdk/types/tx" + authmiddleware "github.com/cosmos/cosmos-sdk/x/auth/middleware" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -185,3 +197,66 @@ func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// +// New App Wiring Setup +// + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideTxConfig, provideModule, provideTxHandler), + ) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideTxConfig(marshaler codec.ProtoCodecMarshaler) client.TxConfig { + return tx.NewTxConfig(marshaler, tx.DefaultSignModes) +} + +func provideModule( + config *modulev1.Module, + key *store.KVStoreKey, + cdc codec.Codec, + subspace paramtypes.Subspace) (keeper.AccountKeeper, module.AppModuleWiringWrapper) { + + maccPerms := map[string][]string{} + for _, permission := range config.ModuleAccountPermissions { + maccPerms[permission.Account] = permission.Permissions + } + + k := keeper.NewAccountKeeper(cdc, key, subspace, types.ProtoBaseAccount, maccPerms, config.Bech32Prefix) + m := NewAppModule(cdc, k, simulation.RandomGenesisAccounts) + return k, module.AppModuleWiringWrapper{AppModule: m} +} + +type inputs struct { + container.In + + TxConfig client.TxConfig + InterfaceRegistry codectypes.InterfaceRegistry + Codec codec.Codec + AccountKeeper keeper.AccountKeeper + BankKeeper bankkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper `optional:"true"` + Modules map[string]module.AppModuleWiringWrapper +} + +func provideTxHandler(in inputs) (grpc.Server, txtypes.Handler, error) { + msgSvcRouter := authmiddleware.NewMsgServiceRouter(in.InterfaceRegistry) + txHandler, err := authmiddleware.NewDefaultTxHandler(authmiddleware.TxHandlerOptions{ + //Debug: app.Trace(), + //IndexEvents: indexEvents, + //LegacyRouter: app.legacyRouter, + MsgServiceRouter: msgSvcRouter, + AccountKeeper: in.AccountKeeper, + BankKeeper: in.BankKeeper, + FeegrantKeeper: in.FeeGrantKeeper, + SignModeHandler: in.TxConfig.SignModeHandler(), + SigGasConsumer: authmiddleware.DefaultSigVerificationGasConsumer, + TxDecoder: in.TxConfig.TxDecoder(), + }) + return msgSvcRouter, txHandler, err +} diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 2a3f8493aa21..deb69be04e4f 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -387,7 +387,9 @@ func (m *QueryModuleAccountsResponse) GetAccounts() []*types.Any { return nil } -// Bech32PrefixRequest is the request type for Bech32Prefix rpc method +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 type Bech32PrefixRequest struct { } @@ -424,7 +426,9 @@ func (m *Bech32PrefixRequest) XXX_DiscardUnknown() { var xxx_messageInfo_Bech32PrefixRequest proto.InternalMessageInfo -// Bech32PrefixResponse is the response type for Bech32Prefix rpc method +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 type Bech32PrefixResponse struct { Bech32Prefix string `protobuf:"bytes,1,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` } @@ -469,7 +473,9 @@ func (m *Bech32PrefixResponse) GetBech32Prefix() string { return "" } -// AddressBytesToStringRequest is the request type for AddressString rpc method +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 type AddressBytesToStringRequest struct { AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` } @@ -514,7 +520,9 @@ func (m *AddressBytesToStringRequest) GetAddressBytes() []byte { return nil } -// AddressBytesToStringResponse is the response type for AddressString rpc method +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 type AddressBytesToStringResponse struct { AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` } @@ -559,7 +567,9 @@ func (m *AddressBytesToStringResponse) GetAddressString() string { return "" } -// AddressStringToBytesRequest is the request type for AccountBytes rpc method +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 type AddressStringToBytesRequest struct { AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` } @@ -604,7 +614,9 @@ func (m *AddressStringToBytesRequest) GetAddressString() string { return "" } -// AddressStringToBytesResponse is the response type for AddressBytes rpc method +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 type AddressStringToBytesResponse struct { AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` } @@ -745,11 +757,17 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) - // Bech32 queries bech32Prefix + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) } @@ -836,11 +854,17 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // ModuleAccounts returns all the existing module accounts. ModuleAccounts(context.Context, *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) - // Bech32 queries bech32Prefix + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 Bech32Prefix(context.Context, *Bech32PrefixRequest) (*Bech32PrefixResponse, error) // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 AddressBytesToString(context.Context, *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 AddressStringToBytes(context.Context, *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) } diff --git a/x/bank/module.go b/x/bank/module.go index bfeee7eed6ba..ee8ed2d7daf4 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -11,18 +11,23 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/core/appmodule" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/bank/module/v1" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + store "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/cosmos/cosmos-sdk/x/bank/keeper" v040 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v042" "github.com/cosmos/cosmos-sdk/x/bank/simulation" "github.com/cosmos/cosmos-sdk/x/bank/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var ( @@ -195,3 +200,29 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper, ) } + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideModule), + ) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideModule( + config *modulev1.Module, + key *store.KVStoreKey, + cdc codec.Codec, + subspace paramtypes.Subspace, + accountKeeper authkeeper.AccountKeeper, +) (keeper.Keeper, module.AppModuleWiringWrapper) { + blockedAddrs := map[string]bool{} + for _, address := range config.BlockedAddresses { + blockedAddrs[address] = true + } + k := keeper.NewBaseKeeper(cdc, key, accountKeeper, subspace, blockedAddrs) + m := NewAppModule(cdc, k, accountKeeper) + return k, module.AppModuleWiringWrapper{AppModule: m} +} diff --git a/x/genutil/module.go b/x/genutil/module.go index 9b91849b68c0..2ba277b860e4 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -9,12 +9,18 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/core/appmodule" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/genutil/module" + "github.com/cosmos/cosmos-sdk/baseapp" + runtime2 "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/genutil/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) var ( @@ -107,3 +113,31 @@ func (am AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMe // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 } + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideModule), + ) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideModule( + accountKeeper authkeeper.AccountKeeper, + stakingKeeper stakingkeeper.Keeper, + config client.TxConfig, +) (module.AppModuleWiringWrapper, runtime2.BaseAppOption) { + // this is a total hack to get access to baseapp + var bApp *baseapp.BaseApp + m := NewAppModule(accountKeeper, stakingKeeper, func(tx abci.RequestDeliverTx) abci.ResponseDeliverTx { + if bApp == nil { + panic("BaseApp not initialized!") + } + return bApp.DeliverTx(tx) + }, config) + return module.AppModuleWiringWrapper{AppModule: m}, func(app *baseapp.BaseApp) { + bApp = app + } +} diff --git a/x/nft/client/testutil/app.yaml b/x/nft/client/testutil/app.yaml new file mode 100644 index 000000000000..b2fff994a02e --- /dev/null +++ b/x/nft/client/testutil/app.yaml @@ -0,0 +1,33 @@ +modules: + - name: runtime + config: + "@type": cosmos.base.runtime.v1.Module + begin_blockers: [ staking, auth, bank, genutil, nft, params ] + end_blockers: [ staking, auth, bank, genutil, nft, params ] + init_genesis: [ auth, bank, staking, genutil, nft, params ] + - name: auth + config: + "@type": cosmos.auth.module.v1.Module + bech32_prefix: cosmos + module_account_permissions: + - account: fee_collector + - account: bonded_tokens_pool + permissions: [ burner, staking ] + - account: not_bonded_tokens_pool + permissions: [ burner, staking ] + - account: nft + - name: bank + config: + "@type": cosmos.bank.module.v1.Module + - name: params + config: + "@type": cosmos.params.module.v1.Module + - name: nft + config: + "@type": cosmos.nft.module.v1.Module + - name: staking + config: + "@type": cosmos.staking.module.v1.Module + - name: genutil + config: + "@type": cosmos.genutil.module.v1.Module diff --git a/x/nft/client/testutil/cli_test.go b/x/nft/client/testutil/cli_test.go index 7f92bbeeff55..7fcf04a078e5 100644 --- a/x/nft/client/testutil/cli_test.go +++ b/x/nft/client/testutil/cli_test.go @@ -1,15 +1,42 @@ package testutil import ( + _ "embed" "testing" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + dbm "github.com/tendermint/tm-db" + "cosmossdk.io/core/appconfig" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/baseapp/runtime" + "github.com/cosmos/cosmos-sdk/container" + pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" + "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/testutil/network" ) +//go:embed app.yaml +var appConfig []byte + func TestIntegrationTestSuite(t *testing.T) { - cfg := network.DefaultConfig() - cfg.NumValidators = 1 - suite.Run(t, NewIntegrationTestSuite(cfg)) + err := container.RunDebug(func(creator *runtime.AppCreator) { + cfg := network.DefaultConfig() + cfg.AppConstructor = func(val network.Validator) types.Application { + app := creator.Create(val.Ctx.Logger, dbm.NewMemDB(), + nil, + baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), + baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), + ) + require.NoError(t, creator.Finish(true)) + return app + } + cfg.NumValidators = 1 + suite.Run(t, NewIntegrationTestSuite(cfg)) + }, + container.Debug(), + appconfig.LoadYAML(appConfig)) + require.NoError(t, err) } diff --git a/x/nft/module/module.go b/x/nft/module/module.go index ab6fc9633cc9..07c2413ae31b 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -9,14 +9,19 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/core/appmodule" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/nft/module/v1" sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/container" + store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/nft" "github.com/cosmos/cosmos-sdk/x/nft/client/cli" "github.com/cosmos/cosmos-sdk/x/nft/keeper" @@ -192,3 +197,53 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp am.accountKeeper, am.bankKeeper, am.keeper, ) } + +type Inputs struct { + container.In + + StoreKey *store.KVStoreKey + Codec codec.Codec + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + InterfaceRegistry cdctypes.InterfaceRegistry +} + +type Outputs struct { + container.Out + + Keeper keeper.Keeper + AppModule module.AppModuleWiringWrapper +} + +func Provide(inputs Inputs) (Outputs, error) { + k := keeper.NewKeeper(inputs.StoreKey, inputs.Codec, inputs.AccountKeeper, inputs.BankKeeper) + m := NewAppModule(inputs.Codec, k, inputs.AccountKeeper, inputs.BankKeeper, inputs.InterfaceRegistry) + return Outputs{ + Keeper: k, + AppModule: module.AppModuleWiringWrapper{AppModule: m}, + }, nil +} + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide( + provideModuleBasic, + provideModule, + )) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideModule( + kvStoreKey *store.KVStoreKey, + cdc codec.Codec, + accKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, + interfaceRegistry cdctypes.InterfaceRegistry) (keeper.Keeper, module.AppModuleWiringWrapper) { + + k := keeper.NewKeeper(kvStoreKey, cdc, accKeeper, bankKeeper) + m := NewAppModule(cdc, k, accKeeper, bankKeeper, interfaceRegistry) + return k, module.AppModuleWiringWrapper{AppModule: m} +} diff --git a/x/params/module.go b/x/params/module.go index da4679f8789f..fe8eec06d996 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -9,9 +9,16 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/params/module/v1" + + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/baseapp" + runtime2 "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/container" + store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -148,3 +155,34 @@ func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide( + provideModuleBasic, + provideModule, + provideSubSpace, + )) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideModule( + kvStoreKey *store.KVStoreKey, + transientStoreKey *store.TransientStoreKey, + cdc codec.Codec, + amino *codec.LegacyAmino, +) (keeper.Keeper, module.AppModuleWiringWrapper, runtime2.BaseAppOption) { + + k := keeper.NewKeeper(cdc, amino, kvStoreKey, transientStoreKey) + m := NewAppModule(k) + return k, module.AppModuleWiringWrapper{AppModule: m}, func(app *baseapp.BaseApp) { + app.SetParamStore(k.Subspace(baseapp.Paramspace).WithKeyTable(types.ConsensusParamsKeyTable())) + } +} + +func provideSubSpace(key container.ModuleKey, k keeper.Keeper) types.Subspace { + return k.Subspace(key.Name()) +} diff --git a/x/staking/module.go b/x/staking/module.go index c1051be3c99d..598207009666 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -10,12 +10,18 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/core/appmodule" + modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/staking/module/v1" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/simulation" @@ -200,3 +206,25 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp simState.AppParams, simState.Cdc, am.accountKeeper, am.bankKeeper, am.keeper, ) } + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideModule), + ) +} + +func provideModuleBasic() module.AppModuleBasicWiringWrapper { + return module.AppModuleBasicWiringWrapper{AppModuleBasic: AppModuleBasic{}} +} + +func provideModule( + key *store.KVStoreKey, + cdc codec.Codec, + subspace paramtypes.Subspace, + accountKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, +) (keeper.Keeper, module.AppModuleWiringWrapper) { + k := keeper.NewKeeper(cdc, key, accountKeeper, bankKeeper, subspace) + m := NewAppModule(cdc, k, accountKeeper, bankKeeper) + return k, module.AppModuleWiringWrapper{AppModule: m} +} From c0fd2441d0b9171a4851b01b0ee1e790f98bd9dc Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Sat, 7 May 2022 11:22:54 -0400 Subject: [PATCH 2/6] better container debugging and network.DefaultConfigWithAppConfig --- baseapp/runtime/module.go | 28 ++++++++++---------- baseapp/runtime/runtime.go | 2 +- container/debug.go | 44 ++++++++++++++++++++++++++++--- container/run.go | 15 +++++++++-- testutil/network/network.go | 26 ++++++++++++++++++ x/nft/client/testutil/cli_test.go | 25 +++--------------- 6 files changed, 98 insertions(+), 42 deletions(-) diff --git a/baseapp/runtime/module.go b/baseapp/runtime/module.go index 4145af4959b1..ec2a3bfe9f2e 100644 --- a/baseapp/runtime/module.go +++ b/baseapp/runtime/module.go @@ -26,14 +26,14 @@ type BaseAppOption func(*baseapp.BaseApp) func (b BaseAppOption) IsAutoGroupType() {} -type appBuilder struct { +type privateState struct { storeKeys []storetypes.StoreKey interfaceRegistry codectypes.InterfaceRegistry cdc codec.Codec amino *codec.LegacyAmino } -func (a *appBuilder) registerStoreKey(key storetypes.StoreKey) { +func (a *privateState) registerStoreKey(key storetypes.StoreKey) { a.storeKeys = append(a.storeKeys, key) } @@ -53,7 +53,7 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) codectypes.InterfaceRegistry, codec.Codec, *codec.LegacyAmino, - *appBuilder, + *privateState, codec.ProtoCodecMarshaler) { interfaceRegistry := codectypes.NewInterfaceRegistry() amino := codec.NewLegacyAmino() @@ -67,7 +67,7 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) std.RegisterLegacyAminoCodec(amino) cdc := codec.NewProtoCodec(interfaceRegistry) - builder := &appBuilder{ + builder := &privateState{ storeKeys: nil, interfaceRegistry: interfaceRegistry, cdc: cdc, @@ -77,11 +77,11 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) return interfaceRegistry, cdc, amino, builder, cdc } -type AppCreator struct { +type AppBuilder struct { app *App } -func (a *AppCreator) RegisterModules(modules ...module.AppModule) error { +func (a *AppBuilder) RegisterModules(modules ...module.AppModule) error { for _, appModule := range modules { if _, ok := a.app.mm.Modules[appModule.Name()]; ok { return fmt.Errorf("module named %q already exists", appModule.Name()) @@ -91,7 +91,7 @@ func (a *AppCreator) RegisterModules(modules ...module.AppModule) error { return nil } -func (a *AppCreator) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { +func (a *AppBuilder) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { for _, option := range a.app.baseAppOptions { baseAppOptions = append(baseAppOptions, option) } @@ -106,7 +106,7 @@ func (a *AppCreator) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, return a.app } -func (a *AppCreator) Finish(loadLatest bool) error { +func (a *AppBuilder) Finish(loadLatest bool) error { if a.app == nil { return fmt.Errorf("app not created yet, can't finish") } @@ -131,17 +131,17 @@ func (a *AppCreator) Finish(loadLatest bool) error { func provideApp( config *runtimev1.Module, - builder *appBuilder, + builder *privateState, modules map[string]module.AppModuleWiringWrapper, baseAppOptions []BaseAppOption, txHandler tx.Handler, msgServiceRegistrar grpc.Server, -) *AppCreator { +) *AppBuilder { mm := &module.Manager{Modules: map[string]module.AppModule{}} for name, wrapper := range modules { mm.Modules[name] = wrapper.AppModule } - return &AppCreator{ + return &AppBuilder{ app: &App{ BaseApp: nil, baseAppOptions: baseAppOptions, @@ -156,19 +156,19 @@ func provideApp( } } -func provideKVStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.KVStoreKey { +func provideKVStoreKey(key container.ModuleKey, builder *privateState) *storetypes.KVStoreKey { storeKey := storetypes.NewKVStoreKey(key.Name()) builder.registerStoreKey(storeKey) return storeKey } -func provideTransientStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.TransientStoreKey { +func provideTransientStoreKey(key container.ModuleKey, builder *privateState) *storetypes.TransientStoreKey { storeKey := storetypes.NewTransientStoreKey(fmt.Sprintf("transient:%s", key.Name())) builder.registerStoreKey(storeKey) return storeKey } -func provideMemoryStoreKey(key container.ModuleKey, builder *appBuilder) *storetypes.MemoryStoreKey { +func provideMemoryStoreKey(key container.ModuleKey, builder *privateState) *storetypes.MemoryStoreKey { storeKey := storetypes.NewMemoryStoreKey(fmt.Sprintf("memory:%s", key.Name())) builder.registerStoreKey(storeKey) return storeKey diff --git a/baseapp/runtime/runtime.go b/baseapp/runtime/runtime.go index a470d4872fbf..7c773c72dcd1 100644 --- a/baseapp/runtime/runtime.go +++ b/baseapp/runtime/runtime.go @@ -20,7 +20,7 @@ import ( type App struct { *baseapp.BaseApp config *runtimev1.Module - builder *appBuilder + builder *privateState mm *module.Manager beginBlockers []func(sdk.Context, abci.RequestBeginBlock) endBlockers []func(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate diff --git a/container/debug.go b/container/debug.go index d3f7b79c4263..c51b49d64a77 100644 --- a/container/debug.go +++ b/container/debug.go @@ -66,16 +66,52 @@ func Logger(logger func(string)) DebugOption { }) } +const debugContainerSvg = "debug_container.svg" +const debugContainerDot = "debug_container.dot" + // Debug is a default debug option which sends log output to stdout, dumps -// the container in the graphviz DOT format to stdout, and to the file -// container_dump.svg. +// the container in the graphviz DOT and SVG formats to debug_container.dot +// and debug_container.svg respectively. func Debug() DebugOption { return DebugOptions( StdoutLogger(), - FileVisualizer("container_dump.svg", "svg"), + FileVisualizer(debugContainerSvg, "svg"), + FileVisualizer(debugContainerDot, "dot"), ) } +// AutoDebug does the same thing as Debug when there is an error and deletes +// the debug_container.dot and debug_container.dot if they exist when there +// is no error. This is the default debug mode of Run. +func AutoDebug() DebugOption { + return debugOption(func(c *debugConfig) error { + logBuf := &bytes.Buffer{} + c.loggers = append(c.loggers, func(s string) { + logBuf.WriteString(s) + logBuf.WriteString("\n") + }) + c.onError = func() { + c.addFileVisualizer(debugContainerSvg, "svg") + c.addFileVisualizer(debugContainerDot, "dot") + _, _ = os.Stdout.Write(logBuf.Bytes()) + c.loggers = append(c.loggers, func(s string) { + _, _ = fmt.Fprintln(os.Stdout, s) + }) + } + c.onSuccess = func() { + deleteIfExists(debugContainerSvg) + deleteIfExists(debugContainerDot) + } + return nil + }) +} + +func deleteIfExists(filename string) { + if _, err := os.Stat(filename); err == nil { + _ = os.Remove(filename) + } +} + // DebugOptions creates a debug option which bundles together other debug options. func DebugOptions(options ...DebugOption) DebugOption { return debugOption(func(c *debugConfig) error { @@ -99,6 +135,8 @@ type debugConfig struct { graph *cgraph.Graph visualizers []func(string) logVisualizer bool + onError func() + onSuccess func() } type debugOption func(*debugConfig) error diff --git a/container/run.go b/container/run.go index 12d1b9e2f113..e3f0ce0a241f 100644 --- a/container/run.go +++ b/container/run.go @@ -7,8 +7,12 @@ package container // // Ex: // Run(func (x int) error { println(x) }, Provide(func() int { return 1 })) +// +// Run uses the debug mode provided by AutoDebug which means there will be +// verbose debugging information if there is an error and nothing upon success. +// Use RunDebug to configure behavior with more control. func Run(invoker interface{}, opts ...Option) error { - return RunDebug(invoker, nil, opts...) + return RunDebug(invoker, AutoDebug(), opts...) } // RunDebug is a version of Run which takes an optional DebugOption for @@ -36,9 +40,16 @@ func RunDebug(invoker interface{}, debugOpt DebugOption, opts ...Option) error { err = opt.apply(ctr) if err != nil { cfg.logf("Failed registering providers because of: %+v", err) + cfg.onError() return err } cfg.dedentLogger() - return ctr.run(invoker) + err = ctr.run(invoker) + if err != nil { + cfg.onError() + } else { + cfg.onSuccess() + } + return err } diff --git a/testutil/network/network.go b/testutil/network/network.go index 995eb56889df..2325d7d374ab 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -25,10 +25,12 @@ import ( "google.golang.org/grpc" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/container" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -127,6 +129,30 @@ func DefaultConfig() Config { } } +func DefaultConfigWithAppConfig(appConfig container.Option) (Config, error) { + cfg := DefaultConfig() + var appBuilder *runtime.AppBuilder + err := container.Run(func(b *runtime.AppBuilder) { + appBuilder = b + }, appConfig) + if err != nil { + return Config{}, err + } + cfg.AppConstructor = func(val Validator) servertypes.Application { + app := appBuilder.Create(val.Ctx.Logger, dbm.NewMemDB(), + nil, + baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), + baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), + ) + err := appBuilder.Finish(true) + if err != nil { + panic(err) + } + return app + } + return cfg, nil +} + type ( // Network defines a local in-process testing network using SimApp. It can be // configured to start any number of validators, each with its own RPC and API diff --git a/x/nft/client/testutil/cli_test.go b/x/nft/client/testutil/cli_test.go index 7fcf04a078e5..09023a6e6834 100644 --- a/x/nft/client/testutil/cli_test.go +++ b/x/nft/client/testutil/cli_test.go @@ -6,15 +6,9 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - dbm "github.com/tendermint/tm-db" "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/baseapp/runtime" - "github.com/cosmos/cosmos-sdk/container" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/testutil/network" ) @@ -22,21 +16,8 @@ import ( var appConfig []byte func TestIntegrationTestSuite(t *testing.T) { - err := container.RunDebug(func(creator *runtime.AppCreator) { - cfg := network.DefaultConfig() - cfg.AppConstructor = func(val network.Validator) types.Application { - app := creator.Create(val.Ctx.Logger, dbm.NewMemDB(), - nil, - baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), - baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), - ) - require.NoError(t, creator.Finish(true)) - return app - } - cfg.NumValidators = 1 - suite.Run(t, NewIntegrationTestSuite(cfg)) - }, - container.Debug(), - appconfig.LoadYAML(appConfig)) + cfg, err := network.DefaultConfigWithAppConfig(appconfig.LoadYAML(appConfig)) require.NoError(t, err) + cfg.NumValidators = 1 + suite.Run(t, NewIntegrationTestSuite(cfg)) } From e9b80ca808df40cbfea69713bcf28d36ccfc2c07 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Sat, 7 May 2022 11:30:55 -0400 Subject: [PATCH 3/6] handle default genesis --- baseapp/runtime/{runtime.go => app.go} | 4 ++-- baseapp/runtime/module.go | 19 +++++++++++++++---- testutil/network/network.go | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) rename baseapp/runtime/{runtime.go => app.go} (95%) diff --git a/baseapp/runtime/runtime.go b/baseapp/runtime/app.go similarity index 95% rename from baseapp/runtime/runtime.go rename to baseapp/runtime/app.go index 7c773c72dcd1..0fe33fd4f484 100644 --- a/baseapp/runtime/runtime.go +++ b/baseapp/runtime/app.go @@ -20,7 +20,7 @@ import ( type App struct { *baseapp.BaseApp config *runtimev1.Module - builder *privateState + privateState *privateState mm *module.Manager beginBlockers []func(sdk.Context, abci.RequestBeginBlock) endBlockers []func(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate @@ -35,7 +35,7 @@ func (a App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Respon panic(err) } // TODO: app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return a.mm.InitGenesis(ctx, a.builder.cdc, genesisState) + return a.mm.InitGenesis(ctx, a.privateState.cdc, genesisState) } func (a App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error) { diff --git a/baseapp/runtime/module.go b/baseapp/runtime/module.go index ec2a3bfe9f2e..ce2aeb67560e 100644 --- a/baseapp/runtime/module.go +++ b/baseapp/runtime/module.go @@ -1,6 +1,7 @@ package runtime import ( + "encoding/json" "fmt" "io" @@ -31,6 +32,7 @@ type privateState struct { interfaceRegistry codectypes.InterfaceRegistry cdc codec.Codec amino *codec.LegacyAmino + moduleBasics map[string]module.AppModuleBasicWiringWrapper } func (a *privateState) registerStoreKey(key storetypes.StoreKey) { @@ -72,6 +74,7 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) interfaceRegistry: interfaceRegistry, cdc: cdc, amino: amino, + moduleBasics: moduleBasics, } return interfaceRegistry, cdc, amino, builder, cdc @@ -91,6 +94,14 @@ func (a *AppBuilder) RegisterModules(modules ...module.AppModule) error { return nil } +func (a AppBuilder) DefaultGenesis() map[string]json.RawMessage { + genesis := make(map[string]json.RawMessage) + for name, wrapper := range a.app.privateState.moduleBasics { + genesis[name] = wrapper.DefaultGenesis(a.app.privateState.cdc) + } + return genesis +} + func (a *AppBuilder) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { for _, option := range a.app.baseAppOptions { baseAppOptions = append(baseAppOptions, option) @@ -98,8 +109,8 @@ func (a *AppBuilder) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, bApp := baseapp.NewBaseApp(a.app.config.AppName, logger, db, baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(a.app.builder.interfaceRegistry) - bApp.MountStores(a.app.builder.storeKeys...) + bApp.SetInterfaceRegistry(a.app.privateState.interfaceRegistry) + bApp.MountStores(a.app.privateState.storeKeys...) bApp.SetTxHandler(a.app.txHandler) a.app.BaseApp = bApp @@ -111,7 +122,7 @@ func (a *AppBuilder) Finish(loadLatest bool) error { return fmt.Errorf("app not created yet, can't finish") } - configurator := module.NewConfigurator(a.app.builder.cdc, a.app.msgServiceRegistrar, a.app.GRPCQueryRouter()) + configurator := module.NewConfigurator(a.app.privateState.cdc, a.app.msgServiceRegistrar, a.app.GRPCQueryRouter()) a.app.mm.RegisterServices(configurator) a.app.mm.SetOrderInitGenesis(a.app.config.InitGenesis...) a.app.mm.SetOrderBeginBlockers(a.app.config.BeginBlockers...) @@ -146,7 +157,7 @@ func provideApp( BaseApp: nil, baseAppOptions: baseAppOptions, config: config, - builder: builder, + privateState: builder, mm: mm, beginBlockers: nil, endBlockers: nil, diff --git a/testutil/network/network.go b/testutil/network/network.go index 2325d7d374ab..fb476b4665dd 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -138,6 +138,7 @@ func DefaultConfigWithAppConfig(appConfig container.Option) (Config, error) { if err != nil { return Config{}, err } + cfg.GenesisState = appBuilder.DefaultGenesis() cfg.AppConstructor = func(val Validator) servertypes.Application { app := appBuilder.Create(val.Ctx.Logger, dbm.NewMemDB(), nil, From 52d90a5f55b299b571705fddce61f617f09d1368 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Sat, 7 May 2022 11:32:35 -0400 Subject: [PATCH 4/6] refactoring --- baseapp/runtime/app.go | 16 ++++----- baseapp/runtime/builder.go | 74 ++++++++++++++++++++++++++++++++++++++ baseapp/runtime/module.go | 65 --------------------------------- 3 files changed, 82 insertions(+), 73 deletions(-) create mode 100644 baseapp/runtime/builder.go diff --git a/baseapp/runtime/app.go b/baseapp/runtime/app.go index 0fe33fd4f484..55d6ff65fa0f 100644 --- a/baseapp/runtime/app.go +++ b/baseapp/runtime/app.go @@ -29,7 +29,7 @@ type App struct { msgServiceRegistrar grpc.Server } -func (a App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (a *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { var genesisState map[string]json.RawMessage if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) @@ -38,19 +38,19 @@ func (a App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Respon return a.mm.InitGenesis(ctx, a.privateState.cdc, genesisState) } -func (a App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error) { +func (a *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error) { //TODO implement me panic("implement me") } -func (a App) SimulationManager() *module.SimulationManager { +func (a *App) SimulationManager() *module.SimulationManager { //TODO implement me panic("implement me") } -var _ SimappLikeApp = &App{} +var _ simappLikeApp = &App{} -func (a App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (a *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx basics := module.BasicManager{} @@ -61,13 +61,13 @@ func (a App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { basics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) } -func (a App) RegisterTxService(clientCtx client.Context) {} +func (a *App) RegisterTxService(clientCtx client.Context) {} -func (a App) RegisterTendermintService(clientCtx client.Context) {} +func (a *App) RegisterTendermintService(clientCtx client.Context) {} var _ servertypes.Application = &App{} -type SimappLikeApp interface { +type simappLikeApp interface { // Exports the state of the application for a genesis file. ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, diff --git a/baseapp/runtime/builder.go b/baseapp/runtime/builder.go new file mode 100644 index 000000000000..004b3d16a4a2 --- /dev/null +++ b/baseapp/runtime/builder.go @@ -0,0 +1,74 @@ +package runtime + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" +) + +type AppBuilder struct { + app *App +} + +func (a *AppBuilder) RegisterModules(modules ...module.AppModule) error { + for _, appModule := range modules { + if _, ok := a.app.mm.Modules[appModule.Name()]; ok { + return fmt.Errorf("module named %q already exists", appModule.Name()) + } + a.app.mm.Modules[appModule.Name()] = appModule + } + return nil +} + +func (a *AppBuilder) DefaultGenesis() map[string]json.RawMessage { + genesis := make(map[string]json.RawMessage) + for name, wrapper := range a.app.privateState.moduleBasics { + genesis[name] = wrapper.DefaultGenesis(a.app.privateState.cdc) + } + return genesis +} + +func (a *AppBuilder) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { + for _, option := range a.app.baseAppOptions { + baseAppOptions = append(baseAppOptions, option) + } + bApp := baseapp.NewBaseApp(a.app.config.AppName, logger, db, baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(a.app.privateState.interfaceRegistry) + bApp.MountStores(a.app.privateState.storeKeys...) + bApp.SetTxHandler(a.app.txHandler) + + a.app.BaseApp = bApp + return a.app +} + +func (a *AppBuilder) Finish(loadLatest bool) error { + if a.app == nil { + return fmt.Errorf("app not created yet, can't finish") + } + + configurator := module.NewConfigurator(a.app.privateState.cdc, a.app.msgServiceRegistrar, a.app.GRPCQueryRouter()) + a.app.mm.RegisterServices(configurator) + a.app.mm.SetOrderInitGenesis(a.app.config.InitGenesis...) + a.app.mm.SetOrderBeginBlockers(a.app.config.BeginBlockers...) + a.app.mm.SetOrderEndBlockers(a.app.config.EndBlockers...) + a.app.SetBeginBlocker(a.app.mm.BeginBlock) + a.app.SetEndBlocker(a.app.mm.EndBlock) + a.app.SetInitChainer(a.app.InitChainer) + + if loadLatest { + if err := a.app.LoadLatestVersion(); err != nil { + return err + } + } + + return nil +} diff --git a/baseapp/runtime/module.go b/baseapp/runtime/module.go index ce2aeb67560e..70a89b488687 100644 --- a/baseapp/runtime/module.go +++ b/baseapp/runtime/module.go @@ -1,13 +1,9 @@ package runtime import ( - "encoding/json" "fmt" - "io" "github.com/gogo/protobuf/grpc" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" "cosmossdk.io/core/appmodule" @@ -20,7 +16,6 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/tx" - "github.com/cosmos/cosmos-sdk/version" ) type BaseAppOption func(*baseapp.BaseApp) @@ -80,66 +75,6 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) return interfaceRegistry, cdc, amino, builder, cdc } -type AppBuilder struct { - app *App -} - -func (a *AppBuilder) RegisterModules(modules ...module.AppModule) error { - for _, appModule := range modules { - if _, ok := a.app.mm.Modules[appModule.Name()]; ok { - return fmt.Errorf("module named %q already exists", appModule.Name()) - } - a.app.mm.Modules[appModule.Name()] = appModule - } - return nil -} - -func (a AppBuilder) DefaultGenesis() map[string]json.RawMessage { - genesis := make(map[string]json.RawMessage) - for name, wrapper := range a.app.privateState.moduleBasics { - genesis[name] = wrapper.DefaultGenesis(a.app.privateState.cdc) - } - return genesis -} - -func (a *AppBuilder) Create(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptions ...func(*baseapp.BaseApp)) *App { - for _, option := range a.app.baseAppOptions { - baseAppOptions = append(baseAppOptions, option) - } - bApp := baseapp.NewBaseApp(a.app.config.AppName, logger, db, baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(a.app.privateState.interfaceRegistry) - bApp.MountStores(a.app.privateState.storeKeys...) - bApp.SetTxHandler(a.app.txHandler) - - a.app.BaseApp = bApp - return a.app -} - -func (a *AppBuilder) Finish(loadLatest bool) error { - if a.app == nil { - return fmt.Errorf("app not created yet, can't finish") - } - - configurator := module.NewConfigurator(a.app.privateState.cdc, a.app.msgServiceRegistrar, a.app.GRPCQueryRouter()) - a.app.mm.RegisterServices(configurator) - a.app.mm.SetOrderInitGenesis(a.app.config.InitGenesis...) - a.app.mm.SetOrderBeginBlockers(a.app.config.BeginBlockers...) - a.app.mm.SetOrderEndBlockers(a.app.config.EndBlockers...) - a.app.SetBeginBlocker(a.app.mm.BeginBlock) - a.app.SetEndBlocker(a.app.mm.EndBlock) - a.app.SetInitChainer(a.app.InitChainer) - - if loadLatest { - if err := a.app.LoadLatestVersion(); err != nil { - return err - } - } - - return nil -} - func provideApp( config *runtimev1.Module, builder *privateState, From 751c54d9d9f8d565ea7880a8f398cc135aad1060 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Sat, 7 May 2022 15:25:21 -0400 Subject: [PATCH 5/6] move runtime --- .../app/module/v1alpha1/module.pulsar.go | 507 ------------------ .../runtime/v1alpha1}/module.pulsar.go | 212 ++++---- proto/cosmos/app/module/v1alpha1/module.proto | 13 - .../v1 => app/runtime/v1alpha1}/module.proto | 5 +- {baseapp/runtime => runtime}/app.go | 4 +- {baseapp/runtime => runtime}/builder.go | 0 {baseapp/runtime => runtime}/module.go | 6 +- testutil/network/network.go | 2 +- x/genutil/module.go | 2 +- x/nft/client/testutil/app.yaml | 2 +- x/params/module.go | 2 +- 11 files changed, 120 insertions(+), 635 deletions(-) delete mode 100644 api/cosmos/app/module/v1alpha1/module.pulsar.go rename api/cosmos/{base/runtime/v1 => app/runtime/v1alpha1}/module.pulsar.go (77%) delete mode 100644 proto/cosmos/app/module/v1alpha1/module.proto rename proto/cosmos/{base/runtime/v1 => app/runtime/v1alpha1}/module.proto (65%) rename {baseapp/runtime => runtime}/app.go (94%) rename {baseapp/runtime => runtime}/builder.go (100%) rename {baseapp/runtime => runtime}/module.go (95%) diff --git a/api/cosmos/app/module/v1alpha1/module.pulsar.go b/api/cosmos/app/module/v1alpha1/module.pulsar.go deleted file mode 100644 index 7ad00374d030..000000000000 --- a/api/cosmos/app/module/v1alpha1/module.pulsar.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1alpha1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/cosmos-sdk/api/cosmos/app/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Module protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_app_module_v1alpha1_module_proto_init() - md_Module = File_cosmos_app_module_v1alpha1_module_proto.Messages().ByName("Module") -} - -var _ protoreflect.Message = (*fastReflection_Module)(nil) - -type fastReflection_Module Module - -func (x *Module) ProtoReflect() protoreflect.Message { - return (*fastReflection_Module)(x) -} - -func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_app_module_v1alpha1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Module_messageType fastReflection_Module_messageType -var _ protoreflect.MessageType = fastReflection_Module_messageType{} - -type fastReflection_Module_messageType struct{} - -func (x fastReflection_Module_messageType) Zero() protoreflect.Message { - return (*fastReflection_Module)(nil) -} -func (x fastReflection_Module_messageType) New() protoreflect.Message { - return new(fastReflection_Module) -} -func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// 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_Module) Type() protoreflect.MessageType { - return _fastReflection_Module_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Module) New() protoreflect.Message { - return new(fastReflection_Module) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { - return (*Module)(x) -} - -// 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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.module.v1alpha1.Module")) - } - panic(fmt.Errorf("message cosmos.app.module.v1alpha1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.app.module.v1alpha1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = 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().(*Module) - 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 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().(*Module) - 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: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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/module/v1alpha1/module.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) -) - -// Module is the module config object for the cosmos.app v1 app module. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_app_module_v1alpha1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_cosmos_app_module_v1alpha1_module_proto_rawDescGZIP(), []int{0} -} - -var File_cosmos_app_module_v1alpha1_module_proto protoreflect.FileDescriptor - -var file_cosmos_app_module_v1alpha1_module_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x49, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x3a, 0x3f, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x39, 0x0a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x70, 0x12, 0x15, 0x0a, 0x13, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x42, 0x84, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x41, 0x4d, 0xaa, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x70, 0x70, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xca, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, - 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, - 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_cosmos_app_module_v1alpha1_module_proto_rawDescOnce sync.Once - file_cosmos_app_module_v1alpha1_module_proto_rawDescData = file_cosmos_app_module_v1alpha1_module_proto_rawDesc -) - -func file_cosmos_app_module_v1alpha1_module_proto_rawDescGZIP() []byte { - file_cosmos_app_module_v1alpha1_module_proto_rawDescOnce.Do(func() { - file_cosmos_app_module_v1alpha1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_app_module_v1alpha1_module_proto_rawDescData) - }) - return file_cosmos_app_module_v1alpha1_module_proto_rawDescData -} - -var file_cosmos_app_module_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_app_module_v1alpha1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: cosmos.app.module.v1alpha1.Module -} -var file_cosmos_app_module_v1alpha1_module_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_cosmos_app_module_v1alpha1_module_proto_init() } -func file_cosmos_app_module_v1alpha1_module_proto_init() { - if File_cosmos_app_module_v1alpha1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_app_module_v1alpha1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); 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{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_app_module_v1alpha1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_app_module_v1alpha1_module_proto_goTypes, - DependencyIndexes: file_cosmos_app_module_v1alpha1_module_proto_depIdxs, - MessageInfos: file_cosmos_app_module_v1alpha1_module_proto_msgTypes, - }.Build() - File_cosmos_app_module_v1alpha1_module_proto = out.File - file_cosmos_app_module_v1alpha1_module_proto_rawDesc = nil - file_cosmos_app_module_v1alpha1_module_proto_goTypes = nil - file_cosmos_app_module_v1alpha1_module_proto_depIdxs = nil -} diff --git a/api/cosmos/base/runtime/v1/module.pulsar.go b/api/cosmos/app/runtime/v1alpha1/module.pulsar.go similarity index 77% rename from api/cosmos/base/runtime/v1/module.pulsar.go rename to api/cosmos/app/runtime/v1alpha1/module.pulsar.go index a0b59fc18d0c..31a1eb521eab 100644 --- a/api/cosmos/base/runtime/v1/module.pulsar.go +++ b/api/cosmos/app/runtime/v1alpha1/module.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package runtimev1 +package runtimev1alpha1 import ( fmt "fmt" @@ -160,8 +160,8 @@ var ( ) func init() { - file_cosmos_base_runtime_v1_module_proto_init() - md_Module = File_cosmos_base_runtime_v1_module_proto.Messages().ByName("Module") + file_cosmos_app_runtime_v1alpha1_module_proto_init() + md_Module = File_cosmos_app_runtime_v1alpha1_module_proto.Messages().ByName("Module") fd_Module_app_name = md_Module.Fields().ByName("app_name") fd_Module_begin_blockers = md_Module.Fields().ByName("begin_blockers") fd_Module_end_blockers = md_Module.Fields().ByName("end_blockers") @@ -177,7 +177,7 @@ func (x *Module) ProtoReflect() protoreflect.Message { } func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_base_runtime_v1_module_proto_msgTypes[0] + mi := &file_cosmos_app_runtime_v1alpha1_module_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -272,19 +272,19 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.base.runtime.v1.Module.app_name": + case "cosmos.app.runtime.v1alpha1.Module.app_name": return x.AppName != "" - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": return len(x.BeginBlockers) != 0 - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": return len(x.EndBlockers) != 0 - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": return len(x.InitGenesis) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", fd.FullName())) } } @@ -296,19 +296,19 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.base.runtime.v1.Module.app_name": + case "cosmos.app.runtime.v1alpha1.Module.app_name": x.AppName = "" - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": x.BeginBlockers = nil - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": x.EndBlockers = nil - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": x.InitGenesis = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", fd.FullName())) } } @@ -320,22 +320,22 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.base.runtime.v1.Module.app_name": + case "cosmos.app.runtime.v1alpha1.Module.app_name": value := x.AppName return protoreflect.ValueOfString(value) - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": if len(x.BeginBlockers) == 0 { return protoreflect.ValueOfList(&_Module_2_list{}) } listValue := &_Module_2_list{list: &x.BeginBlockers} return protoreflect.ValueOfList(listValue) - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": if len(x.EndBlockers) == 0 { return protoreflect.ValueOfList(&_Module_3_list{}) } listValue := &_Module_3_list{list: &x.EndBlockers} return protoreflect.ValueOfList(listValue) - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": if len(x.InitGenesis) == 0 { return protoreflect.ValueOfList(&_Module_4_list{}) } @@ -343,9 +343,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", descriptor.FullName())) } } @@ -361,25 +361,25 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.base.runtime.v1.Module.app_name": + case "cosmos.app.runtime.v1alpha1.Module.app_name": x.AppName = value.Interface().(string) - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": lv := value.List() clv := lv.(*_Module_2_list) x.BeginBlockers = *clv.list - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": lv := value.List() clv := lv.(*_Module_3_list) x.EndBlockers = *clv.list - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": lv := value.List() clv := lv.(*_Module_4_list) x.InitGenesis = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", fd.FullName())) } } @@ -395,31 +395,31 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": if x.BeginBlockers == nil { x.BeginBlockers = []string{} } value := &_Module_2_list{list: &x.BeginBlockers} return protoreflect.ValueOfList(value) - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": if x.EndBlockers == nil { x.EndBlockers = []string{} } value := &_Module_3_list{list: &x.EndBlockers} return protoreflect.ValueOfList(value) - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": if x.InitGenesis == nil { x.InitGenesis = []string{} } value := &_Module_4_list{list: &x.InitGenesis} return protoreflect.ValueOfList(value) - case "cosmos.base.runtime.v1.Module.app_name": - panic(fmt.Errorf("field app_name of message cosmos.base.runtime.v1.Module is not mutable")) + case "cosmos.app.runtime.v1alpha1.Module.app_name": + panic(fmt.Errorf("field app_name of message cosmos.app.runtime.v1alpha1.Module is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", fd.FullName())) } } @@ -428,22 +428,22 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.runtime.v1.Module.app_name": + case "cosmos.app.runtime.v1alpha1.Module.app_name": return protoreflect.ValueOfString("") - case "cosmos.base.runtime.v1.Module.begin_blockers": + case "cosmos.app.runtime.v1alpha1.Module.begin_blockers": list := []string{} return protoreflect.ValueOfList(&_Module_2_list{list: &list}) - case "cosmos.base.runtime.v1.Module.end_blockers": + case "cosmos.app.runtime.v1alpha1.Module.end_blockers": list := []string{} return protoreflect.ValueOfList(&_Module_3_list{list: &list}) - case "cosmos.base.runtime.v1.Module.init_genesis": + case "cosmos.app.runtime.v1alpha1.Module.init_genesis": list := []string{} return protoreflect.ValueOfList(&_Module_4_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.runtime.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) } - panic(fmt.Errorf("message cosmos.base.runtime.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.app.runtime.v1alpha1.Module does not contain field %s", fd.FullName())) } } @@ -453,7 +453,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.base.runtime.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.app.runtime.v1alpha1.Module", d.FullName())) } panic("unreachable") } @@ -809,7 +809,7 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/base/runtime/v1/module.proto +// source: cosmos/app/runtime/v1alpha1/module.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -832,7 +832,7 @@ type Module struct { func (x *Module) Reset() { *x = Module{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_base_runtime_v1_module_proto_msgTypes[0] + mi := &file_cosmos_app_runtime_v1alpha1_module_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -846,7 +846,7 @@ func (*Module) ProtoMessage() {} // Deprecated: Use Module.ProtoReflect.Descriptor instead. func (*Module) Descriptor() ([]byte, []int) { - return file_cosmos_base_runtime_v1_module_proto_rawDescGZIP(), []int{0} + return file_cosmos_app_runtime_v1alpha1_module_proto_rawDescGZIP(), []int{0} } func (x *Module) GetAppName() string { @@ -877,62 +877,66 @@ func (x *Module) GetInitGenesis() []string { return nil } -var File_cosmos_base_runtime_v1_module_proto protoreflect.FileDescriptor - -var file_cosmos_base_runtime_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xc6, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, - 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, - 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x62, - 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, - 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, - 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x61, 0x70, 0x70, - 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0xe7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x52, 0xaa, - 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, - 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_app_runtime_v1alpha1_module_proto protoreflect.FileDescriptor + +var file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01, 0x0a, 0x06, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x25, 0x0a, 0x0e, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, + 0x74, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x3a, 0x43, 0xba, 0xc0, + 0x96, 0xda, 0x01, 0x3d, 0x0a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x13, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x42, 0x8b, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x3b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x56, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x41, 0x70, 0x70, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, + 0x70, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x52, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_base_runtime_v1_module_proto_rawDescOnce sync.Once - file_cosmos_base_runtime_v1_module_proto_rawDescData = file_cosmos_base_runtime_v1_module_proto_rawDesc + file_cosmos_app_runtime_v1alpha1_module_proto_rawDescOnce sync.Once + file_cosmos_app_runtime_v1alpha1_module_proto_rawDescData = file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc ) -func file_cosmos_base_runtime_v1_module_proto_rawDescGZIP() []byte { - file_cosmos_base_runtime_v1_module_proto_rawDescOnce.Do(func() { - file_cosmos_base_runtime_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_base_runtime_v1_module_proto_rawDescData) +func file_cosmos_app_runtime_v1alpha1_module_proto_rawDescGZIP() []byte { + file_cosmos_app_runtime_v1alpha1_module_proto_rawDescOnce.Do(func() { + file_cosmos_app_runtime_v1alpha1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_app_runtime_v1alpha1_module_proto_rawDescData) }) - return file_cosmos_base_runtime_v1_module_proto_rawDescData + return file_cosmos_app_runtime_v1alpha1_module_proto_rawDescData } -var file_cosmos_base_runtime_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_base_runtime_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: cosmos.base.runtime.v1.Module +var file_cosmos_app_runtime_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_app_runtime_v1alpha1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.app.runtime.v1alpha1.Module } -var file_cosmos_base_runtime_v1_module_proto_depIdxs = []int32{ +var file_cosmos_app_runtime_v1alpha1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -940,13 +944,13 @@ var file_cosmos_base_runtime_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_base_runtime_v1_module_proto_init() } -func file_cosmos_base_runtime_v1_module_proto_init() { - if File_cosmos_base_runtime_v1_module_proto != nil { +func init() { file_cosmos_app_runtime_v1alpha1_module_proto_init() } +func file_cosmos_app_runtime_v1alpha1_module_proto_init() { + if File_cosmos_app_runtime_v1alpha1_module_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_base_runtime_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_app_runtime_v1alpha1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Module); i { case 0: return &v.state @@ -963,18 +967,18 @@ func file_cosmos_base_runtime_v1_module_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_base_runtime_v1_module_proto_rawDesc, + RawDescriptor: file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_base_runtime_v1_module_proto_goTypes, - DependencyIndexes: file_cosmos_base_runtime_v1_module_proto_depIdxs, - MessageInfos: file_cosmos_base_runtime_v1_module_proto_msgTypes, + GoTypes: file_cosmos_app_runtime_v1alpha1_module_proto_goTypes, + DependencyIndexes: file_cosmos_app_runtime_v1alpha1_module_proto_depIdxs, + MessageInfos: file_cosmos_app_runtime_v1alpha1_module_proto_msgTypes, }.Build() - File_cosmos_base_runtime_v1_module_proto = out.File - file_cosmos_base_runtime_v1_module_proto_rawDesc = nil - file_cosmos_base_runtime_v1_module_proto_goTypes = nil - file_cosmos_base_runtime_v1_module_proto_depIdxs = nil + File_cosmos_app_runtime_v1alpha1_module_proto = out.File + file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc = nil + file_cosmos_app_runtime_v1alpha1_module_proto_goTypes = nil + file_cosmos_app_runtime_v1alpha1_module_proto_depIdxs = nil } diff --git a/proto/cosmos/app/module/v1alpha1/module.proto b/proto/cosmos/app/module/v1alpha1/module.proto deleted file mode 100644 index 487e195c3263..000000000000 --- a/proto/cosmos/app/module/v1alpha1/module.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.module.v1alpha1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the module config object for the cosmos.app v1 app module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/app" - use_package: {name: "cosmos.app.v1alpha1"} - }; -} diff --git a/proto/cosmos/base/runtime/v1/module.proto b/proto/cosmos/app/runtime/v1alpha1/module.proto similarity index 65% rename from proto/cosmos/base/runtime/v1/module.proto rename to proto/cosmos/app/runtime/v1alpha1/module.proto index 24eb7222cb34..3d7314c546ff 100644 --- a/proto/cosmos/base/runtime/v1/module.proto +++ b/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -1,12 +1,13 @@ syntax = "proto3"; -package cosmos.base.runtime.v1; +package cosmos.app.runtime.v1alpha1; import "cosmos/app/v1alpha1/module.proto"; message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + go_import: "github.com/cosmos/cosmos-sdk/runtime" + use_package: {name: "cosmos.app.v1alpha1"} }; string app_name = 1; diff --git a/baseapp/runtime/app.go b/runtime/app.go similarity index 94% rename from baseapp/runtime/app.go rename to runtime/app.go index 55d6ff65fa0f..a5df2621a57b 100644 --- a/baseapp/runtime/app.go +++ b/runtime/app.go @@ -6,7 +6,7 @@ import ( "github.com/gogo/protobuf/grpc" abci "github.com/tendermint/tendermint/abci/types" - runtimev1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/runtime/v1" + runtimev1alpha1 "github.com/cosmos/cosmos-sdk/api/cosmos/app/runtime/v1alpha1" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server/api" @@ -19,7 +19,7 @@ import ( type App struct { *baseapp.BaseApp - config *runtimev1.Module + config *runtimev1alpha1.Module privateState *privateState mm *module.Manager beginBlockers []func(sdk.Context, abci.RequestBeginBlock) diff --git a/baseapp/runtime/builder.go b/runtime/builder.go similarity index 100% rename from baseapp/runtime/builder.go rename to runtime/builder.go diff --git a/baseapp/runtime/module.go b/runtime/module.go similarity index 95% rename from baseapp/runtime/module.go rename to runtime/module.go index 70a89b488687..f9631b742975 100644 --- a/baseapp/runtime/module.go +++ b/runtime/module.go @@ -6,8 +6,8 @@ import ( "github.com/gogo/protobuf/grpc" "cosmossdk.io/core/appmodule" + runtimev1alpha1 "github.com/cosmos/cosmos-sdk/api/cosmos/app/runtime/v1alpha1" - runtimev1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/runtime/v1" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -35,7 +35,7 @@ func (a *privateState) registerStoreKey(key storetypes.StoreKey) { } func init() { - appmodule.Register(&runtimev1.Module{}, + appmodule.Register(&runtimev1alpha1.Module{}, appmodule.Provide( provideBuilder, provideApp, @@ -76,7 +76,7 @@ func provideBuilder(moduleBasics map[string]module.AppModuleBasicWiringWrapper) } func provideApp( - config *runtimev1.Module, + config *runtimev1alpha1.Module, builder *privateState, modules map[string]module.AppModuleWiringWrapper, baseAppOptions []BaseAppOption, diff --git a/testutil/network/network.go b/testutil/network/network.go index fb476b4665dd..cb5238eb08a9 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -25,7 +25,6 @@ import ( "google.golang.org/grpc" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" @@ -35,6 +34,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" srvconfig "github.com/cosmos/cosmos-sdk/server/config" diff --git a/x/genutil/module.go b/x/genutil/module.go index 2ba277b860e4..0e6108170801 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -12,10 +12,10 @@ import ( "cosmossdk.io/core/appmodule" modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/genutil/module" "github.com/cosmos/cosmos-sdk/baseapp" - runtime2 "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + runtime2 "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/x/nft/client/testutil/app.yaml b/x/nft/client/testutil/app.yaml index b2fff994a02e..e879817f6dd0 100644 --- a/x/nft/client/testutil/app.yaml +++ b/x/nft/client/testutil/app.yaml @@ -1,7 +1,7 @@ modules: - name: runtime config: - "@type": cosmos.base.runtime.v1.Module + "@type": cosmos.app.runtime.v1alpha1.Module begin_blockers: [ staking, auth, bank, genutil, nft, params ] end_blockers: [ staking, auth, bank, genutil, nft, params ] init_genesis: [ auth, bank, staking, genutil, nft, params ] diff --git a/x/params/module.go b/x/params/module.go index fe8eec06d996..7db23a7c64b1 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -10,10 +10,10 @@ import ( abci "github.com/tendermint/tendermint/abci/types" modulev1 "github.com/cosmos/cosmos-sdk/api/cosmos/params/module/v1" + runtime2 "github.com/cosmos/cosmos-sdk/runtime" "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/baseapp" - runtime2 "github.com/cosmos/cosmos-sdk/baseapp/runtime" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" From d470341d7b57c4cd6b04a29ec36cee9c6e3d5c82 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 9 May 2022 11:38:03 -0400 Subject: [PATCH 6/6] update nft module.proto --- proto/cosmos/nft/module/v1/module.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proto/cosmos/nft/module/v1/module.proto b/proto/cosmos/nft/module/v1/module.proto index 681d19fb0e7e..84bd5761b5ea 100644 --- a/proto/cosmos/nft/module/v1/module.proto +++ b/proto/cosmos/nft/module/v1/module.proto @@ -6,6 +6,9 @@ import "cosmos/app/v1alpha1/module.proto"; message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/baseapp/runtime" + go_import: "github.com/cosmos/cosmos-sdk/x/nft/module" + use_package: { + name: "cosmos.nft.v1beta1" + } }; }