From ddfe66c19ffe4da8240a4dfb1420aba32366abee Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:46:25 -0700 Subject: [PATCH 01/25] chore: gen api --- api/regen/ecocredit/v1/tx.pulsar.go | 1490 ++++++++++++++++---- api/regen/ecocredit/v1/tx_grpc.pb.go | 40 + proto/regen/ecocredit/v1/tx.proto | 16 + x/ecocredit/core/codec.go | 1 + x/ecocredit/core/msg_new_credit_type.go | 47 + x/ecocredit/core/tx.pb.go | 550 +++++++- x/ecocredit/server/core/new_credit_type.go | 12 + 7 files changed, 1823 insertions(+), 333 deletions(-) create mode 100644 x/ecocredit/core/msg_new_credit_type.go create mode 100644 x/ecocredit/server/core/new_credit_type.go diff --git a/api/regen/ecocredit/v1/tx.pulsar.go b/api/regen/ecocredit/v1/tx.pulsar.go index 428bc58415..58ed08b7db 100644 --- a/api/regen/ecocredit/v1/tx.pulsar.go +++ b/api/regen/ecocredit/v1/tx.pulsar.go @@ -6900,7 +6900,7 @@ func (x *MsgSend_SendCredits) ProtoReflect() protoreflect.Message { } func (x *MsgSend_SendCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8486,7 +8486,7 @@ func (x *MsgRetire_RetireCredits) ProtoReflect() protoreflect.Message { } func (x *MsgRetire_RetireCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9884,7 +9884,7 @@ func (x *MsgCancel_CancelCredits) ProtoReflect() protoreflect.Message { } func (x *MsgCancel_CancelCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13598,179 +13598,1034 @@ func (x *fastReflection_MsgUpdateClassMetadataResponse) ProtoMethods() *protoifa } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: regen/ecocredit/v1/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +var ( + md_MsgNewCreditType protoreflect.MessageDescriptor + fd_MsgNewCreditType_root_address protoreflect.FieldDescriptor + fd_MsgNewCreditType_credit_type protoreflect.FieldDescriptor ) -// MsgCreateClass is the Msg/CreateClass request type. -type MsgCreateClass struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func init() { + file_regen_ecocredit_v1_tx_proto_init() + md_MsgNewCreditType = File_regen_ecocredit_v1_tx_proto.Messages().ByName("MsgNewCreditType") + fd_MsgNewCreditType_root_address = md_MsgNewCreditType.Fields().ByName("root_address") + fd_MsgNewCreditType_credit_type = md_MsgNewCreditType.Fields().ByName("credit_type") +} - // admin is the address of the account that created the credit class. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` - // issuers are the account addresses of the approved issuers. - Issuers []string `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` - // metadata is any arbitrary metadata to attached to the credit class. - Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - // credit_type_abbrev describes the abbreviation of a credit type (e.g. "C", - // "BIO"). - CreditTypeAbbrev string `protobuf:"bytes,4,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"` - // fee specifies the fee to pay for the creation of the credit class. - // acceptable fees for creating a credit class can be found in the governance - // parameters for the ecocredit module. - Fee *v1beta1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee,omitempty"` +var _ protoreflect.Message = (*fastReflection_MsgNewCreditType)(nil) + +type fastReflection_MsgNewCreditType MsgNewCreditType + +func (x *MsgNewCreditType) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNewCreditType)(x) } -func (x *MsgCreateClass) Reset() { - *x = MsgCreateClass{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[0] +func (x *MsgNewCreditType) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } + return mi.MessageOf(x) } -func (x *MsgCreateClass) String() string { - return protoimpl.X.MessageStringOf(x) -} +var _fastReflection_MsgNewCreditType_messageType fastReflection_MsgNewCreditType_messageType +var _ protoreflect.MessageType = fastReflection_MsgNewCreditType_messageType{} -func (*MsgCreateClass) ProtoMessage() {} +type fastReflection_MsgNewCreditType_messageType struct{} -// Deprecated: Use MsgCreateClass.ProtoReflect.Descriptor instead. -func (*MsgCreateClass) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{0} +func (x fastReflection_MsgNewCreditType_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNewCreditType)(nil) +} +func (x fastReflection_MsgNewCreditType_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNewCreditType) +} +func (x fastReflection_MsgNewCreditType_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNewCreditType } -func (x *MsgCreateClass) GetAdmin() string { - if x != nil { - return x.Admin - } - return "" +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNewCreditType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNewCreditType } -func (x *MsgCreateClass) GetIssuers() []string { - if x != nil { - return x.Issuers - } - return nil +// 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_MsgNewCreditType) Type() protoreflect.MessageType { + return _fastReflection_MsgNewCreditType_messageType } -func (x *MsgCreateClass) GetMetadata() string { - if x != nil { - return x.Metadata - } - return "" +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNewCreditType) New() protoreflect.Message { + return new(fastReflection_MsgNewCreditType) } -func (x *MsgCreateClass) GetCreditTypeAbbrev() string { - if x != nil { - return x.CreditTypeAbbrev - } - return "" +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNewCreditType) Interface() protoreflect.ProtoMessage { + return (*MsgNewCreditType)(x) } -func (x *MsgCreateClass) GetFee() *v1beta1.Coin { - if x != nil { - return x.Fee +// 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_MsgNewCreditType) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RootAddress != "" { + value := protoreflect.ValueOfString(x.RootAddress) + if !f(fd_MsgNewCreditType_root_address, value) { + return + } + } + if x.CreditType != nil { + value := protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + if !f(fd_MsgNewCreditType_credit_type, value) { + return + } } - return nil } -// MsgCreateClassResponse is the Msg/CreateClass response type. -type MsgCreateClassResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // class_id is the unique ID of the newly created credit class. - ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` +// 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_MsgNewCreditType) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + return x.RootAddress != "" + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + return x.CreditType != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) + } } -func (x *MsgCreateClassResponse) Reset() { - *x = MsgCreateClassResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +// 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_MsgNewCreditType) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + x.RootAddress = "" + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + x.CreditType = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) } } -func (x *MsgCreateClassResponse) String() string { - return protoimpl.X.MessageStringOf(x) +// 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_MsgNewCreditType) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + value := x.RootAddress + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + value := x.CreditType + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", descriptor.FullName())) + } } -func (*MsgCreateClassResponse) ProtoMessage() {} - -// Deprecated: Use MsgCreateClassResponse.ProtoReflect.Descriptor instead. -func (*MsgCreateClassResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{1} +// 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_MsgNewCreditType) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + x.RootAddress = value.Interface().(string) + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + x.CreditType = value.Message().Interface().(*CreditType) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) + } } -func (x *MsgCreateClassResponse) GetClassId() string { - if x != nil { - return x.ClassId +// 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_MsgNewCreditType) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + if x.CreditType == nil { + x.CreditType = new(CreditType) + } + return protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + panic(fmt.Errorf("field root_address of message regen.ecocredit.v1.MsgNewCreditType is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) } - return "" } -// MsgCreateProjectResponse is the Msg/CreateProject request type. -type MsgCreateProject struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // issuer is the address of an approved issuer for the credit class through - // which batches will be issued. It is not required, however, that this same - // issuer issue all batches for a project. - Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` - // class_id is the unique ID of the class within which the project is created. - ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - // metadata is any arbitrary metadata attached to the project. - Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - // project_location is the location of the project backing the credits in this - // batch. It is a string of the form - // [-[ ]], with the first two - // fields conforming to ISO 3166-2, and postal-code being up to 64 - // alphanumeric characters. country-code is required, while sub-national-code - // and postal-code can be added for increasing precision. - ProjectLocation string `protobuf:"bytes,4,opt,name=project_location,json=projectLocation,proto3" json:"project_location,omitempty"` - // project_id is an optional user-specified project ID which can be used - // instead of an auto-generated ID. If project_id is provided, it must be - // unique within the credit class and match the regex [A-Za-z0-9]{2,16} - // or else the operation will fail. If project_id is omitted an ID will - // automatically be generated. - ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` +// 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_MsgNewCreditType) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.MsgNewCreditType.root_address": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.MsgNewCreditType.credit_type": + m := new(CreditType) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) + } } -func (x *MsgCreateProject) Reset() { - *x = MsgCreateProject{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +// 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_MsgNewCreditType) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.MsgNewCreditType", d.FullName())) } + panic("unreachable") } -func (x *MsgCreateProject) String() string { - return protoimpl.X.MessageStringOf(x) +// 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_MsgNewCreditType) GetUnknown() protoreflect.RawFields { + return x.unknownFields } -func (*MsgCreateProject) ProtoMessage() {} - -// Deprecated: Use MsgCreateProject.ProtoReflect.Descriptor instead. -func (*MsgCreateProject) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{2} +// 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_MsgNewCreditType) 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_MsgNewCreditType) 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_MsgNewCreditType) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNewCreditType) + 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.RootAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CreditType != nil { + l = options.Size(x.CreditType) + 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().(*MsgNewCreditType) + 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 x.CreditType != nil { + encoded, err := options.Marshal(x.CreditType) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.RootAddress) > 0 { + i -= len(x.RootAddress) + copy(dAtA[i:], x.RootAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RootAddress))) + 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().(*MsgNewCreditType) + 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: MsgNewCreditType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNewCreditType: 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 RootAddress", 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.RootAddress = 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 CreditType", 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 + } + if x.CreditType == nil { + x.CreditType = &CreditType{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreditType); 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 ( + md_MsgNewCreditTypeResponse protoreflect.MessageDescriptor +) + +func init() { + file_regen_ecocredit_v1_tx_proto_init() + md_MsgNewCreditTypeResponse = File_regen_ecocredit_v1_tx_proto.Messages().ByName("MsgNewCreditTypeResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgNewCreditTypeResponse)(nil) + +type fastReflection_MsgNewCreditTypeResponse MsgNewCreditTypeResponse + +func (x *MsgNewCreditTypeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNewCreditTypeResponse)(x) +} + +func (x *MsgNewCreditTypeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] + 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_MsgNewCreditTypeResponse_messageType fastReflection_MsgNewCreditTypeResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgNewCreditTypeResponse_messageType{} + +type fastReflection_MsgNewCreditTypeResponse_messageType struct{} + +func (x fastReflection_MsgNewCreditTypeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNewCreditTypeResponse)(nil) +} +func (x fastReflection_MsgNewCreditTypeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNewCreditTypeResponse) +} +func (x fastReflection_MsgNewCreditTypeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNewCreditTypeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNewCreditTypeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNewCreditTypeResponse +} + +// 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_MsgNewCreditTypeResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgNewCreditTypeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNewCreditTypeResponse) New() protoreflect.Message { + return new(fastReflection_MsgNewCreditTypeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNewCreditTypeResponse) Interface() protoreflect.ProtoMessage { + return (*MsgNewCreditTypeResponse)(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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.MsgNewCreditTypeResponse", 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNewCreditTypeResponse) + 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().(*MsgNewCreditTypeResponse) + 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().(*MsgNewCreditTypeResponse) + 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: MsgNewCreditTypeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNewCreditTypeResponse: 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: regen/ecocredit/v1/tx.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) +) + +// MsgCreateClass is the Msg/CreateClass request type. +type MsgCreateClass struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // admin is the address of the account that created the credit class. + Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // issuers are the account addresses of the approved issuers. + Issuers []string `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` + // metadata is any arbitrary metadata to attached to the credit class. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // credit_type_abbrev describes the abbreviation of a credit type (e.g. "C", + // "BIO"). + CreditTypeAbbrev string `protobuf:"bytes,4,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"` + // fee specifies the fee to pay for the creation of the credit class. + // acceptable fees for creating a credit class can be found in the governance + // parameters for the ecocredit module. + Fee *v1beta1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee,omitempty"` +} + +func (x *MsgCreateClass) Reset() { + *x = MsgCreateClass{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateClass) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateClass) ProtoMessage() {} + +// Deprecated: Use MsgCreateClass.ProtoReflect.Descriptor instead. +func (*MsgCreateClass) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgCreateClass) GetAdmin() string { + if x != nil { + return x.Admin + } + return "" +} + +func (x *MsgCreateClass) GetIssuers() []string { + if x != nil { + return x.Issuers + } + return nil +} + +func (x *MsgCreateClass) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +func (x *MsgCreateClass) GetCreditTypeAbbrev() string { + if x != nil { + return x.CreditTypeAbbrev + } + return "" +} + +func (x *MsgCreateClass) GetFee() *v1beta1.Coin { + if x != nil { + return x.Fee + } + return nil +} + +// MsgCreateClassResponse is the Msg/CreateClass response type. +type MsgCreateClassResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // class_id is the unique ID of the newly created credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` +} + +func (x *MsgCreateClassResponse) Reset() { + *x = MsgCreateClassResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateClassResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateClassResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateClassResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateClassResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgCreateClassResponse) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +// MsgCreateProjectResponse is the Msg/CreateProject request type. +type MsgCreateProject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // issuer is the address of an approved issuer for the credit class through + // which batches will be issued. It is not required, however, that this same + // issuer issue all batches for a project. + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // class_id is the unique ID of the class within which the project is created. + ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // metadata is any arbitrary metadata attached to the project. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // project_location is the location of the project backing the credits in this + // batch. It is a string of the form + // [-[ ]], with the first two + // fields conforming to ISO 3166-2, and postal-code being up to 64 + // alphanumeric characters. country-code is required, while sub-national-code + // and postal-code can be added for increasing precision. + ProjectLocation string `protobuf:"bytes,4,opt,name=project_location,json=projectLocation,proto3" json:"project_location,omitempty"` + // project_id is an optional user-specified project ID which can be used + // instead of an auto-generated ID. If project_id is provided, it must be + // unique within the credit class and match the regex [A-Za-z0-9]{2,16} + // or else the operation will fail. If project_id is omitted an ID will + // automatically be generated. + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` +} + +func (x *MsgCreateProject) Reset() { + *x = MsgCreateProject{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateProject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateProject) ProtoMessage() {} + +// Deprecated: Use MsgCreateProject.ProtoReflect.Descriptor instead. +func (*MsgCreateProject) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{2} } func (x *MsgCreateProject) GetIssuer() string { @@ -14734,6 +15589,79 @@ func (*MsgUpdateClassMetadataResponse) Descriptor() ([]byte, []int) { return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{22} } +// MsgNewCreditType is the Msg/NewCreditType request type. +type MsgNewCreditType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // root_address should be the governance address. + RootAddress string `protobuf:"bytes,1,opt,name=root_address,json=rootAddress,proto3" json:"root_address,omitempty"` + // credit_type is the credit type to add. + CreditType *CreditType `protobuf:"bytes,2,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (x *MsgNewCreditType) Reset() { + *x = MsgNewCreditType{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNewCreditType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNewCreditType) ProtoMessage() {} + +// Deprecated: Use MsgNewCreditType.ProtoReflect.Descriptor instead. +func (*MsgNewCreditType) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{23} +} + +func (x *MsgNewCreditType) GetRootAddress() string { + if x != nil { + return x.RootAddress + } + return "" +} + +func (x *MsgNewCreditType) GetCreditType() *CreditType { + if x != nil { + return x.CreditType + } + return nil +} + +// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. +type MsgNewCreditTypeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgNewCreditTypeResponse) Reset() { + *x = MsgNewCreditTypeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNewCreditTypeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNewCreditTypeResponse) ProtoMessage() {} + +// Deprecated: Use MsgNewCreditTypeResponse.ProtoReflect.Descriptor instead. +func (*MsgNewCreditTypeResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{24} +} + // SendCredits specifies a batch and the number of credits being transferred. // This is split into tradable credits, which will remain tradable on receipt, // and retired credits, which will be retired on receipt. @@ -14764,7 +15692,7 @@ type MsgSend_SendCredits struct { func (x *MsgSend_SendCredits) Reset() { *x = MsgSend_SendCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14826,7 +15754,7 @@ type MsgRetire_RetireCredits struct { func (x *MsgRetire_RetireCredits) Reset() { *x = MsgRetire_RetireCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14874,7 +15802,7 @@ type MsgCancel_CancelCredits struct { func (x *MsgCancel_CancelCredits) Reset() { *x = MsgCancel_CancelCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14917,6 +15845,8 @@ var file_regen_ecocredit_v1_tx_proto_rawDesc = []byte{ 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, @@ -15082,89 +16012,104 @@ var file_regen_ecocredit_v1_tx_proto_rawDesc = []byte{ 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xb2, 0x08, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5d, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x67, - 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x2c, 0x2e, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x76, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x6f, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x4e, 0x65, + 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x97, 0x09, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5d, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x2a, + 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x4d, 0x69, - 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x12, 0x27, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5d, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x53, 0x65, 0x61, 0x6c, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, - 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x28, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x48, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, + 0x0a, 0x10, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x73, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x1a, 0x2f, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, + 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x23, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x52, - 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x74, 0x69, 0x72, 0x65, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x74, - 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, - 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x12, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x12, - 0x29, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x1a, 0x31, 0x2e, 0x72, 0x65, 0x67, + 0x73, 0x67, 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x28, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1b, 0x2e, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x23, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, - 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4e, 0x0a, 0x06, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4e, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6c, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x1a, 0x2f, 0x2e, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, + 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x1a, 0x31, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x75, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x1a, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x1a, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd5, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, - 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, - 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x43, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, + 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd5, 0x01, + 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, + 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, + 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, + 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -15179,7 +16124,7 @@ func file_regen_ecocredit_v1_tx_proto_rawDescGZIP() []byte { return file_regen_ecocredit_v1_tx_proto_rawDescData } -var file_regen_ecocredit_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_regen_ecocredit_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_regen_ecocredit_v1_tx_proto_goTypes = []interface{}{ (*MsgCreateClass)(nil), // 0: regen.ecocredit.v1.MsgCreateClass (*MsgCreateClassResponse)(nil), // 1: regen.ecocredit.v1.MsgCreateClassResponse @@ -15204,51 +16149,57 @@ var file_regen_ecocredit_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateClassIssuersResponse)(nil), // 20: regen.ecocredit.v1.MsgUpdateClassIssuersResponse (*MsgUpdateClassMetadata)(nil), // 21: regen.ecocredit.v1.MsgUpdateClassMetadata (*MsgUpdateClassMetadataResponse)(nil), // 22: regen.ecocredit.v1.MsgUpdateClassMetadataResponse - (*MsgSend_SendCredits)(nil), // 23: regen.ecocredit.v1.MsgSend.SendCredits - (*MsgRetire_RetireCredits)(nil), // 24: regen.ecocredit.v1.MsgRetire.RetireCredits - (*MsgCancel_CancelCredits)(nil), // 25: regen.ecocredit.v1.MsgCancel.CancelCredits - (*v1beta1.Coin)(nil), // 26: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp - (*OriginTx)(nil), // 28: regen.ecocredit.v1.OriginTx + (*MsgNewCreditType)(nil), // 23: regen.ecocredit.v1.MsgNewCreditType + (*MsgNewCreditTypeResponse)(nil), // 24: regen.ecocredit.v1.MsgNewCreditTypeResponse + (*MsgSend_SendCredits)(nil), // 25: regen.ecocredit.v1.MsgSend.SendCredits + (*MsgRetire_RetireCredits)(nil), // 26: regen.ecocredit.v1.MsgRetire.RetireCredits + (*MsgCancel_CancelCredits)(nil), // 27: regen.ecocredit.v1.MsgCancel.CancelCredits + (*v1beta1.Coin)(nil), // 28: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp + (*OriginTx)(nil), // 30: regen.ecocredit.v1.OriginTx + (*CreditType)(nil), // 31: regen.ecocredit.v1.CreditType } var file_regen_ecocredit_v1_tx_proto_depIdxs = []int32{ - 26, // 0: regen.ecocredit.v1.MsgCreateClass.fee:type_name -> cosmos.base.v1beta1.Coin + 28, // 0: regen.ecocredit.v1.MsgCreateClass.fee:type_name -> cosmos.base.v1beta1.Coin 5, // 1: regen.ecocredit.v1.MsgCreateBatch.issuance:type_name -> regen.ecocredit.v1.BatchIssuance - 27, // 2: regen.ecocredit.v1.MsgCreateBatch.start_date:type_name -> google.protobuf.Timestamp - 27, // 3: regen.ecocredit.v1.MsgCreateBatch.end_date:type_name -> google.protobuf.Timestamp - 28, // 4: regen.ecocredit.v1.MsgCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 29, // 2: regen.ecocredit.v1.MsgCreateBatch.start_date:type_name -> google.protobuf.Timestamp + 29, // 3: regen.ecocredit.v1.MsgCreateBatch.end_date:type_name -> google.protobuf.Timestamp + 30, // 4: regen.ecocredit.v1.MsgCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx 5, // 5: regen.ecocredit.v1.MsgMintBatchCredits.issuance:type_name -> regen.ecocredit.v1.BatchIssuance - 28, // 6: regen.ecocredit.v1.MsgMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx - 23, // 7: regen.ecocredit.v1.MsgSend.credits:type_name -> regen.ecocredit.v1.MsgSend.SendCredits - 24, // 8: regen.ecocredit.v1.MsgRetire.credits:type_name -> regen.ecocredit.v1.MsgRetire.RetireCredits - 25, // 9: regen.ecocredit.v1.MsgCancel.credits:type_name -> regen.ecocredit.v1.MsgCancel.CancelCredits - 0, // 10: regen.ecocredit.v1.Msg.CreateClass:input_type -> regen.ecocredit.v1.MsgCreateClass - 2, // 11: regen.ecocredit.v1.Msg.CreateProject:input_type -> regen.ecocredit.v1.MsgCreateProject - 4, // 12: regen.ecocredit.v1.Msg.CreateBatch:input_type -> regen.ecocredit.v1.MsgCreateBatch - 7, // 13: regen.ecocredit.v1.Msg.MintBatchCredits:input_type -> regen.ecocredit.v1.MsgMintBatchCredits - 8, // 14: regen.ecocredit.v1.Msg.SealBatch:input_type -> regen.ecocredit.v1.MsgSealBatch - 11, // 15: regen.ecocredit.v1.Msg.Send:input_type -> regen.ecocredit.v1.MsgSend - 13, // 16: regen.ecocredit.v1.Msg.Retire:input_type -> regen.ecocredit.v1.MsgRetire - 15, // 17: regen.ecocredit.v1.Msg.Cancel:input_type -> regen.ecocredit.v1.MsgCancel - 17, // 18: regen.ecocredit.v1.Msg.UpdateClassAdmin:input_type -> regen.ecocredit.v1.MsgUpdateClassAdmin - 19, // 19: regen.ecocredit.v1.Msg.UpdateClassIssuers:input_type -> regen.ecocredit.v1.MsgUpdateClassIssuers - 21, // 20: regen.ecocredit.v1.Msg.UpdateClassMetadata:input_type -> regen.ecocredit.v1.MsgUpdateClassMetadata - 1, // 21: regen.ecocredit.v1.Msg.CreateClass:output_type -> regen.ecocredit.v1.MsgCreateClassResponse - 3, // 22: regen.ecocredit.v1.Msg.CreateProject:output_type -> regen.ecocredit.v1.MsgCreateProjectResponse - 6, // 23: regen.ecocredit.v1.Msg.CreateBatch:output_type -> regen.ecocredit.v1.MsgCreateBatchResponse - 9, // 24: regen.ecocredit.v1.Msg.MintBatchCredits:output_type -> regen.ecocredit.v1.MsgMintBatchCreditsResponse - 10, // 25: regen.ecocredit.v1.Msg.SealBatch:output_type -> regen.ecocredit.v1.MsgSealBatchResponse - 12, // 26: regen.ecocredit.v1.Msg.Send:output_type -> regen.ecocredit.v1.MsgSendResponse - 14, // 27: regen.ecocredit.v1.Msg.Retire:output_type -> regen.ecocredit.v1.MsgRetireResponse - 16, // 28: regen.ecocredit.v1.Msg.Cancel:output_type -> regen.ecocredit.v1.MsgCancelResponse - 18, // 29: regen.ecocredit.v1.Msg.UpdateClassAdmin:output_type -> regen.ecocredit.v1.MsgUpdateClassAdminResponse - 20, // 30: regen.ecocredit.v1.Msg.UpdateClassIssuers:output_type -> regen.ecocredit.v1.MsgUpdateClassIssuersResponse - 22, // 31: regen.ecocredit.v1.Msg.UpdateClassMetadata:output_type -> regen.ecocredit.v1.MsgUpdateClassMetadataResponse - 21, // [21:32] is the sub-list for method output_type - 10, // [10:21] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 30, // 6: regen.ecocredit.v1.MsgMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 25, // 7: regen.ecocredit.v1.MsgSend.credits:type_name -> regen.ecocredit.v1.MsgSend.SendCredits + 26, // 8: regen.ecocredit.v1.MsgRetire.credits:type_name -> regen.ecocredit.v1.MsgRetire.RetireCredits + 27, // 9: regen.ecocredit.v1.MsgCancel.credits:type_name -> regen.ecocredit.v1.MsgCancel.CancelCredits + 31, // 10: regen.ecocredit.v1.MsgNewCreditType.credit_type:type_name -> regen.ecocredit.v1.CreditType + 0, // 11: regen.ecocredit.v1.Msg.CreateClass:input_type -> regen.ecocredit.v1.MsgCreateClass + 2, // 12: regen.ecocredit.v1.Msg.CreateProject:input_type -> regen.ecocredit.v1.MsgCreateProject + 4, // 13: regen.ecocredit.v1.Msg.CreateBatch:input_type -> regen.ecocredit.v1.MsgCreateBatch + 7, // 14: regen.ecocredit.v1.Msg.MintBatchCredits:input_type -> regen.ecocredit.v1.MsgMintBatchCredits + 8, // 15: regen.ecocredit.v1.Msg.SealBatch:input_type -> regen.ecocredit.v1.MsgSealBatch + 11, // 16: regen.ecocredit.v1.Msg.Send:input_type -> regen.ecocredit.v1.MsgSend + 13, // 17: regen.ecocredit.v1.Msg.Retire:input_type -> regen.ecocredit.v1.MsgRetire + 15, // 18: regen.ecocredit.v1.Msg.Cancel:input_type -> regen.ecocredit.v1.MsgCancel + 17, // 19: regen.ecocredit.v1.Msg.UpdateClassAdmin:input_type -> regen.ecocredit.v1.MsgUpdateClassAdmin + 19, // 20: regen.ecocredit.v1.Msg.UpdateClassIssuers:input_type -> regen.ecocredit.v1.MsgUpdateClassIssuers + 21, // 21: regen.ecocredit.v1.Msg.UpdateClassMetadata:input_type -> regen.ecocredit.v1.MsgUpdateClassMetadata + 23, // 22: regen.ecocredit.v1.Msg.NewCreditType:input_type -> regen.ecocredit.v1.MsgNewCreditType + 1, // 23: regen.ecocredit.v1.Msg.CreateClass:output_type -> regen.ecocredit.v1.MsgCreateClassResponse + 3, // 24: regen.ecocredit.v1.Msg.CreateProject:output_type -> regen.ecocredit.v1.MsgCreateProjectResponse + 6, // 25: regen.ecocredit.v1.Msg.CreateBatch:output_type -> regen.ecocredit.v1.MsgCreateBatchResponse + 9, // 26: regen.ecocredit.v1.Msg.MintBatchCredits:output_type -> regen.ecocredit.v1.MsgMintBatchCreditsResponse + 10, // 27: regen.ecocredit.v1.Msg.SealBatch:output_type -> regen.ecocredit.v1.MsgSealBatchResponse + 12, // 28: regen.ecocredit.v1.Msg.Send:output_type -> regen.ecocredit.v1.MsgSendResponse + 14, // 29: regen.ecocredit.v1.Msg.Retire:output_type -> regen.ecocredit.v1.MsgRetireResponse + 16, // 30: regen.ecocredit.v1.Msg.Cancel:output_type -> regen.ecocredit.v1.MsgCancelResponse + 18, // 31: regen.ecocredit.v1.Msg.UpdateClassAdmin:output_type -> regen.ecocredit.v1.MsgUpdateClassAdminResponse + 20, // 32: regen.ecocredit.v1.Msg.UpdateClassIssuers:output_type -> regen.ecocredit.v1.MsgUpdateClassIssuersResponse + 22, // 33: regen.ecocredit.v1.Msg.UpdateClassMetadata:output_type -> regen.ecocredit.v1.MsgUpdateClassMetadataResponse + 24, // 34: regen.ecocredit.v1.Msg.NewCreditType:output_type -> regen.ecocredit.v1.MsgNewCreditTypeResponse + 23, // [23:35] is the sub-list for method output_type + 11, // [11:23] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_regen_ecocredit_v1_tx_proto_init() } @@ -15256,6 +16207,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { if File_regen_ecocredit_v1_tx_proto != nil { return } + file_regen_ecocredit_v1_state_proto_init() file_regen_ecocredit_v1_types_proto_init() if !protoimpl.UnsafeEnabled { file_regen_ecocredit_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -15535,7 +16487,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { } } file_regen_ecocredit_v1_tx_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSend_SendCredits); i { + switch v := v.(*MsgNewCreditType); i { case 0: return &v.state case 1: @@ -15547,7 +16499,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { } } file_regen_ecocredit_v1_tx_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRetire_RetireCredits); i { + switch v := v.(*MsgNewCreditTypeResponse); i { case 0: return &v.state case 1: @@ -15559,6 +16511,30 @@ func file_regen_ecocredit_v1_tx_proto_init() { } } file_regen_ecocredit_v1_tx_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSend_SendCredits); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_v1_tx_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRetire_RetireCredits); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_v1_tx_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgCancel_CancelCredits); i { case 0: return &v.state @@ -15577,7 +16553,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 26, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/api/regen/ecocredit/v1/tx_grpc.pb.go b/api/regen/ecocredit/v1/tx_grpc.pb.go index 1b41ed10ff..3f8ab17372 100644 --- a/api/regen/ecocredit/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1/tx_grpc.pb.go @@ -59,6 +59,9 @@ type MsgClient interface { UpdateClassIssuers(ctx context.Context, in *MsgUpdateClassIssuers, opts ...grpc.CallOption) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassMetadata, opts ...grpc.CallOption) (*MsgUpdateClassMetadataResponse, error) + // NewCreditType is a governance only method that adds a new credit type to + // the chain. + NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) } type msgClient struct { @@ -168,6 +171,15 @@ func (c *msgClient) UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassM return out, nil } +func (c *msgClient) NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) { + out := new(MsgNewCreditTypeResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1.Msg/NewCreditType", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -209,6 +221,9 @@ type MsgServer interface { UpdateClassIssuers(context.Context, *MsgUpdateClassIssuers) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) + // NewCreditType is a governance only method that adds a new credit type to + // the chain. + NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) mustEmbedUnimplementedMsgServer() } @@ -249,6 +264,9 @@ func (UnimplementedMsgServer) UpdateClassIssuers(context.Context, *MsgUpdateClas func (UnimplementedMsgServer) UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateClassMetadata not implemented") } +func (UnimplementedMsgServer) NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewCreditType not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -460,6 +478,24 @@ func _Msg_UpdateClassMetadata_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_NewCreditType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNewCreditType) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NewCreditType(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1.Msg/NewCreditType", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NewCreditType(ctx, req.(*MsgNewCreditType)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -511,6 +547,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateClassMetadata", Handler: _Msg_UpdateClassMetadata_Handler, }, + { + MethodName: "NewCreditType", + Handler: _Msg_NewCreditType_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/v1/tx.proto", diff --git a/proto/regen/ecocredit/v1/tx.proto b/proto/regen/ecocredit/v1/tx.proto index e17ab5403d..41bf443ba8 100644 --- a/proto/regen/ecocredit/v1/tx.proto +++ b/proto/regen/ecocredit/v1/tx.proto @@ -5,6 +5,7 @@ package regen.ecocredit.v1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "regen/ecocredit/v1/state.proto"; import "regen/ecocredit/v1/types.proto"; option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/core"; @@ -63,6 +64,10 @@ service Msg { // UpdateClassMetadata updates the credit class metadata rpc UpdateClassMetadata(MsgUpdateClassMetadata) returns (MsgUpdateClassMetadataResponse); + + // NewCreditType is a governance only method that adds a new credit type to + // the chain. + rpc NewCreditType(MsgNewCreditType) returns (MsgNewCreditTypeResponse); } // MsgCreateClass is the Msg/CreateClass request type. @@ -379,3 +384,14 @@ message MsgUpdateClassMetadata { // MsgUpdateClassMetadataResponse is the MsgUpdateClassMetadata response type. message MsgUpdateClassMetadataResponse {} + +// MsgNewCreditType is the Msg/NewCreditType request type. +message MsgNewCreditType { + // root_address should be the governance address. + string root_address = 1; + // credit_type is the credit type to add. + CreditType credit_type = 2; +} + +// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. +message MsgNewCreditTypeResponse {} \ No newline at end of file diff --git a/x/ecocredit/core/codec.go b/x/ecocredit/core/codec.go index 2c0692e1a2..1c34e5a08b 100644 --- a/x/ecocredit/core/codec.go +++ b/x/ecocredit/core/codec.go @@ -21,4 +21,5 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateClassAdmin{}, "regen.core/MsgUpdateClassAdmin", nil) cdc.RegisterConcrete(&MsgUpdateClassMetadata{}, "regen.core/MsgUpdateClassMetadata", nil) cdc.RegisterConcrete(&MsgUpdateClassIssuers{}, "regen.core/MsgUpdateClassIssuers", nil) + cdc.RegisterConcrete(&MsgNewCreditType{}, "regen.core/MsgNewCreditType", nil) } diff --git a/x/ecocredit/core/msg_new_credit_type.go b/x/ecocredit/core/msg_new_credit_type.go new file mode 100644 index 0000000000..11e7c150d9 --- /dev/null +++ b/x/ecocredit/core/msg_new_credit_type.go @@ -0,0 +1,47 @@ +package core + +import ( + "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + + "github.com/regen-network/regen-ledger/x/ecocredit" +) + +var _ legacytx.LegacyMsg = &MsgNewCreditType{} + +func (m MsgNewCreditType) ValidateBasic() error { + if _, err := types.AccAddressFromBech32(m.RootAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + return m.CreditType.Validate() +} + +func (m MsgNewCreditType) GetSigners() []types.AccAddress { + addr, _ := types.AccAddressFromBech32(m.RootAddress) + return []types.AccAddress{addr} +} + +func (m MsgNewCreditType) GetSignBytes() []byte { + return types.MustSortJSON(ecocredit.ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgNewCreditType) Route() string { return types.MsgTypeURL(&m) } + +func (m MsgNewCreditType) Type() string { return types.MsgTypeURL(&m) } + +func (m CreditType) Validate() error { + if err := ValidateCreditTypeAbbreviation(m.Abbreviation); err != nil { + return err + } + if len(m.Name) == 0 { + return sdkerrors.ErrInvalidRequest.Wrap("name cannot be empty") + } + if len(m.Unit) == 0 { + return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") + } + if m.Precision != PRECISION { + return sdkerrors.ErrInvalidRequest.Wrapf("credit type precision is currently locked to %d", PRECISION) + } + return nil +} diff --git a/x/ecocredit/core/tx.pb.go b/x/ecocredit/core/tx.pb.go index 02041c35cf..594fd9ca8f 100644 --- a/x/ecocredit/core/tx.pb.go +++ b/x/ecocredit/core/tx.pb.go @@ -1569,6 +1569,98 @@ func (m *MsgUpdateClassMetadataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateClassMetadataResponse proto.InternalMessageInfo +// MsgNewCreditType is the Msg/NewCreditType request type. +type MsgNewCreditType struct { + // root_address should be the governance address. + RootAddress string `protobuf:"bytes,1,opt,name=root_address,json=rootAddress,proto3" json:"root_address,omitempty"` + // credit_type is the credit type to add. + CreditType *CreditType `protobuf:"bytes,2,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (m *MsgNewCreditType) Reset() { *m = MsgNewCreditType{} } +func (m *MsgNewCreditType) String() string { return proto.CompactTextString(m) } +func (*MsgNewCreditType) ProtoMessage() {} +func (*MsgNewCreditType) Descriptor() ([]byte, []int) { + return fileDescriptor_2b8ae49f50a3ddbd, []int{23} +} +func (m *MsgNewCreditType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNewCreditType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNewCreditType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgNewCreditType) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNewCreditType.Merge(m, src) +} +func (m *MsgNewCreditType) XXX_Size() int { + return m.Size() +} +func (m *MsgNewCreditType) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNewCreditType.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNewCreditType proto.InternalMessageInfo + +func (m *MsgNewCreditType) GetRootAddress() string { + if m != nil { + return m.RootAddress + } + return "" +} + +func (m *MsgNewCreditType) GetCreditType() *CreditType { + if m != nil { + return m.CreditType + } + return nil +} + +// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. +type MsgNewCreditTypeResponse struct { +} + +func (m *MsgNewCreditTypeResponse) Reset() { *m = MsgNewCreditTypeResponse{} } +func (m *MsgNewCreditTypeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgNewCreditTypeResponse) ProtoMessage() {} +func (*MsgNewCreditTypeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2b8ae49f50a3ddbd, []int{24} +} +func (m *MsgNewCreditTypeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNewCreditTypeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNewCreditTypeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgNewCreditTypeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNewCreditTypeResponse.Merge(m, src) +} +func (m *MsgNewCreditTypeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgNewCreditTypeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNewCreditTypeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNewCreditTypeResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateClass)(nil), "regen.ecocredit.v1.MsgCreateClass") proto.RegisterType((*MsgCreateClassResponse)(nil), "regen.ecocredit.v1.MsgCreateClassResponse") @@ -1596,87 +1688,94 @@ func init() { proto.RegisterType((*MsgUpdateClassIssuersResponse)(nil), "regen.ecocredit.v1.MsgUpdateClassIssuersResponse") proto.RegisterType((*MsgUpdateClassMetadata)(nil), "regen.ecocredit.v1.MsgUpdateClassMetadata") proto.RegisterType((*MsgUpdateClassMetadataResponse)(nil), "regen.ecocredit.v1.MsgUpdateClassMetadataResponse") + proto.RegisterType((*MsgNewCreditType)(nil), "regen.ecocredit.v1.MsgNewCreditType") + proto.RegisterType((*MsgNewCreditTypeResponse)(nil), "regen.ecocredit.v1.MsgNewCreditTypeResponse") } func init() { proto.RegisterFile("regen/ecocredit/v1/tx.proto", fileDescriptor_2b8ae49f50a3ddbd) } var fileDescriptor_2b8ae49f50a3ddbd = []byte{ - // 1190 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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 0x68, 0xe0, 0x89, 0xb8, 0xcb, 0xed, 0xb2, 0x92, 0x1c, 0x7a, 0xd6, 0x0e, - 0xd4, 0xc6, 0x9d, 0xd5, 0x41, 0xa6, 0x4d, 0x8d, 0x71, 0xd3, 0x9f, 0xf2, 0x23, 0x75, 0xdd, 0xc3, - 0xdc, 0x3d, 0x9e, 0x1a, 0x66, 0x9a, 0x29, 0x37, 0xc6, 0x84, 0x3e, 0x85, 0x52, 0x0c, 0xc4, 0xd4, - 0x25, 0xb5, 0x7c, 0x23, 0xdf, 0xac, 0x6c, 0xbf, 0x67, 0xdf, 0xec, 0x5f, 0x5b, 0xec, 0x71, 0xa8, - 0x80, 0x6d, 0x6d, 0x92, 0xca, 0x54, 0x61, 0x2c, 0x53, 0x9f, 0x01, 0x44, 0x1c, 0x87, 0xbc, 0xe3, - 0x61, 0x9e, 0x94, 0xdd, 0xb4, 0x65, 0xcb, 0xdb, 0x49, 0xcb, 0xdb, 0x47, 0x49, 0xcb, 0xef, 0x15, - 0x2e, 0xfe, 0xd9, 0x34, 0xda, 0x65, 0x61, 0xf3, 0x02, 0x73, 0x82, 0x3e, 0x81, 0x12, 0xa1, 0x9e, - 0x34, 0x5f, 0xb8, 0xa5, 0x79, 0x91, 0x50, 0x4f, 0x18, 0x23, 0x28, 0xb0, 0x01, 0xa1, 0xb5, 0x62, - 0xc3, 0x68, 0x96, 0xda, 0xe2, 0x1b, 0xed, 0x40, 0x99, 0x85, 0x81, 0x1f, 0xd0, 0x0e, 0x3f, 0xaf, - 0x95, 0x04, 0xe3, 0x83, 0x49, 0xd1, 0x7e, 0x25, 0x40, 0x47, 0xe7, 0xed, 0x12, 0x53, 0x5f, 0x31, - 0x1d, 0x65, 0x9c, 0xd4, 0xca, 0x22, 0x48, 0xf1, 0x6d, 0xfd, 0x62, 0x40, 0x35, 0x95, 0x18, 0xf4, - 0x00, 0xca, 0x21, 0x71, 0x83, 0x41, 0x40, 0x28, 0x4f, 0xaa, 0xa6, 0x05, 0xe8, 0x11, 0x2c, 0xf1, - 0x10, 0x7b, 0xb8, 0xdb, 0x23, 0x1d, 0xdc, 0x67, 0x27, 0x94, 0xab, 0x7a, 0x2c, 0x26, 0xe2, 0x5d, - 0x21, 0x45, 0x0f, 0x61, 0x31, 0x24, 0x3c, 0x08, 0x89, 0x97, 0xe0, 0x64, 0x17, 0x56, 0x95, 0x54, - 0xc1, 0x1c, 0x58, 0x91, 0x82, 0x3e, 0xa1, 0x37, 0xba, 0x11, 0x0d, 0x55, 0x49, 0x43, 0x5a, 0x3b, - 0x23, 0x87, 0x4a, 0x38, 0xae, 0xfb, 0x6d, 0x13, 0x2a, 0xdd, 0x58, 0xd0, 0xf1, 0x08, 0x65, 0x7d, - 0xe5, 0x3a, 0x08, 0xd1, 0x8b, 0x58, 0x62, 0xfd, 0x6d, 0xc0, 0x4a, 0x2b, 0xf2, 0x5b, 0x01, 0xe5, - 0xc2, 0x72, 0x5f, 0x24, 0x2b, 0x9a, 0xda, 0x76, 0x63, 0x84, 0xb9, 0x71, 0xc2, 0xbb, 0x36, 0x5e, - 0xaa, 0x94, 0x85, 0xff, 0x55, 0xca, 0xf9, 0x91, 0x52, 0x7e, 0x08, 0xef, 0xb4, 0x22, 0xff, 0x6b, - 0x82, 0x7b, 0x99, 0xa7, 0xc9, 0xda, 0x80, 0xf5, 0x09, 0x59, 0x48, 0xd2, 0x68, 0xad, 0xc1, 0xea, - 0x28, 0x8d, 0x96, 0xff, 0x9e, 0x83, 0xa2, 0x50, 0x50, 0x2f, 0xa6, 0x8e, 0x08, 0xf5, 0x86, 0xd4, - 0x72, 0x95, 0xee, 0x9d, 0xdc, 0x78, 0xef, 0xec, 0x42, 0x51, 0x06, 0x15, 0xa9, 0x6c, 0x3d, 0x9a, - 0x14, 0xad, 0xda, 0xc3, 0x8e, 0xff, 0x24, 0xbe, 0x25, 0x76, 0xe6, 0xaf, 0x06, 0x54, 0x46, 0x14, - 0x33, 0x6b, 0xfe, 0xf6, 0xfb, 0xf5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0x1e, 0x01, 0xb4, 0x92, - 0xab, 0xf5, 0x8d, 0x7d, 0xce, 0x78, 0xd1, 0x58, 0x0d, 0xa8, 0x4f, 0xde, 0x26, 0x71, 0x64, 0xfb, - 0xb7, 0x12, 0xe4, 0x5b, 0x91, 0x8f, 0xbe, 0x87, 0xca, 0xe8, 0x53, 0xd2, 0x9a, 0xd6, 0x6c, 0x43, - 0x8c, 0xf9, 0x64, 0x36, 0x46, 0x5f, 0x42, 0x2e, 0x54, 0xd3, 0x4f, 0xb7, 0x0f, 0x32, 0x8d, 0x15, - 0xca, 0x7c, 0x76, 0x1b, 0x94, 0xde, 0x44, 0xc7, 0x20, 0x07, 0x7d, 0x76, 0x0c, 0x02, 0x33, 0x23, - 0x86, 0xf4, 0x45, 0xda, 0x83, 0xe5, 0x1b, 0x77, 0xe4, 0xb4, 0x51, 0x3d, 0x0e, 0x34, 0x9d, 0x5b, - 0x02, 0xf5, 0x6e, 0xdf, 0x42, 0x79, 0x78, 0x67, 0x35, 0xa6, 0xde, 0x08, 0x0a, 0x61, 0x36, 0x67, - 0x21, 0x34, 0xf1, 0x01, 0x14, 0xc4, 0x65, 0xb5, 0x9e, 0x71, 0xcb, 0x98, 0xef, 0x67, 0x28, 0x35, - 0xd3, 0x97, 0xb0, 0xa0, 0x86, 0xf5, 0x46, 0xe6, 0x0c, 0x36, 0x1f, 0x66, 0xaa, 0x47, 0xf9, 0xd4, - 0x50, 0xdc, 0xc8, 0x9c, 0x75, 0x53, 0xf9, 0xd2, 0xc3, 0x29, 0x2e, 0xd8, 0x8d, 0xc9, 0x34, 0xad, - 0x60, 0xe3, 0xc0, 0xa9, 0x05, 0x9b, 0x36, 0x86, 0x50, 0x08, 0x68, 0xc2, 0x08, 0x7a, 0x3c, 0x9b, - 0x46, 0x41, 0xcd, 0xad, 0x5b, 0x43, 0xf5, 0x9e, 0x27, 0xb0, 0x32, 0x69, 0x86, 0x3c, 0x99, 0xcd, - 0x94, 0x60, 0xcd, 0xed, 0xdb, 0x63, 0x93, 0x6d, 0xf7, 0x5e, 0xfe, 0x79, 0x55, 0x37, 0x2e, 0xaf, - 0xea, 0xc6, 0xbf, 0x57, 0x75, 0xe3, 0xe2, 0xba, 0x3e, 0x77, 0x79, 0x5d, 0x9f, 0xfb, 0xeb, 0xba, - 0x3e, 0xf7, 0xdd, 0xc7, 0x7e, 0xc0, 0x8f, 0x4f, 0xba, 0xb6, 0xcb, 0xfa, 0x8e, 0xe0, 0xfd, 0x88, - 0x12, 0x7e, 0xc6, 0xc2, 0x1f, 0xd5, 0xaa, 0x47, 0x3c, 0x9f, 0x84, 0xce, 0xf9, 0xc8, 0xff, 0xb5, - 0x2e, 0x0b, 0x49, 0x77, 0x41, 0xbc, 0xfa, 0x9f, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x33, 0xdf, - 0x31, 0xee, 0x7e, 0x0f, 0x00, 0x00, + // 1270 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6e, 0xdb, 0x46, + 0x13, 0x0f, 0x25, 0xc5, 0x16, 0x47, 0x51, 0xe2, 0xac, 0xf3, 0x19, 0x0a, 0x1d, 0xcb, 0x0a, 0xbf, + 0xa6, 0x51, 0xfe, 0x94, 0x84, 0x1d, 0xa0, 0x40, 0x50, 0x14, 0x81, 0xa3, 0x14, 0x88, 0x81, 0x2a, + 0x0d, 0xd4, 0x14, 0x05, 0x0a, 0x14, 0xc2, 0x8a, 0xdc, 0x30, 0x6c, 0x25, 0xae, 0xc0, 0x5d, 0xcb, + 0xce, 0xb9, 0x2f, 0x90, 0x5b, 0x1f, 0xa2, 0x40, 0x7b, 0x29, 0xd0, 0x57, 0xe8, 0x31, 0xc7, 0x1e, + 0x0a, 0xb4, 0x48, 0x5e, 0xa4, 0xe0, 0xee, 0x72, 0x45, 0xca, 0x22, 0xe5, 0x34, 0x87, 0x5e, 0x6c, + 0xee, 0xcc, 0x6f, 0x7e, 0x3b, 0x33, 0x3b, 0xbb, 0x33, 0x82, 0xed, 0x98, 0x04, 0x24, 0x72, 0x89, + 0x47, 0xbd, 0x98, 0xf8, 0x21, 0x77, 0x67, 0x7b, 0x2e, 0x3f, 0x71, 0xa6, 0x31, 0xe5, 0x14, 0x21, + 0xa1, 0x74, 0xb4, 0xd2, 0x99, 0xed, 0x59, 0x57, 0x02, 0x1a, 0x50, 0xa1, 0x76, 0x93, 0x2f, 0x89, + 0xb4, 0x76, 0x03, 0x4a, 0x83, 0x31, 0x71, 0xc5, 0x6a, 0x74, 0xf4, 0xdc, 0xe5, 0xe1, 0x84, 0x30, + 0x8e, 0x27, 0x53, 0x05, 0x68, 0x7b, 0x94, 0x4d, 0x28, 0x73, 0x47, 0x98, 0x11, 0x77, 0xb6, 0x37, + 0x22, 0x1c, 0xef, 0xb9, 0x1e, 0x0d, 0xa3, 0x54, 0xbf, 0xc4, 0x0f, 0xc6, 0x31, 0x27, 0x25, 0x7a, + 0xfe, 0x72, 0x4a, 0x98, 0xd4, 0xdb, 0xbf, 0x19, 0x70, 0xb1, 0xcf, 0x82, 0x5e, 0x4c, 0x30, 0x27, + 0xbd, 0x31, 0x66, 0x0c, 0x5d, 0x81, 0xf3, 0xd8, 0x9f, 0x84, 0x51, 0xcb, 0xe8, 0x18, 0x5d, 0x73, + 0x20, 0x17, 0xa8, 0x05, 0xeb, 0x21, 0x63, 0x47, 0x24, 0x66, 0xad, 0x4a, 0xa7, 0xda, 0x35, 0x07, + 0xe9, 0x12, 0x59, 0x50, 0x9f, 0x10, 0x8e, 0x7d, 0xcc, 0x71, 0xab, 0x2a, 0x4c, 0xf4, 0x1a, 0xdd, + 0x05, 0x24, 0xf7, 0x1d, 0x26, 0x9b, 0x0e, 0xf1, 0x68, 0x14, 0x93, 0x59, 0xab, 0x26, 0x50, 0x1b, + 0x52, 0xf3, 0xec, 0xe5, 0x94, 0x1c, 0x08, 0x39, 0xba, 0x03, 0xd5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0xfe, 0xfe, 0xa6, 0x6d, 0xbc, 0x7e, 0xd3, 0x36, + 0xfe, 0x7e, 0xd3, 0x36, 0x5e, 0xbd, 0x6d, 0x9f, 0x7b, 0xfd, 0xb6, 0x7d, 0xee, 0x8f, 0xb7, 0xed, + 0x73, 0xdf, 0x7c, 0x1c, 0x84, 0xfc, 0xc5, 0xd1, 0xc8, 0xf1, 0xe8, 0xc4, 0x15, 0x8c, 0x1f, 0x45, + 0x84, 0x1f, 0xd3, 0xf8, 0x7b, 0xb5, 0x1a, 0x13, 0x3f, 0x20, 0xb1, 0x7b, 0x92, 0xf9, 0x41, 0xef, + 0xd1, 0x98, 0x8c, 0xd6, 0xc4, 0xcf, 0x9d, 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xbb, + 0x80, 0xf7, 0x97, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1728,6 +1827,9 @@ type MsgClient interface { UpdateClassIssuers(ctx context.Context, in *MsgUpdateClassIssuers, opts ...grpc.CallOption) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassMetadata, opts ...grpc.CallOption) (*MsgUpdateClassMetadataResponse, error) + // NewCreditType is a governance only method that adds a new credit type to + // the chain. + NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) } type msgClient struct { @@ -1837,6 +1939,15 @@ func (c *msgClient) UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassM return out, nil } +func (c *msgClient) NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) { + out := new(MsgNewCreditTypeResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1.Msg/NewCreditType", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // CreateClass creates a new credit class with an approved list of issuers and @@ -1876,6 +1987,9 @@ type MsgServer interface { UpdateClassIssuers(context.Context, *MsgUpdateClassIssuers) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) + // NewCreditType is a governance only method that adds a new credit type to + // the chain. + NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1915,6 +2029,9 @@ func (*UnimplementedMsgServer) UpdateClassIssuers(ctx context.Context, req *MsgU func (*UnimplementedMsgServer) UpdateClassMetadata(ctx context.Context, req *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateClassMetadata not implemented") } +func (*UnimplementedMsgServer) NewCreditType(ctx context.Context, req *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewCreditType not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -2118,6 +2235,24 @@ func _Msg_UpdateClassMetadata_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_NewCreditType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNewCreditType) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NewCreditType(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1.Msg/NewCreditType", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NewCreditType(ctx, req.(*MsgNewCreditType)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "regen.ecocredit.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -2166,6 +2301,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateClassMetadata", Handler: _Msg_UpdateClassMetadata_Handler, }, + { + MethodName: "NewCreditType", + Handler: _Msg_NewCreditType_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/v1/tx.proto", @@ -3240,6 +3379,71 @@ func (m *MsgUpdateClassMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgNewCreditType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgNewCreditType) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNewCreditType) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreditType != nil { + { + size, err := m.CreditType.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RootAddress) > 0 { + i -= len(m.RootAddress) + copy(dAtA[i:], m.RootAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.RootAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgNewCreditTypeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgNewCreditTypeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNewCreditTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3732,6 +3936,32 @@ func (m *MsgUpdateClassMetadataResponse) Size() (n int) { return n } +func (m *MsgNewCreditType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RootAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.CreditType != nil { + l = m.CreditType.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgNewCreditTypeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6912,6 +7142,174 @@ func (m *MsgUpdateClassMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgNewCreditType) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return 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 fmt.Errorf("proto: MsgNewCreditType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNewCreditType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RootAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RootAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreditType == nil { + m.CreditType = &CreditType{} + } + if err := m.CreditType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgNewCreditTypeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return 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 fmt.Errorf("proto: MsgNewCreditTypeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNewCreditTypeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ecocredit/server/core/new_credit_type.go b/x/ecocredit/server/core/new_credit_type.go new file mode 100644 index 0000000000..d178c886b6 --- /dev/null +++ b/x/ecocredit/server/core/new_credit_type.go @@ -0,0 +1,12 @@ +package core + +import ( + "context" + + "github.com/regen-network/regen-ledger/x/ecocredit/core" +) + +func (k Keeper) NewCreditType(ctx context.Context, creditType *core.MsgNewCreditType) (*core.MsgNewCreditTypeResponse, error) { + //TODO implement me + panic("implement me") +} From 639344581befa295aea572044d733687e2879343 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 11 Apr 2022 17:13:35 -0700 Subject: [PATCH 02/25] wip: proposal handler --- api/regen/ecocredit/v1/proposal.pulsar.go | 744 +++++++++ api/regen/ecocredit/v1/tx.pulsar.go | 1477 +++--------------- api/regen/ecocredit/v1/tx_grpc.pb.go | 40 - app/app.go | 4 +- proto/regen/ecocredit/v1/proposal.proto | 17 + proto/regen/ecocredit/v1/tx.proto | 15 - x/ecocredit/core/msg_credit_type.go | 21 + x/ecocredit/core/msg_credit_type_proposal.go | 47 + x/ecocredit/core/msg_new_credit_type.go | 47 - x/ecocredit/core/proposal.pb.go | 432 +++++ x/ecocredit/core/tx.pb.go | 550 +------ x/ecocredit/handler.go | 25 + x/ecocredit/server/core/new_credit_type.go | 25 +- x/ecocredit/server/utils/utils.go | 8 + 14 files changed, 1645 insertions(+), 1807 deletions(-) create mode 100644 api/regen/ecocredit/v1/proposal.pulsar.go create mode 100644 proto/regen/ecocredit/v1/proposal.proto create mode 100644 x/ecocredit/core/msg_credit_type.go create mode 100644 x/ecocredit/core/msg_credit_type_proposal.go delete mode 100644 x/ecocredit/core/msg_new_credit_type.go create mode 100644 x/ecocredit/core/proposal.pb.go create mode 100644 x/ecocredit/handler.go diff --git a/api/regen/ecocredit/v1/proposal.pulsar.go b/api/regen/ecocredit/v1/proposal.pulsar.go new file mode 100644 index 0000000000..3b268213e6 --- /dev/null +++ b/api/regen/ecocredit/v1/proposal.pulsar.go @@ -0,0 +1,744 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package ecocreditv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/gogo/protobuf/gogoproto" + 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_CreditTypeProposal protoreflect.MessageDescriptor + fd_CreditTypeProposal_title protoreflect.FieldDescriptor + fd_CreditTypeProposal_description protoreflect.FieldDescriptor + fd_CreditTypeProposal_credit_type protoreflect.FieldDescriptor +) + +func init() { + file_regen_ecocredit_v1_proposal_proto_init() + md_CreditTypeProposal = File_regen_ecocredit_v1_proposal_proto.Messages().ByName("CreditTypeProposal") + fd_CreditTypeProposal_title = md_CreditTypeProposal.Fields().ByName("title") + fd_CreditTypeProposal_description = md_CreditTypeProposal.Fields().ByName("description") + fd_CreditTypeProposal_credit_type = md_CreditTypeProposal.Fields().ByName("credit_type") +} + +var _ protoreflect.Message = (*fastReflection_CreditTypeProposal)(nil) + +type fastReflection_CreditTypeProposal CreditTypeProposal + +func (x *CreditTypeProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_CreditTypeProposal)(x) +} + +func (x *CreditTypeProposal) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1_proposal_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_CreditTypeProposal_messageType fastReflection_CreditTypeProposal_messageType +var _ protoreflect.MessageType = fastReflection_CreditTypeProposal_messageType{} + +type fastReflection_CreditTypeProposal_messageType struct{} + +func (x fastReflection_CreditTypeProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_CreditTypeProposal)(nil) +} +func (x fastReflection_CreditTypeProposal_messageType) New() protoreflect.Message { + return new(fastReflection_CreditTypeProposal) +} +func (x fastReflection_CreditTypeProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CreditTypeProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CreditTypeProposal) Descriptor() protoreflect.MessageDescriptor { + return md_CreditTypeProposal +} + +// 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_CreditTypeProposal) Type() protoreflect.MessageType { + return _fastReflection_CreditTypeProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CreditTypeProposal) New() protoreflect.Message { + return new(fastReflection_CreditTypeProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CreditTypeProposal) Interface() protoreflect.ProtoMessage { + return (*CreditTypeProposal)(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_CreditTypeProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_CreditTypeProposal_title, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_CreditTypeProposal_description, value) { + return + } + } + if x.CreditType != nil { + value := protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + if !f(fd_CreditTypeProposal_credit_type, 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_CreditTypeProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + return x.Title != "" + case "regen.ecocredit.v1.CreditTypeProposal.description": + return x.Description != "" + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + return x.CreditType != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + x.Title = "" + case "regen.ecocredit.v1.CreditTypeProposal.description": + x.Description = "" + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + x.CreditType = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.CreditTypeProposal.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + value := x.CreditType + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + x.Title = value.Interface().(string) + case "regen.ecocredit.v1.CreditTypeProposal.description": + x.Description = value.Interface().(string) + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + x.CreditType = value.Message().Interface().(*CreditType) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + if x.CreditType == nil { + x.CreditType = new(CreditType) + } + return protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + case "regen.ecocredit.v1.CreditTypeProposal.title": + panic(fmt.Errorf("field title of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) + case "regen.ecocredit.v1.CreditTypeProposal.description": + panic(fmt.Errorf("field description of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.CreditTypeProposal.description": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + m := new(CreditType) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.CreditTypeProposal", 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CreditTypeProposal) + 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.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CreditType != nil { + l = options.Size(x.CreditType) + 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().(*CreditTypeProposal) + 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 x.CreditType != nil { + encoded, err := options.Marshal(x.CreditType) + 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.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + 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().(*CreditTypeProposal) + 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: CreditTypeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CreditTypeProposal: 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 Title", 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.Title = 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 Description", 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.Description = 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 CreditType", 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 + } + if x.CreditType == nil { + x.CreditType = &CreditType{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreditType); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: regen/ecocredit/v1/proposal.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) +) + +// CreditTypeProposal is a gov Content type for adding a credit type. +type CreditTypeProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (x *CreditTypeProposal) Reset() { + *x = CreditTypeProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_proposal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreditTypeProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreditTypeProposal) ProtoMessage() {} + +// Deprecated: Use CreditTypeProposal.ProtoReflect.Descriptor instead. +func (*CreditTypeProposal) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_proposal_proto_rawDescGZIP(), []int{0} +} + +func (x *CreditTypeProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreditTypeProposal) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreditTypeProposal) GetCreditType() *CreditType { + if x != nil { + return x.CreditType + } + return nil +} + +var File_regen_ecocredit_v1_proposal_proto protoreflect.FileDescriptor + +var file_regen_ecocredit_v1_proposal_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x01, + 0x0a, 0x12, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x04, 0x98, + 0xa0, 0x1f, 0x00, 0x42, 0xdb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0d, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, + 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, + 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_regen_ecocredit_v1_proposal_proto_rawDescOnce sync.Once + file_regen_ecocredit_v1_proposal_proto_rawDescData = file_regen_ecocredit_v1_proposal_proto_rawDesc +) + +func file_regen_ecocredit_v1_proposal_proto_rawDescGZIP() []byte { + file_regen_ecocredit_v1_proposal_proto_rawDescOnce.Do(func() { + file_regen_ecocredit_v1_proposal_proto_rawDescData = protoimpl.X.CompressGZIP(file_regen_ecocredit_v1_proposal_proto_rawDescData) + }) + return file_regen_ecocredit_v1_proposal_proto_rawDescData +} + +var file_regen_ecocredit_v1_proposal_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_regen_ecocredit_v1_proposal_proto_goTypes = []interface{}{ + (*CreditTypeProposal)(nil), // 0: regen.ecocredit.v1.CreditTypeProposal + (*CreditType)(nil), // 1: regen.ecocredit.v1.CreditType +} +var file_regen_ecocredit_v1_proposal_proto_depIdxs = []int32{ + 1, // 0: regen.ecocredit.v1.CreditTypeProposal.credit_type:type_name -> regen.ecocredit.v1.CreditType + 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_regen_ecocredit_v1_proposal_proto_init() } +func file_regen_ecocredit_v1_proposal_proto_init() { + if File_regen_ecocredit_v1_proposal_proto != nil { + return + } + file_regen_ecocredit_v1_state_proto_init() + if !protoimpl.UnsafeEnabled { + file_regen_ecocredit_v1_proposal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreditTypeProposal); 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_regen_ecocredit_v1_proposal_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_regen_ecocredit_v1_proposal_proto_goTypes, + DependencyIndexes: file_regen_ecocredit_v1_proposal_proto_depIdxs, + MessageInfos: file_regen_ecocredit_v1_proposal_proto_msgTypes, + }.Build() + File_regen_ecocredit_v1_proposal_proto = out.File + file_regen_ecocredit_v1_proposal_proto_rawDesc = nil + file_regen_ecocredit_v1_proposal_proto_goTypes = nil + file_regen_ecocredit_v1_proposal_proto_depIdxs = nil +} diff --git a/api/regen/ecocredit/v1/tx.pulsar.go b/api/regen/ecocredit/v1/tx.pulsar.go index 58ed08b7db..14077e92db 100644 --- a/api/regen/ecocredit/v1/tx.pulsar.go +++ b/api/regen/ecocredit/v1/tx.pulsar.go @@ -6900,7 +6900,7 @@ func (x *MsgSend_SendCredits) ProtoReflect() protoreflect.Message { } func (x *MsgSend_SendCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8486,7 +8486,7 @@ func (x *MsgRetire_RetireCredits) ProtoReflect() protoreflect.Message { } func (x *MsgRetire_RetireCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[26] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9884,7 +9884,7 @@ func (x *MsgCancel_CancelCredits) ProtoReflect() protoreflect.Message { } func (x *MsgCancel_CancelCredits) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[27] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13598,1027 +13598,172 @@ func (x *fastReflection_MsgUpdateClassMetadataResponse) ProtoMethods() *protoifa } } -var ( - md_MsgNewCreditType protoreflect.MessageDescriptor - fd_MsgNewCreditType_root_address protoreflect.FieldDescriptor - fd_MsgNewCreditType_credit_type protoreflect.FieldDescriptor -) - -func init() { - file_regen_ecocredit_v1_tx_proto_init() - md_MsgNewCreditType = File_regen_ecocredit_v1_tx_proto.Messages().ByName("MsgNewCreditType") - fd_MsgNewCreditType_root_address = md_MsgNewCreditType.Fields().ByName("root_address") - fd_MsgNewCreditType_credit_type = md_MsgNewCreditType.Fields().ByName("credit_type") -} +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: regen/ecocredit/v1/tx.proto -var _ protoreflect.Message = (*fastReflection_MsgNewCreditType)(nil) +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 fastReflection_MsgNewCreditType MsgNewCreditType +// MsgCreateClass is the Msg/CreateClass request type. +type MsgCreateClass struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *MsgNewCreditType) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgNewCreditType)(x) + // admin is the address of the account that created the credit class. + Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` + // issuers are the account addresses of the approved issuers. + Issuers []string `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` + // metadata is any arbitrary metadata to attached to the credit class. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // credit_type_abbrev describes the abbreviation of a credit type (e.g. "C", + // "BIO"). + CreditTypeAbbrev string `protobuf:"bytes,4,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"` + // fee specifies the fee to pay for the creation of the credit class. + // acceptable fees for creating a credit class can be found in the governance + // parameters for the ecocredit module. + Fee *v1beta1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee,omitempty"` } -func (x *MsgNewCreditType) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { +func (x *MsgCreateClass) Reset() { + *x = MsgCreateClass{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms + ms.StoreMessageInfo(mi) } - return mi.MessageOf(x) } -var _fastReflection_MsgNewCreditType_messageType fastReflection_MsgNewCreditType_messageType -var _ protoreflect.MessageType = fastReflection_MsgNewCreditType_messageType{} +func (x *MsgCreateClass) String() string { + return protoimpl.X.MessageStringOf(x) +} -type fastReflection_MsgNewCreditType_messageType struct{} +func (*MsgCreateClass) ProtoMessage() {} -func (x fastReflection_MsgNewCreditType_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgNewCreditType)(nil) -} -func (x fastReflection_MsgNewCreditType_messageType) New() protoreflect.Message { - return new(fastReflection_MsgNewCreditType) -} -func (x fastReflection_MsgNewCreditType_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgNewCreditType +// Deprecated: Use MsgCreateClass.ProtoReflect.Descriptor instead. +func (*MsgCreateClass) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{0} } -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgNewCreditType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgNewCreditType +func (x *MsgCreateClass) GetAdmin() string { + if x != nil { + return x.Admin + } + return "" } -// 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_MsgNewCreditType) Type() protoreflect.MessageType { - return _fastReflection_MsgNewCreditType_messageType +func (x *MsgCreateClass) GetIssuers() []string { + if x != nil { + return x.Issuers + } + return nil } -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgNewCreditType) New() protoreflect.Message { - return new(fastReflection_MsgNewCreditType) +func (x *MsgCreateClass) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" } -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgNewCreditType) Interface() protoreflect.ProtoMessage { - return (*MsgNewCreditType)(x) +func (x *MsgCreateClass) GetCreditTypeAbbrev() string { + if x != nil { + return x.CreditTypeAbbrev + } + return "" } -// 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_MsgNewCreditType) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.RootAddress != "" { - value := protoreflect.ValueOfString(x.RootAddress) - if !f(fd_MsgNewCreditType_root_address, value) { - return - } - } - if x.CreditType != nil { - value := protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) - if !f(fd_MsgNewCreditType_credit_type, value) { - return - } +func (x *MsgCreateClass) GetFee() *v1beta1.Coin { + if x != nil { + return x.Fee } + return nil } -// 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_MsgNewCreditType) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - return x.RootAddress != "" - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - return x.CreditType != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) - } +// MsgCreateClassResponse is the Msg/CreateClass response type. +type MsgCreateClassResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // class_id is the unique ID of the newly created credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` } -// 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_MsgNewCreditType) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - x.RootAddress = "" - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - x.CreditType = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) +func (x *MsgCreateClassResponse) Reset() { + *x = MsgCreateClassResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -// 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_MsgNewCreditType) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - value := x.RootAddress - return protoreflect.ValueOfString(value) - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - value := x.CreditType - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", descriptor.FullName())) - } +func (x *MsgCreateClassResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -// 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_MsgNewCreditType) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - x.RootAddress = value.Interface().(string) - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - x.CreditType = value.Message().Interface().(*CreditType) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) - } +func (*MsgCreateClassResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateClassResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateClassResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{1} } -// 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_MsgNewCreditType) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - if x.CreditType == nil { - x.CreditType = new(CreditType) - } - return protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - panic(fmt.Errorf("field root_address of message regen.ecocredit.v1.MsgNewCreditType is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) +func (x *MsgCreateClassResponse) GetClassId() string { + if x != nil { + return x.ClassId } + return "" } -// 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_MsgNewCreditType) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "regen.ecocredit.v1.MsgNewCreditType.root_address": - return protoreflect.ValueOfString("") - case "regen.ecocredit.v1.MsgNewCreditType.credit_type": - m := new(CreditType) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditType")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditType does not contain field %s", fd.FullName())) - } +// MsgCreateProjectResponse is the Msg/CreateProject request type. +type MsgCreateProject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // issuer is the address of an approved issuer for the credit class through + // which batches will be issued. It is not required, however, that this same + // issuer issue all batches for a project. + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // class_id is the unique ID of the class within which the project is created. + ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // metadata is any arbitrary metadata attached to the project. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // project_location is the location of the project backing the credits in this + // batch. It is a string of the form + // [-[ ]], with the first two + // fields conforming to ISO 3166-2, and postal-code being up to 64 + // alphanumeric characters. country-code is required, while sub-national-code + // and postal-code can be added for increasing precision. + ProjectLocation string `protobuf:"bytes,4,opt,name=project_location,json=projectLocation,proto3" json:"project_location,omitempty"` + // project_id is an optional user-specified project ID which can be used + // instead of an auto-generated ID. If project_id is provided, it must be + // unique within the credit class and match the regex [A-Za-z0-9]{2,16} + // or else the operation will fail. If project_id is omitted an ID will + // automatically be generated. + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` } -// 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_MsgNewCreditType) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.MsgNewCreditType", d.FullName())) +func (x *MsgCreateProject) Reset() { + *x = MsgCreateProject{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - 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_MsgNewCreditType) 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_MsgNewCreditType) 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_MsgNewCreditType) 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_MsgNewCreditType) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgNewCreditType) - 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.RootAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.CreditType != nil { - l = options.Size(x.CreditType) - 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().(*MsgNewCreditType) - 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 x.CreditType != nil { - encoded, err := options.Marshal(x.CreditType) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.RootAddress) > 0 { - i -= len(x.RootAddress) - copy(dAtA[i:], x.RootAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RootAddress))) - 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().(*MsgNewCreditType) - 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: MsgNewCreditType: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNewCreditType: 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 RootAddress", 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.RootAddress = 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 CreditType", 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 - } - if x.CreditType == nil { - x.CreditType = &CreditType{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreditType); 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 ( - md_MsgNewCreditTypeResponse protoreflect.MessageDescriptor -) - -func init() { - file_regen_ecocredit_v1_tx_proto_init() - md_MsgNewCreditTypeResponse = File_regen_ecocredit_v1_tx_proto.Messages().ByName("MsgNewCreditTypeResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgNewCreditTypeResponse)(nil) - -type fastReflection_MsgNewCreditTypeResponse MsgNewCreditTypeResponse - -func (x *MsgNewCreditTypeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgNewCreditTypeResponse)(x) -} - -func (x *MsgNewCreditTypeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] - 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_MsgNewCreditTypeResponse_messageType fastReflection_MsgNewCreditTypeResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgNewCreditTypeResponse_messageType{} - -type fastReflection_MsgNewCreditTypeResponse_messageType struct{} - -func (x fastReflection_MsgNewCreditTypeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgNewCreditTypeResponse)(nil) -} -func (x fastReflection_MsgNewCreditTypeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgNewCreditTypeResponse) -} -func (x fastReflection_MsgNewCreditTypeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgNewCreditTypeResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgNewCreditTypeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgNewCreditTypeResponse -} - -// 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_MsgNewCreditTypeResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgNewCreditTypeResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgNewCreditTypeResponse) New() protoreflect.Message { - return new(fastReflection_MsgNewCreditTypeResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgNewCreditTypeResponse) Interface() protoreflect.ProtoMessage { - return (*MsgNewCreditTypeResponse)(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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.MsgNewCreditTypeResponse")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.MsgNewCreditTypeResponse 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_MsgNewCreditTypeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.MsgNewCreditTypeResponse", 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) 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_MsgNewCreditTypeResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgNewCreditTypeResponse) - 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().(*MsgNewCreditTypeResponse) - 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().(*MsgNewCreditTypeResponse) - 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: MsgNewCreditTypeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNewCreditTypeResponse: 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: regen/ecocredit/v1/tx.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) -) - -// MsgCreateClass is the Msg/CreateClass request type. -type MsgCreateClass struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // admin is the address of the account that created the credit class. - Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"` - // issuers are the account addresses of the approved issuers. - Issuers []string `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` - // metadata is any arbitrary metadata to attached to the credit class. - Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - // credit_type_abbrev describes the abbreviation of a credit type (e.g. "C", - // "BIO"). - CreditTypeAbbrev string `protobuf:"bytes,4,opt,name=credit_type_abbrev,json=creditTypeAbbrev,proto3" json:"credit_type_abbrev,omitempty"` - // fee specifies the fee to pay for the creation of the credit class. - // acceptable fees for creating a credit class can be found in the governance - // parameters for the ecocredit module. - Fee *v1beta1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee,omitempty"` -} - -func (x *MsgCreateClass) Reset() { - *x = MsgCreateClass{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateClass) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreateClass) ProtoMessage() {} - -// Deprecated: Use MsgCreateClass.ProtoReflect.Descriptor instead. -func (*MsgCreateClass) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgCreateClass) GetAdmin() string { - if x != nil { - return x.Admin - } - return "" -} - -func (x *MsgCreateClass) GetIssuers() []string { - if x != nil { - return x.Issuers - } - return nil -} - -func (x *MsgCreateClass) GetMetadata() string { - if x != nil { - return x.Metadata - } - return "" -} - -func (x *MsgCreateClass) GetCreditTypeAbbrev() string { - if x != nil { - return x.CreditTypeAbbrev - } - return "" -} - -func (x *MsgCreateClass) GetFee() *v1beta1.Coin { - if x != nil { - return x.Fee - } - return nil -} - -// MsgCreateClassResponse is the Msg/CreateClass response type. -type MsgCreateClassResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // class_id is the unique ID of the newly created credit class. - ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` -} - -func (x *MsgCreateClassResponse) Reset() { - *x = MsgCreateClassResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateClassResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreateClassResponse) ProtoMessage() {} - -// Deprecated: Use MsgCreateClassResponse.ProtoReflect.Descriptor instead. -func (*MsgCreateClassResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{1} -} - -func (x *MsgCreateClassResponse) GetClassId() string { - if x != nil { - return x.ClassId - } - return "" -} - -// MsgCreateProjectResponse is the Msg/CreateProject request type. -type MsgCreateProject struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // issuer is the address of an approved issuer for the credit class through - // which batches will be issued. It is not required, however, that this same - // issuer issue all batches for a project. - Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` - // class_id is the unique ID of the class within which the project is created. - ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - // metadata is any arbitrary metadata attached to the project. - Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - // project_location is the location of the project backing the credits in this - // batch. It is a string of the form - // [-[ ]], with the first two - // fields conforming to ISO 3166-2, and postal-code being up to 64 - // alphanumeric characters. country-code is required, while sub-national-code - // and postal-code can be added for increasing precision. - ProjectLocation string `protobuf:"bytes,4,opt,name=project_location,json=projectLocation,proto3" json:"project_location,omitempty"` - // project_id is an optional user-specified project ID which can be used - // instead of an auto-generated ID. If project_id is provided, it must be - // unique within the credit class and match the regex [A-Za-z0-9]{2,16} - // or else the operation will fail. If project_id is omitted an ID will - // automatically be generated. - ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` -} - -func (x *MsgCreateProject) Reset() { - *x = MsgCreateProject{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateProject) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *MsgCreateProject) String() string { + return protoimpl.X.MessageStringOf(x) } func (*MsgCreateProject) ProtoMessage() {} @@ -15589,79 +14734,6 @@ func (*MsgUpdateClassMetadataResponse) Descriptor() ([]byte, []int) { return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{22} } -// MsgNewCreditType is the Msg/NewCreditType request type. -type MsgNewCreditType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // root_address should be the governance address. - RootAddress string `protobuf:"bytes,1,opt,name=root_address,json=rootAddress,proto3" json:"root_address,omitempty"` - // credit_type is the credit type to add. - CreditType *CreditType `protobuf:"bytes,2,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` -} - -func (x *MsgNewCreditType) Reset() { - *x = MsgNewCreditType{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgNewCreditType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgNewCreditType) ProtoMessage() {} - -// Deprecated: Use MsgNewCreditType.ProtoReflect.Descriptor instead. -func (*MsgNewCreditType) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{23} -} - -func (x *MsgNewCreditType) GetRootAddress() string { - if x != nil { - return x.RootAddress - } - return "" -} - -func (x *MsgNewCreditType) GetCreditType() *CreditType { - if x != nil { - return x.CreditType - } - return nil -} - -// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. -type MsgNewCreditTypeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgNewCreditTypeResponse) Reset() { - *x = MsgNewCreditTypeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgNewCreditTypeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgNewCreditTypeResponse) ProtoMessage() {} - -// Deprecated: Use MsgNewCreditTypeResponse.ProtoReflect.Descriptor instead. -func (*MsgNewCreditTypeResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_tx_proto_rawDescGZIP(), []int{24} -} - // SendCredits specifies a batch and the number of credits being transferred. // This is split into tradable credits, which will remain tradable on receipt, // and retired credits, which will be retired on receipt. @@ -15692,7 +14764,7 @@ type MsgSend_SendCredits struct { func (x *MsgSend_SendCredits) Reset() { *x = MsgSend_SendCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15754,7 +14826,7 @@ type MsgRetire_RetireCredits struct { func (x *MsgRetire_RetireCredits) Reset() { *x = MsgRetire_RetireCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[26] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15802,7 +14874,7 @@ type MsgCancel_CancelCredits struct { func (x *MsgCancel_CancelCredits) Reset() { *x = MsgCancel_CancelCredits{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[27] + mi := &file_regen_ecocredit_v1_tx_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16012,104 +15084,89 @@ var file_regen_ecocredit_v1_tx_proto_rawDesc = []byte{ 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x76, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x6f, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x4e, 0x65, - 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0x97, 0x09, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5d, 0x0a, 0x0b, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xb2, 0x08, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5d, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x2a, - 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5d, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x22, - 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, - 0x0a, 0x10, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x73, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x1a, 0x2f, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, - 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x28, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1b, 0x2e, + 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x23, 0x2e, 0x72, 0x65, 0x67, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x06, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x74, 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x6c, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x1a, 0x2f, 0x2e, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, - 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x1a, 0x31, + 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x2a, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x4d, 0x69, + 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x12, 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x75, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x4d, 0x69, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x53, 0x65, 0x61, 0x6c, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x28, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x61, 0x6c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x48, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x23, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x52, + 0x65, 0x74, 0x69, 0x72, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x74, 0x69, 0x72, 0x65, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x74, + 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x25, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, + 0x27, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x1a, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x12, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x12, + 0x29, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x1a, 0x31, 0x2e, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, + 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x43, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, - 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x43, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd5, 0x01, - 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, - 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, - 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, - 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x32, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, + 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd5, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, + 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -16124,7 +15181,7 @@ func file_regen_ecocredit_v1_tx_proto_rawDescGZIP() []byte { return file_regen_ecocredit_v1_tx_proto_rawDescData } -var file_regen_ecocredit_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_regen_ecocredit_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_regen_ecocredit_v1_tx_proto_goTypes = []interface{}{ (*MsgCreateClass)(nil), // 0: regen.ecocredit.v1.MsgCreateClass (*MsgCreateClassResponse)(nil), // 1: regen.ecocredit.v1.MsgCreateClassResponse @@ -16149,57 +15206,51 @@ var file_regen_ecocredit_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateClassIssuersResponse)(nil), // 20: regen.ecocredit.v1.MsgUpdateClassIssuersResponse (*MsgUpdateClassMetadata)(nil), // 21: regen.ecocredit.v1.MsgUpdateClassMetadata (*MsgUpdateClassMetadataResponse)(nil), // 22: regen.ecocredit.v1.MsgUpdateClassMetadataResponse - (*MsgNewCreditType)(nil), // 23: regen.ecocredit.v1.MsgNewCreditType - (*MsgNewCreditTypeResponse)(nil), // 24: regen.ecocredit.v1.MsgNewCreditTypeResponse - (*MsgSend_SendCredits)(nil), // 25: regen.ecocredit.v1.MsgSend.SendCredits - (*MsgRetire_RetireCredits)(nil), // 26: regen.ecocredit.v1.MsgRetire.RetireCredits - (*MsgCancel_CancelCredits)(nil), // 27: regen.ecocredit.v1.MsgCancel.CancelCredits - (*v1beta1.Coin)(nil), // 28: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp - (*OriginTx)(nil), // 30: regen.ecocredit.v1.OriginTx - (*CreditType)(nil), // 31: regen.ecocredit.v1.CreditType + (*MsgSend_SendCredits)(nil), // 23: regen.ecocredit.v1.MsgSend.SendCredits + (*MsgRetire_RetireCredits)(nil), // 24: regen.ecocredit.v1.MsgRetire.RetireCredits + (*MsgCancel_CancelCredits)(nil), // 25: regen.ecocredit.v1.MsgCancel.CancelCredits + (*v1beta1.Coin)(nil), // 26: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*OriginTx)(nil), // 28: regen.ecocredit.v1.OriginTx } var file_regen_ecocredit_v1_tx_proto_depIdxs = []int32{ - 28, // 0: regen.ecocredit.v1.MsgCreateClass.fee:type_name -> cosmos.base.v1beta1.Coin + 26, // 0: regen.ecocredit.v1.MsgCreateClass.fee:type_name -> cosmos.base.v1beta1.Coin 5, // 1: regen.ecocredit.v1.MsgCreateBatch.issuance:type_name -> regen.ecocredit.v1.BatchIssuance - 29, // 2: regen.ecocredit.v1.MsgCreateBatch.start_date:type_name -> google.protobuf.Timestamp - 29, // 3: regen.ecocredit.v1.MsgCreateBatch.end_date:type_name -> google.protobuf.Timestamp - 30, // 4: regen.ecocredit.v1.MsgCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 27, // 2: regen.ecocredit.v1.MsgCreateBatch.start_date:type_name -> google.protobuf.Timestamp + 27, // 3: regen.ecocredit.v1.MsgCreateBatch.end_date:type_name -> google.protobuf.Timestamp + 28, // 4: regen.ecocredit.v1.MsgCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx 5, // 5: regen.ecocredit.v1.MsgMintBatchCredits.issuance:type_name -> regen.ecocredit.v1.BatchIssuance - 30, // 6: regen.ecocredit.v1.MsgMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx - 25, // 7: regen.ecocredit.v1.MsgSend.credits:type_name -> regen.ecocredit.v1.MsgSend.SendCredits - 26, // 8: regen.ecocredit.v1.MsgRetire.credits:type_name -> regen.ecocredit.v1.MsgRetire.RetireCredits - 27, // 9: regen.ecocredit.v1.MsgCancel.credits:type_name -> regen.ecocredit.v1.MsgCancel.CancelCredits - 31, // 10: regen.ecocredit.v1.MsgNewCreditType.credit_type:type_name -> regen.ecocredit.v1.CreditType - 0, // 11: regen.ecocredit.v1.Msg.CreateClass:input_type -> regen.ecocredit.v1.MsgCreateClass - 2, // 12: regen.ecocredit.v1.Msg.CreateProject:input_type -> regen.ecocredit.v1.MsgCreateProject - 4, // 13: regen.ecocredit.v1.Msg.CreateBatch:input_type -> regen.ecocredit.v1.MsgCreateBatch - 7, // 14: regen.ecocredit.v1.Msg.MintBatchCredits:input_type -> regen.ecocredit.v1.MsgMintBatchCredits - 8, // 15: regen.ecocredit.v1.Msg.SealBatch:input_type -> regen.ecocredit.v1.MsgSealBatch - 11, // 16: regen.ecocredit.v1.Msg.Send:input_type -> regen.ecocredit.v1.MsgSend - 13, // 17: regen.ecocredit.v1.Msg.Retire:input_type -> regen.ecocredit.v1.MsgRetire - 15, // 18: regen.ecocredit.v1.Msg.Cancel:input_type -> regen.ecocredit.v1.MsgCancel - 17, // 19: regen.ecocredit.v1.Msg.UpdateClassAdmin:input_type -> regen.ecocredit.v1.MsgUpdateClassAdmin - 19, // 20: regen.ecocredit.v1.Msg.UpdateClassIssuers:input_type -> regen.ecocredit.v1.MsgUpdateClassIssuers - 21, // 21: regen.ecocredit.v1.Msg.UpdateClassMetadata:input_type -> regen.ecocredit.v1.MsgUpdateClassMetadata - 23, // 22: regen.ecocredit.v1.Msg.NewCreditType:input_type -> regen.ecocredit.v1.MsgNewCreditType - 1, // 23: regen.ecocredit.v1.Msg.CreateClass:output_type -> regen.ecocredit.v1.MsgCreateClassResponse - 3, // 24: regen.ecocredit.v1.Msg.CreateProject:output_type -> regen.ecocredit.v1.MsgCreateProjectResponse - 6, // 25: regen.ecocredit.v1.Msg.CreateBatch:output_type -> regen.ecocredit.v1.MsgCreateBatchResponse - 9, // 26: regen.ecocredit.v1.Msg.MintBatchCredits:output_type -> regen.ecocredit.v1.MsgMintBatchCreditsResponse - 10, // 27: regen.ecocredit.v1.Msg.SealBatch:output_type -> regen.ecocredit.v1.MsgSealBatchResponse - 12, // 28: regen.ecocredit.v1.Msg.Send:output_type -> regen.ecocredit.v1.MsgSendResponse - 14, // 29: regen.ecocredit.v1.Msg.Retire:output_type -> regen.ecocredit.v1.MsgRetireResponse - 16, // 30: regen.ecocredit.v1.Msg.Cancel:output_type -> regen.ecocredit.v1.MsgCancelResponse - 18, // 31: regen.ecocredit.v1.Msg.UpdateClassAdmin:output_type -> regen.ecocredit.v1.MsgUpdateClassAdminResponse - 20, // 32: regen.ecocredit.v1.Msg.UpdateClassIssuers:output_type -> regen.ecocredit.v1.MsgUpdateClassIssuersResponse - 22, // 33: regen.ecocredit.v1.Msg.UpdateClassMetadata:output_type -> regen.ecocredit.v1.MsgUpdateClassMetadataResponse - 24, // 34: regen.ecocredit.v1.Msg.NewCreditType:output_type -> regen.ecocredit.v1.MsgNewCreditTypeResponse - 23, // [23:35] is the sub-list for method output_type - 11, // [11:23] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 28, // 6: regen.ecocredit.v1.MsgMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 23, // 7: regen.ecocredit.v1.MsgSend.credits:type_name -> regen.ecocredit.v1.MsgSend.SendCredits + 24, // 8: regen.ecocredit.v1.MsgRetire.credits:type_name -> regen.ecocredit.v1.MsgRetire.RetireCredits + 25, // 9: regen.ecocredit.v1.MsgCancel.credits:type_name -> regen.ecocredit.v1.MsgCancel.CancelCredits + 0, // 10: regen.ecocredit.v1.Msg.CreateClass:input_type -> regen.ecocredit.v1.MsgCreateClass + 2, // 11: regen.ecocredit.v1.Msg.CreateProject:input_type -> regen.ecocredit.v1.MsgCreateProject + 4, // 12: regen.ecocredit.v1.Msg.CreateBatch:input_type -> regen.ecocredit.v1.MsgCreateBatch + 7, // 13: regen.ecocredit.v1.Msg.MintBatchCredits:input_type -> regen.ecocredit.v1.MsgMintBatchCredits + 8, // 14: regen.ecocredit.v1.Msg.SealBatch:input_type -> regen.ecocredit.v1.MsgSealBatch + 11, // 15: regen.ecocredit.v1.Msg.Send:input_type -> regen.ecocredit.v1.MsgSend + 13, // 16: regen.ecocredit.v1.Msg.Retire:input_type -> regen.ecocredit.v1.MsgRetire + 15, // 17: regen.ecocredit.v1.Msg.Cancel:input_type -> regen.ecocredit.v1.MsgCancel + 17, // 18: regen.ecocredit.v1.Msg.UpdateClassAdmin:input_type -> regen.ecocredit.v1.MsgUpdateClassAdmin + 19, // 19: regen.ecocredit.v1.Msg.UpdateClassIssuers:input_type -> regen.ecocredit.v1.MsgUpdateClassIssuers + 21, // 20: regen.ecocredit.v1.Msg.UpdateClassMetadata:input_type -> regen.ecocredit.v1.MsgUpdateClassMetadata + 1, // 21: regen.ecocredit.v1.Msg.CreateClass:output_type -> regen.ecocredit.v1.MsgCreateClassResponse + 3, // 22: regen.ecocredit.v1.Msg.CreateProject:output_type -> regen.ecocredit.v1.MsgCreateProjectResponse + 6, // 23: regen.ecocredit.v1.Msg.CreateBatch:output_type -> regen.ecocredit.v1.MsgCreateBatchResponse + 9, // 24: regen.ecocredit.v1.Msg.MintBatchCredits:output_type -> regen.ecocredit.v1.MsgMintBatchCreditsResponse + 10, // 25: regen.ecocredit.v1.Msg.SealBatch:output_type -> regen.ecocredit.v1.MsgSealBatchResponse + 12, // 26: regen.ecocredit.v1.Msg.Send:output_type -> regen.ecocredit.v1.MsgSendResponse + 14, // 27: regen.ecocredit.v1.Msg.Retire:output_type -> regen.ecocredit.v1.MsgRetireResponse + 16, // 28: regen.ecocredit.v1.Msg.Cancel:output_type -> regen.ecocredit.v1.MsgCancelResponse + 18, // 29: regen.ecocredit.v1.Msg.UpdateClassAdmin:output_type -> regen.ecocredit.v1.MsgUpdateClassAdminResponse + 20, // 30: regen.ecocredit.v1.Msg.UpdateClassIssuers:output_type -> regen.ecocredit.v1.MsgUpdateClassIssuersResponse + 22, // 31: regen.ecocredit.v1.Msg.UpdateClassMetadata:output_type -> regen.ecocredit.v1.MsgUpdateClassMetadataResponse + 21, // [21:32] is the sub-list for method output_type + 10, // [10:21] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_regen_ecocredit_v1_tx_proto_init() } @@ -16487,30 +15538,6 @@ func file_regen_ecocredit_v1_tx_proto_init() { } } file_regen_ecocredit_v1_tx_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgNewCreditType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_regen_ecocredit_v1_tx_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgNewCreditTypeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_regen_ecocredit_v1_tx_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgSend_SendCredits); i { case 0: return &v.state @@ -16522,7 +15549,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { return nil } } - file_regen_ecocredit_v1_tx_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_regen_ecocredit_v1_tx_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRetire_RetireCredits); i { case 0: return &v.state @@ -16534,7 +15561,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { return nil } } - file_regen_ecocredit_v1_tx_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_regen_ecocredit_v1_tx_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgCancel_CancelCredits); i { case 0: return &v.state @@ -16553,7 +15580,7 @@ func file_regen_ecocredit_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 28, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/api/regen/ecocredit/v1/tx_grpc.pb.go b/api/regen/ecocredit/v1/tx_grpc.pb.go index 3f8ab17372..1b41ed10ff 100644 --- a/api/regen/ecocredit/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1/tx_grpc.pb.go @@ -59,9 +59,6 @@ type MsgClient interface { UpdateClassIssuers(ctx context.Context, in *MsgUpdateClassIssuers, opts ...grpc.CallOption) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassMetadata, opts ...grpc.CallOption) (*MsgUpdateClassMetadataResponse, error) - // NewCreditType is a governance only method that adds a new credit type to - // the chain. - NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) } type msgClient struct { @@ -171,15 +168,6 @@ func (c *msgClient) UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassM return out, nil } -func (c *msgClient) NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) { - out := new(MsgNewCreditTypeResponse) - err := c.cc.Invoke(ctx, "/regen.ecocredit.v1.Msg/NewCreditType", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -221,9 +209,6 @@ type MsgServer interface { UpdateClassIssuers(context.Context, *MsgUpdateClassIssuers) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) - // NewCreditType is a governance only method that adds a new credit type to - // the chain. - NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) mustEmbedUnimplementedMsgServer() } @@ -264,9 +249,6 @@ func (UnimplementedMsgServer) UpdateClassIssuers(context.Context, *MsgUpdateClas func (UnimplementedMsgServer) UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateClassMetadata not implemented") } -func (UnimplementedMsgServer) NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewCreditType not implemented") -} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -478,24 +460,6 @@ func _Msg_UpdateClassMetadata_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Msg_NewCreditType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgNewCreditType) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).NewCreditType(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/regen.ecocredit.v1.Msg/NewCreditType", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).NewCreditType(ctx, req.(*MsgNewCreditType)) - } - return interceptor(ctx, in, info, handler) -} - // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -547,10 +511,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateClassMetadata", Handler: _Msg_UpdateClassMetadata_Handler, }, - { - MethodName: "NewCreditType", - Handler: _Msg_NewCreditType_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/v1/tx.proto", diff --git a/app/app.go b/app/app.go index 0390b50637..eae8b4ddac 100644 --- a/app/app.go +++ b/app/app.go @@ -98,7 +98,6 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/basket" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module" - // unnamed import of statik for swagger UI support _ "github.com/regen-network/regen-ledger/v3/client/docs/statik" ) @@ -339,7 +338,8 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) //. + // AddRoute(core.RouterKey, ecocredit.NewCreditTypeProposalHandler()) // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( diff --git a/proto/regen/ecocredit/v1/proposal.proto b/proto/regen/ecocredit/v1/proposal.proto new file mode 100644 index 0000000000..9da7f65526 --- /dev/null +++ b/proto/regen/ecocredit/v1/proposal.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package regen.ecocredit.v1; + +import "regen/ecocredit/v1/state.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/core"; + +// CreditTypeProposal is a gov Content type for adding a credit type. +message CreditTypeProposal { + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + CreditType credit_type = 3; +} diff --git a/proto/regen/ecocredit/v1/tx.proto b/proto/regen/ecocredit/v1/tx.proto index 41bf443ba8..baa2976559 100644 --- a/proto/regen/ecocredit/v1/tx.proto +++ b/proto/regen/ecocredit/v1/tx.proto @@ -64,10 +64,6 @@ service Msg { // UpdateClassMetadata updates the credit class metadata rpc UpdateClassMetadata(MsgUpdateClassMetadata) returns (MsgUpdateClassMetadataResponse); - - // NewCreditType is a governance only method that adds a new credit type to - // the chain. - rpc NewCreditType(MsgNewCreditType) returns (MsgNewCreditTypeResponse); } // MsgCreateClass is the Msg/CreateClass request type. @@ -384,14 +380,3 @@ message MsgUpdateClassMetadata { // MsgUpdateClassMetadataResponse is the MsgUpdateClassMetadata response type. message MsgUpdateClassMetadataResponse {} - -// MsgNewCreditType is the Msg/NewCreditType request type. -message MsgNewCreditType { - // root_address should be the governance address. - string root_address = 1; - // credit_type is the credit type to add. - CreditType credit_type = 2; -} - -// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. -message MsgNewCreditTypeResponse {} \ No newline at end of file diff --git a/x/ecocredit/core/msg_credit_type.go b/x/ecocredit/core/msg_credit_type.go new file mode 100644 index 0000000000..c3cb38ddcd --- /dev/null +++ b/x/ecocredit/core/msg_credit_type.go @@ -0,0 +1,21 @@ +package core + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +func (m CreditType) Validate() error { + if err := ValidateCreditTypeAbbreviation(m.Abbreviation); err != nil { + return err + } + if len(m.Name) == 0 { + return sdkerrors.ErrInvalidRequest.Wrap("name cannot be empty") + } + if len(m.Unit) == 0 { + return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") + } + if m.Precision != PRECISION { + return sdkerrors.ErrInvalidRequest.Wrapf("credit type precision is currently locked to %d", PRECISION) + } + return nil +} diff --git a/x/ecocredit/core/msg_credit_type_proposal.go b/x/ecocredit/core/msg_credit_type_proposal.go new file mode 100644 index 0000000000..a56400437a --- /dev/null +++ b/x/ecocredit/core/msg_credit_type_proposal.go @@ -0,0 +1,47 @@ +package core + +import ( + "fmt" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/regen-network/regen-ledger/x/ecocredit" +) + +var _ govtypes.Content = &CreditTypeProposal{} + +const ( + ProposalType = "CreditTypeProposal" + RouterKey = ecocredit.ModuleName +) + +func init() { + govtypes.RegisterProposalType(ProposalType) +} + +func NewCreditTypeProposal(title, description string, ct CreditType) govtypes.Content { + return &CreditTypeProposal{title, description, &ct} +} + +func (m *CreditTypeProposal) ProposalRoute() string { return RouterKey } + +func (m *CreditTypeProposal) ProposalType() string { return ProposalType } + +func (m *CreditTypeProposal) ValidateBasic() error { + if m.CreditType == nil { + return sdkerrors.ErrInvalidRequest.Wrap("credit type cannot be nil") + } + if err := m.CreditType.Validate(); err != nil { + return err + } + return govtypes.ValidateAbstract(m) +} + +func (m *CreditTypeProposal) String() string { + return fmt.Sprintf(`Credit Type Proposal: + Title: %s + Description: %s + Credit Type: %v +`, m.Title, m.Description, m.CreditType) +} diff --git a/x/ecocredit/core/msg_new_credit_type.go b/x/ecocredit/core/msg_new_credit_type.go deleted file mode 100644 index 11e7c150d9..0000000000 --- a/x/ecocredit/core/msg_new_credit_type.go +++ /dev/null @@ -1,47 +0,0 @@ -package core - -import ( - "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" - - "github.com/regen-network/regen-ledger/x/ecocredit" -) - -var _ legacytx.LegacyMsg = &MsgNewCreditType{} - -func (m MsgNewCreditType) ValidateBasic() error { - if _, err := types.AccAddressFromBech32(m.RootAddress); err != nil { - return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) - } - return m.CreditType.Validate() -} - -func (m MsgNewCreditType) GetSigners() []types.AccAddress { - addr, _ := types.AccAddressFromBech32(m.RootAddress) - return []types.AccAddress{addr} -} - -func (m MsgNewCreditType) GetSignBytes() []byte { - return types.MustSortJSON(ecocredit.ModuleCdc.MustMarshalJSON(&m)) -} - -func (m MsgNewCreditType) Route() string { return types.MsgTypeURL(&m) } - -func (m MsgNewCreditType) Type() string { return types.MsgTypeURL(&m) } - -func (m CreditType) Validate() error { - if err := ValidateCreditTypeAbbreviation(m.Abbreviation); err != nil { - return err - } - if len(m.Name) == 0 { - return sdkerrors.ErrInvalidRequest.Wrap("name cannot be empty") - } - if len(m.Unit) == 0 { - return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") - } - if m.Precision != PRECISION { - return sdkerrors.ErrInvalidRequest.Wrapf("credit type precision is currently locked to %d", PRECISION) - } - return nil -} diff --git a/x/ecocredit/core/proposal.pb.go b/x/ecocredit/core/proposal.pb.go new file mode 100644 index 0000000000..abf3112bef --- /dev/null +++ b/x/ecocredit/core/proposal.pb.go @@ -0,0 +1,432 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/v1/proposal.proto + +package core + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// CreditTypeProposal is a gov Content type for adding a credit type. +type CreditTypeProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (m *CreditTypeProposal) Reset() { *m = CreditTypeProposal{} } +func (*CreditTypeProposal) ProtoMessage() {} +func (*CreditTypeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_894af4f6d55c77b4, []int{0} +} +func (m *CreditTypeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreditTypeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreditTypeProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreditTypeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreditTypeProposal.Merge(m, src) +} +func (m *CreditTypeProposal) XXX_Size() int { + return m.Size() +} +func (m *CreditTypeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CreditTypeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CreditTypeProposal proto.InternalMessageInfo + +func (m *CreditTypeProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CreditTypeProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *CreditTypeProposal) GetCreditType() *CreditType { + if m != nil { + return m.CreditType + } + return nil +} + +func init() { + proto.RegisterType((*CreditTypeProposal)(nil), "regen.ecocredit.v1.CreditTypeProposal") +} + +func init() { proto.RegisterFile("regen/ecocredit/v1/proposal.proto", fileDescriptor_894af4f6d55c77b4) } + +var fileDescriptor_894af4f6d55c77b4 = []byte{ + // 255 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x4a, 0x4d, 0x4f, + 0xcd, 0xd3, 0x4f, 0x4d, 0xce, 0x4f, 0x2e, 0x4a, 0x4d, 0xc9, 0x2c, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, + 0x28, 0xca, 0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3, 0x8b, 0xb2, 0xa1, 0xbc, 0x9c, 0xd4, + 0x94, 0xf4, 0xd4, 0x22, 0xfd, 0x0a, 0xa4, 0x70, 0x48, 0xce, 0x2f, 0x4a, 0x4d, 0x62, 0x03, 0x7b, + 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xbf, 0x58, 0xb5, 0x5d, 0x01, 0x00, 0x00, +} + +func (m *CreditTypeProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreditTypeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreditTypeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreditType != nil { + { + size, err := m.CreditType.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CreditTypeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.CreditType != nil { + l = m.CreditType.Size() + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func sovProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProposal(x uint64) (n int) { + return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CreditTypeProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return 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 fmt.Errorf("proto: CreditTypeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreditTypeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreditType == nil { + m.CreditType = &CreditType{} + } + if err := m.CreditType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProposal(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/core/tx.pb.go b/x/ecocredit/core/tx.pb.go index 594fd9ca8f..b2f6470ac1 100644 --- a/x/ecocredit/core/tx.pb.go +++ b/x/ecocredit/core/tx.pb.go @@ -1569,98 +1569,6 @@ func (m *MsgUpdateClassMetadataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateClassMetadataResponse proto.InternalMessageInfo -// MsgNewCreditType is the Msg/NewCreditType request type. -type MsgNewCreditType struct { - // root_address should be the governance address. - RootAddress string `protobuf:"bytes,1,opt,name=root_address,json=rootAddress,proto3" json:"root_address,omitempty"` - // credit_type is the credit type to add. - CreditType *CreditType `protobuf:"bytes,2,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` -} - -func (m *MsgNewCreditType) Reset() { *m = MsgNewCreditType{} } -func (m *MsgNewCreditType) String() string { return proto.CompactTextString(m) } -func (*MsgNewCreditType) ProtoMessage() {} -func (*MsgNewCreditType) Descriptor() ([]byte, []int) { - return fileDescriptor_2b8ae49f50a3ddbd, []int{23} -} -func (m *MsgNewCreditType) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgNewCreditType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgNewCreditType.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgNewCreditType) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgNewCreditType.Merge(m, src) -} -func (m *MsgNewCreditType) XXX_Size() int { - return m.Size() -} -func (m *MsgNewCreditType) XXX_DiscardUnknown() { - xxx_messageInfo_MsgNewCreditType.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgNewCreditType proto.InternalMessageInfo - -func (m *MsgNewCreditType) GetRootAddress() string { - if m != nil { - return m.RootAddress - } - return "" -} - -func (m *MsgNewCreditType) GetCreditType() *CreditType { - if m != nil { - return m.CreditType - } - return nil -} - -// MsgNewCreditTypeResponse is the Msg/NewCreditType response type. -type MsgNewCreditTypeResponse struct { -} - -func (m *MsgNewCreditTypeResponse) Reset() { *m = MsgNewCreditTypeResponse{} } -func (m *MsgNewCreditTypeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgNewCreditTypeResponse) ProtoMessage() {} -func (*MsgNewCreditTypeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2b8ae49f50a3ddbd, []int{24} -} -func (m *MsgNewCreditTypeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgNewCreditTypeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgNewCreditTypeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgNewCreditTypeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgNewCreditTypeResponse.Merge(m, src) -} -func (m *MsgNewCreditTypeResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgNewCreditTypeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgNewCreditTypeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgNewCreditTypeResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgCreateClass)(nil), "regen.ecocredit.v1.MsgCreateClass") proto.RegisterType((*MsgCreateClassResponse)(nil), "regen.ecocredit.v1.MsgCreateClassResponse") @@ -1688,94 +1596,87 @@ func init() { proto.RegisterType((*MsgUpdateClassIssuersResponse)(nil), "regen.ecocredit.v1.MsgUpdateClassIssuersResponse") proto.RegisterType((*MsgUpdateClassMetadata)(nil), "regen.ecocredit.v1.MsgUpdateClassMetadata") proto.RegisterType((*MsgUpdateClassMetadataResponse)(nil), "regen.ecocredit.v1.MsgUpdateClassMetadataResponse") - proto.RegisterType((*MsgNewCreditType)(nil), "regen.ecocredit.v1.MsgNewCreditType") - proto.RegisterType((*MsgNewCreditTypeResponse)(nil), "regen.ecocredit.v1.MsgNewCreditTypeResponse") } func init() { proto.RegisterFile("regen/ecocredit/v1/tx.proto", fileDescriptor_2b8ae49f50a3ddbd) } var fileDescriptor_2b8ae49f50a3ddbd = []byte{ - // 1270 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6e, 0xdb, 0x46, - 0x13, 0x0f, 0x25, 0xc5, 0x16, 0x47, 0x51, 0xe2, 0xac, 0xf3, 0x19, 0x0a, 0x1d, 0xcb, 0x0a, 0xbf, - 0xa6, 0x51, 0xfe, 0x94, 0x84, 0x1d, 0xa0, 0x40, 0x50, 0x14, 0x81, 0xa3, 0x14, 0x88, 0x81, 0x2a, - 0x0d, 0xd4, 0x14, 0x05, 0x0a, 0x14, 0xc2, 0x8a, 0xdc, 0x30, 0x6c, 0x25, 0xae, 0xc0, 0x5d, 0xcb, - 0xce, 0xb9, 0x2f, 0x90, 0x5b, 0x1f, 0xa2, 0x40, 0x7b, 0x29, 0xd0, 0x57, 0xe8, 0x31, 0xc7, 0x1e, - 0x0a, 0xb4, 0x48, 0x5e, 0xa4, 0xe0, 0xee, 0x72, 0x45, 0xca, 0x22, 0xe5, 0x34, 0x87, 0x5e, 0x6c, - 0xee, 0xcc, 0x6f, 0x7e, 0x3b, 0x33, 0x3b, 0xbb, 0x33, 0x82, 0xed, 0x98, 0x04, 0x24, 0x72, 0x89, - 0x47, 0xbd, 0x98, 0xf8, 0x21, 0x77, 0x67, 0x7b, 0x2e, 0x3f, 0x71, 0xa6, 0x31, 0xe5, 0x14, 0x21, - 0xa1, 0x74, 0xb4, 0xd2, 0x99, 0xed, 0x59, 0x57, 0x02, 0x1a, 0x50, 0xa1, 0x76, 0x93, 0x2f, 0x89, - 0xb4, 0x76, 0x03, 0x4a, 0x83, 0x31, 0x71, 0xc5, 0x6a, 0x74, 0xf4, 0xdc, 0xe5, 0xe1, 0x84, 0x30, - 0x8e, 0x27, 0x53, 0x05, 0x68, 0x7b, 0x94, 0x4d, 0x28, 0x73, 0x47, 0x98, 0x11, 0x77, 0xb6, 0x37, - 0x22, 0x1c, 0xef, 0xb9, 0x1e, 0x0d, 0xa3, 0x54, 0xbf, 0xc4, 0x0f, 0xc6, 0x31, 0x27, 0x25, 0x7a, - 0xfe, 0x72, 0x4a, 0x98, 0xd4, 0xdb, 0xbf, 0x19, 0x70, 0xb1, 0xcf, 0x82, 0x5e, 0x4c, 0x30, 0x27, - 0xbd, 0x31, 0x66, 0x0c, 0x5d, 0x81, 0xf3, 0xd8, 0x9f, 0x84, 0x51, 0xcb, 0xe8, 0x18, 0x5d, 0x73, - 0x20, 0x17, 0xa8, 0x05, 0xeb, 0x21, 0x63, 0x47, 0x24, 0x66, 0xad, 0x4a, 0xa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0x79, 0x16, 0x6f, 0xad, - 0xa6, 0x51, 0x50, 0x6b, 0xef, 0xcc, 0x50, 0xbd, 0xe7, 0x11, 0x6c, 0x2e, 0x7b, 0xd7, 0x6e, 0xaf, - 0x66, 0x4a, 0xb1, 0xd6, 0xfe, 0xd9, 0xb1, 0xd9, 0xdb, 0x9c, 0x7f, 0xc5, 0x8a, 0x6e, 0x73, 0x0e, - 0x55, 0x78, 0x9b, 0x97, 0xbe, 0x4c, 0x0f, 0x9f, 0xfe, 0xfe, 0xa6, 0x6d, 0xbc, 0x7e, 0xd3, 0x36, - 0xfe, 0x7e, 0xd3, 0x36, 0x5e, 0xbd, 0x6d, 0x9f, 0x7b, 0xfd, 0xb6, 0x7d, 0xee, 0x8f, 0xb7, 0xed, - 0x73, 0xdf, 0x7c, 0x1c, 0x84, 0xfc, 0xc5, 0xd1, 0xc8, 0xf1, 0xe8, 0xc4, 0x15, 0x8c, 0x1f, 0x45, - 0x84, 0x1f, 0xd3, 0xf8, 0x7b, 0xb5, 0x1a, 0x13, 0x3f, 0x20, 0xb1, 0x7b, 0x92, 0xf9, 0x41, 0xef, - 0xd1, 0x98, 0x8c, 0xd6, 0xc4, 0xcf, 0x9d, 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xbb, - 0x80, 0xf7, 0x97, 0x10, 0x00, 0x00, + // 1196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xae, 0x93, 0xb4, 0x49, 0x4e, 0x48, 0xdb, 0x9d, 0x96, 0x2a, 0xeb, 0x6e, 0xd3, 0x60, 0x58, + 0x36, 0xfb, 0x83, 0xad, 0x76, 0x25, 0xa4, 0x0a, 0x21, 0xd4, 0x76, 0x91, 0x5a, 0x89, 0xc0, 0x2a, + 0x14, 0x21, 0x21, 0xa1, 0x68, 0x62, 0x9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0x3e, 0x76, 0x3d, 0x7e, 0x7c, 0xd2, 0x35, + 0x6d, 0xd6, 0xb7, 0x04, 0xef, 0x47, 0x3e, 0xf2, 0x33, 0x16, 0xfc, 0xa8, 0x56, 0x3d, 0x74, 0x5c, + 0x0c, 0xac, 0xf3, 0x91, 0xff, 0x6b, 0x6d, 0x16, 0x60, 0x77, 0x41, 0xbc, 0xfa, 0x9f, 0xff, 0x17, + 0x00, 0x00, 0xff, 0xff, 0xbe, 0x9a, 0x5f, 0xb6, 0x9e, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1827,9 +1728,6 @@ type MsgClient interface { UpdateClassIssuers(ctx context.Context, in *MsgUpdateClassIssuers, opts ...grpc.CallOption) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassMetadata, opts ...grpc.CallOption) (*MsgUpdateClassMetadataResponse, error) - // NewCreditType is a governance only method that adds a new credit type to - // the chain. - NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) } type msgClient struct { @@ -1939,15 +1837,6 @@ func (c *msgClient) UpdateClassMetadata(ctx context.Context, in *MsgUpdateClassM return out, nil } -func (c *msgClient) NewCreditType(ctx context.Context, in *MsgNewCreditType, opts ...grpc.CallOption) (*MsgNewCreditTypeResponse, error) { - out := new(MsgNewCreditTypeResponse) - err := c.cc.Invoke(ctx, "/regen.ecocredit.v1.Msg/NewCreditType", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // CreateClass creates a new credit class with an approved list of issuers and @@ -1987,9 +1876,6 @@ type MsgServer interface { UpdateClassIssuers(context.Context, *MsgUpdateClassIssuers) (*MsgUpdateClassIssuersResponse, error) // UpdateClassMetadata updates the credit class metadata UpdateClassMetadata(context.Context, *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) - // NewCreditType is a governance only method that adds a new credit type to - // the chain. - NewCreditType(context.Context, *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -2029,9 +1915,6 @@ func (*UnimplementedMsgServer) UpdateClassIssuers(ctx context.Context, req *MsgU func (*UnimplementedMsgServer) UpdateClassMetadata(ctx context.Context, req *MsgUpdateClassMetadata) (*MsgUpdateClassMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateClassMetadata not implemented") } -func (*UnimplementedMsgServer) NewCreditType(ctx context.Context, req *MsgNewCreditType) (*MsgNewCreditTypeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NewCreditType not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -2235,24 +2118,6 @@ func _Msg_UpdateClassMetadata_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Msg_NewCreditType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgNewCreditType) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).NewCreditType(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/regen.ecocredit.v1.Msg/NewCreditType", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).NewCreditType(ctx, req.(*MsgNewCreditType)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "regen.ecocredit.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -2301,10 +2166,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateClassMetadata", Handler: _Msg_UpdateClassMetadata_Handler, }, - { - MethodName: "NewCreditType", - Handler: _Msg_NewCreditType_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "regen/ecocredit/v1/tx.proto", @@ -3379,71 +3240,6 @@ func (m *MsgUpdateClassMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgNewCreditType) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgNewCreditType) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgNewCreditType) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CreditType != nil { - { - size, err := m.CreditType.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.RootAddress) > 0 { - i -= len(m.RootAddress) - copy(dAtA[i:], m.RootAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.RootAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgNewCreditTypeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgNewCreditTypeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgNewCreditTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3936,32 +3732,6 @@ func (m *MsgUpdateClassMetadataResponse) Size() (n int) { return n } -func (m *MsgNewCreditType) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RootAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.CreditType != nil { - l = m.CreditType.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgNewCreditTypeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7142,174 +6912,6 @@ func (m *MsgUpdateClassMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgNewCreditType) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return 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 fmt.Errorf("proto: MsgNewCreditType: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgNewCreditType: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreditType == nil { - m.CreditType = &CreditType{} - } - if err := m.CreditType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgNewCreditTypeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return 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 fmt.Errorf("proto: MsgNewCreditTypeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgNewCreditTypeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ecocredit/handler.go b/x/ecocredit/handler.go new file mode 100644 index 0000000000..1305381b06 --- /dev/null +++ b/x/ecocredit/handler.go @@ -0,0 +1,25 @@ +package ecocredit + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" + "github.com/regen-network/regen-ledger/x/ecocredit/server/core" +) + +func NewCreditTypeProposalHandler(k core.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *coretypes.CreditTypeProposal: + return handleCreditTypeProposal(ctx, k, c) + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized software upgrade proposal content type: %T", c) + } + } +} + +func handleCreditTypeProposal(ctx sdk.Context, k core.Keeper, proposal *coretypes.CreditTypeProposal) error { + return k.NewCreditType(ctx, proposal) +} diff --git a/x/ecocredit/server/core/new_credit_type.go b/x/ecocredit/server/core/new_credit_type.go index d178c886b6..25f47784a6 100644 --- a/x/ecocredit/server/core/new_credit_type.go +++ b/x/ecocredit/server/core/new_credit_type.go @@ -1,12 +1,29 @@ package core import ( - "context" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/x/ecocredit/core" ) -func (k Keeper) NewCreditType(ctx context.Context, creditType *core.MsgNewCreditType) (*core.MsgNewCreditTypeResponse, error) { - //TODO implement me - panic("implement me") +// NewCreditType adds a new credit type to the network +func (k Keeper) NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error { + if ctp == nil { + return sdkerrors.ErrInvalidRequest.Wrap("nil proposal") + } + if err := ctp.ValidateBasic(); err != nil { + return err + } + ct := ctp.CreditType + if err := k.stateStore.CreditTypeTable().Insert(sdk.WrapSDKContext(ctx), &api.CreditType{ + Abbreviation: ct.Abbreviation, + Name: ct.Name, + Unit: ct.Unit, + Precision: ct.Precision, + }); err != nil { + return sdkerrors.ErrInvalidRequest.Wrapf("could not insert credit type with abbreviation %s: %s", ct.Abbreviation, err.Error()) + } + return nil } diff --git a/x/ecocredit/server/utils/utils.go b/x/ecocredit/server/utils/utils.go index 65091d28ad..6f2d982225 100644 --- a/x/ecocredit/server/utils/utils.go +++ b/x/ecocredit/server/utils/utils.go @@ -3,6 +3,8 @@ package utils import ( "context" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/types/math" "github.com/regen-network/regen-ledger/x/ecocredit" @@ -51,3 +53,9 @@ func GetNonNegativeFixedDecs(precision uint32, decimals ...string) ([]math.Dec, } return decs, nil } + +// IsGovAddr returns weather or not the passed addr is the governance module address +func IsGovAddr(ak ecocredit.AccountKeeper, addr types.AccAddress) bool { + govAddr := ak.GetModuleAddress(govtypes.ModuleName) + return govAddr.Equals(addr) +} From 2dd5ecc2f8c5c461a93946925c4b9cf5cec9dae7 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 09:16:49 -0700 Subject: [PATCH 03/25] wip: wires --- app/app.go | 3 +++ x/ecocredit/expected_keepers.go | 3 +++ x/ecocredit/handler.go | 5 ++--- x/ecocredit/module/module.go | 6 +++--- x/ecocredit/server/server.go | 7 ++++++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/app.go b/app/app.go index eae8b4ddac..d2381f6052 100644 --- a/app/app.go +++ b/app/app.go @@ -97,6 +97,7 @@ import ( data "github.com/regen-network/regen-ledger/x/data/module" "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/basket" + "github.com/regen-network/regen-ledger/x/ecocredit/core" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module" // unnamed import of statik for swagger UI support _ "github.com/regen-network/regen-ledger/v3/client/docs/statik" @@ -404,6 +405,8 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest } app.smm.RegisterInvariants(&app.CrisisKeeper) + govRouter.AddRoute(core.RouterKey, ecocredit.NewCreditTypeProposalHandler(ecocreditModule.Keeper)) + var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) app.mm = module.NewManager( diff --git a/x/ecocredit/expected_keepers.go b/x/ecocredit/expected_keepers.go index da061e1bcf..d2bcf65c37 100644 --- a/x/ecocredit/expected_keepers.go +++ b/x/ecocredit/expected_keepers.go @@ -5,6 +5,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/params/types" + + "github.com/regen-network/regen-ledger/x/ecocredit/core" ) // AccountKeeper defines the expected interface needed to create and retrieve accounts. @@ -38,6 +40,7 @@ type BankKeeper interface { // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { PruneOrders(ctx sdk.Context) error + NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error } type DistributionKeeper interface { diff --git a/x/ecocredit/handler.go b/x/ecocredit/handler.go index 1305381b06..3a179ca6bd 100644 --- a/x/ecocredit/handler.go +++ b/x/ecocredit/handler.go @@ -6,10 +6,9 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" - "github.com/regen-network/regen-ledger/x/ecocredit/server/core" ) -func NewCreditTypeProposalHandler(k core.Keeper) govtypes.Handler { +func NewCreditTypeProposalHandler(k Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { case *coretypes.CreditTypeProposal: @@ -20,6 +19,6 @@ func NewCreditTypeProposalHandler(k core.Keeper) govtypes.Handler { } } -func handleCreditTypeProposal(ctx sdk.Context, k core.Keeper, proposal *coretypes.CreditTypeProposal) error { +func handleCreditTypeProposal(ctx sdk.Context, k Keeper, proposal *coretypes.CreditTypeProposal) error { return k.NewCreditType(ctx, proposal) } diff --git a/x/ecocredit/module/module.go b/x/ecocredit/module/module.go index b6331e51c0..74ee51fd0b 100644 --- a/x/ecocredit/module/module.go +++ b/x/ecocredit/module/module.go @@ -42,7 +42,7 @@ type Module struct { accountKeeper ecocredit.AccountKeeper bankKeeper ecocredit.BankKeeper distributionKeeper ecocredit.DistributionKeeper - keeper ecocredit.Keeper + Keeper ecocredit.Keeper } // NewModule returns a new Module object. @@ -82,7 +82,7 @@ func (a Module) RegisterInterfaces(registry types.InterfaceRegistry) { } func (a *Module) RegisterServices(configurator servermodule.Configurator) { - a.keeper = server.RegisterServices(configurator, a.paramSpace, a.accountKeeper, a.bankKeeper, a.distributionKeeper) + a.Keeper = server.RegisterServices(configurator, a.paramSpace, a.accountKeeper, a.bankKeeper, a.distributionKeeper) } //nolint:errcheck @@ -204,7 +204,7 @@ func (Module) WeightedOperations(simState module.SimulationState) []simtypes.Wei // BeginBlock checks if there are any expired sell or buy orders and removes them from state. func (a Module) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - err := ecocredit.BeginBlocker(ctx, a.keeper) + err := ecocredit.BeginBlocker(ctx, a.Keeper) if err != nil { panic(err) } diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index f5c923e08f..71c0f6f138 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -7,8 +7,9 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/orm" + + api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/types/module/server" "github.com/regen-network/regen-ledger/types/ormstore" "github.com/regen-network/regen-ledger/x/ecocredit" @@ -81,6 +82,10 @@ type serverImpl struct { db ormdb.ModuleDB } +func (s serverImpl) NewCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error { + return s.coreKeeper.NewCreditType(ctx, ctp) +} + func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper, distKeeper ecocredit.DistributionKeeper, cdc codec.Codec) serverImpl { s := serverImpl{ From 0c0ddbd1f01facad3ffdbc34d7ecdd026fbfd26f Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 17:57:10 -0700 Subject: [PATCH 04/25] feat: final gov handler --- Makefile | 2 +- app/app.go | 36 ++-- app/stable_appconfig.go | 11 +- x/ecocredit/client/core/proposal.go | 74 ++++++++ x/ecocredit/client/tx.go | 2 + x/ecocredit/core/codec.go | 1 - x/ecocredit/core/msg_create_project.go | 1 + x/ecocredit/core/msg_credit_type_proposal.go | 3 +- x/ecocredit/expected_keepers.go | 8 - x/ecocredit/keys.go | 4 +- x/ecocredit/mocks/expected_keepers.go | 37 ---- x/ecocredit/module/module.go | 4 +- x/ecocredit/{ => server}/abci.go | 6 +- x/ecocredit/server/abci_test.go | 174 +++++++++++++++++++ x/ecocredit/server/core/keeper.go | 7 + x/ecocredit/server/expected_keepers.go | 13 ++ x/ecocredit/{ => server}/handler.go | 2 +- x/ecocredit/server/mocks/expected_keepers.go | 64 +++++++ x/ecocredit/server/server.go | 2 +- 19 files changed, 365 insertions(+), 86 deletions(-) create mode 100644 x/ecocredit/client/core/proposal.go rename x/ecocredit/{ => server}/abci.go (65%) create mode 100644 x/ecocredit/server/abci_test.go create mode 100644 x/ecocredit/server/expected_keepers.go rename x/ecocredit/{ => server}/handler.go (97%) create mode 100644 x/ecocredit/server/mocks/expected_keepers.go diff --git a/Makefile b/Makefile index 7bff89f463..97edadc4ca 100644 --- a/Makefile +++ b/Makefile @@ -412,7 +412,7 @@ regen-mocks: mkdir -p x/ecocredit/server/core/mocks mockgen -source=x/ecocredit/server/core/keeper.go -package mocks -destination x/ecocredit/server/core/mocks/keeper.go - mockgen -source=x/ecocredit/expected_keepers.go -package mocks -destination x/ecocredit/mocks/expected_keepers.go + mockgen -source=x/ecocredit/server/expected_keepers.go -package mocks -destination x/ecocredit/server/mocks/expected_keepers.go mkdir -p x/ecocredit/server/basket/mocks mockgen -source=x/ecocredit/server/basket/keeper.go -package mocks -destination x/ecocredit/server/basket/mocks/keeper.go diff --git a/app/app.go b/app/app.go index d2381f6052..e648ca8d93 100644 --- a/app/app.go +++ b/app/app.go @@ -8,6 +8,9 @@ import ( "os" "github.com/CosmWasm/wasmd/x/wasm" + distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" "github.com/cosmos/ibc-go/v2/modules/apps/transfer" ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper" @@ -97,8 +100,10 @@ import ( data "github.com/regen-network/regen-ledger/x/data/module" "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/basket" - "github.com/regen-network/regen-ledger/x/ecocredit/core" + "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module" + ecoServer "github.com/regen-network/regen-ledger/x/ecocredit/server" + // unnamed import of statik for swagger UI support _ "github.com/regen-network/regen-ledger/v3/client/docs/statik" ) @@ -138,6 +143,11 @@ var ( authzmodule.AppModuleBasic{}, ecocreditmodule.Module{}, data.Module{}, + gov.NewAppModuleBasic( + paramsclient.ProposalHandler, distrclient.ProposalHandler, + upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, + core.CreditTypeProposalHandler, + ), }, setCustomModuleBasics()...)..., ) @@ -340,7 +350,6 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) //. - // AddRoute(core.RouterKey, ecocredit.NewCreditTypeProposalHandler()) // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( @@ -377,13 +386,6 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest ) app.AuthzKeeper = authzKeeper - app.setCustomKeepers(bApp, keys, appCodec, govRouter, homePath, appOpts, wasmOpts) - - app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, - ) - // register custom modules here app.smm = setCustomModules(app, interfaceRegistry) ecocreditModule := ecocreditmodule.NewModule( @@ -405,7 +407,11 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest } app.smm.RegisterInvariants(&app.CrisisKeeper) - govRouter.AddRoute(core.RouterKey, ecocredit.NewCreditTypeProposalHandler(ecocreditModule.Keeper)) + govRouter.AddRoute(ecocredit.RouterKey, ecoServer.NewCreditTypeProposalHandler(ecocreditModule.Keeper)) + app.GovKeeper = govkeeper.NewKeeper( + appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, + &stakingKeeper, govRouter, + ) var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) @@ -583,14 +589,6 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest return app } -// MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by -// Regenapp. It is useful for tests and clients who do not want to construct the -// full Regenapp -func MakeCodecs() (codec.Codec, *codec.LegacyAmino) { - config := MakeEncodingConfig() - return config.Marshaler, config.Amino -} - // Name returns the name of the App func (app *RegenApp) Name() string { return app.BaseApp.Name() } @@ -726,7 +724,7 @@ func (app *RegenApp) RegisterTendermintService(clientCtx client.Context) { } // RegisterSwaggerAPI registers swagger route with API Server -func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router) { +func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) { statikFS, err := fs.New() if err != nil { panic(err) diff --git a/app/stable_appconfig.go b/app/stable_appconfig.go index ba171b4856..6b4aa1a862 100644 --- a/app/stable_appconfig.go +++ b/app/stable_appconfig.go @@ -16,23 +16,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth/ante" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - "github.com/cosmos/cosmos-sdk/x/gov" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" "github.com/regen-network/regen-ledger/types/module/server" ) func setCustomModuleBasics() []module.AppModuleBasic { - return []module.AppModuleBasic{ - gov.NewAppModuleBasic( - paramsclient.ProposalHandler, distrclient.ProposalHandler, - upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - ), - } + return []module.AppModuleBasic{} } // setCustomModules registers new modules with the server module manager. diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go new file mode 100644 index 0000000000..d58a2f8bda --- /dev/null +++ b/x/ecocredit/client/core/proposal.go @@ -0,0 +1,74 @@ +package core + +import ( + "fmt" + "strconv" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/regen-network/regen-ledger/x/ecocredit/core" +) + +var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, nil) + +func TxCreditTypeProposalCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "credit-type-proposal [proposal-title] [proposal-description] [credit_type_abbreviation] [credit_type_name] [units] [precision] [flags]", + Args: cobra.ExactArgs(6), + Short: "Submit a proposal for a new credit type", + Long: "Submit a proposal to add a new credit type. The credit type abbreviation and name MUST be unique, else " + + "the proposal will fail upon execution. Units are measurements units (i.e. metric tonne). Precision is how " + + "many decimal places are allowed in the credits.", + Example: `regen tx gov submit-proposal credit-type-proposal "Add Biodiversity Type" "A biodiversity type would be great..." BIO biodiversity "sq. meters" 3`, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + title, desc, abbrev, name, units, precisionStr := args[0], args[1], args[2], args[3], args[4], args[5] + precisionU64, err := strconv.ParseUint(precisionStr, 10, 32) + if err != nil { + return fmt.Errorf("invalid precision %s: %w", precisionStr, err) + } + proposal := core.CreditTypeProposal{ + Title: title, + Description: desc, + CreditType: &core.CreditType{ + Abbreviation: abbrev, + Name: name, + Unit: units, + Precision: uint32(precisionU64), + }, + } + if err := proposal.ValidateBasic(); err != nil { + return fmt.Errorf("invalid proposal: %w", err) + } + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + var content types.Content = &proposal + msg, err := types.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") + return cmd +} diff --git a/x/ecocredit/client/tx.go b/x/ecocredit/client/tx.go index c880d3dcc2..de81a64996 100644 --- a/x/ecocredit/client/tx.go +++ b/x/ecocredit/client/tx.go @@ -20,6 +20,7 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit" basketcli "github.com/regen-network/regen-ledger/x/ecocredit/client/basket" + "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ) // TxCmd returns a root CLI command handler for all x/ecocredit transaction commands. @@ -46,6 +47,7 @@ func TxCmd(name string) *cobra.Command { TxSellCmd(), TxUpdateSellOrdersCmd(), TxBuyCmd(), + core.TxCreditTypeProposalCmd(), basketcli.TxCreateBasket(), basketcli.TxPutInBasket(), basketcli.TxTakeFromBasket(), diff --git a/x/ecocredit/core/codec.go b/x/ecocredit/core/codec.go index 1c34e5a08b..2c0692e1a2 100644 --- a/x/ecocredit/core/codec.go +++ b/x/ecocredit/core/codec.go @@ -21,5 +21,4 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateClassAdmin{}, "regen.core/MsgUpdateClassAdmin", nil) cdc.RegisterConcrete(&MsgUpdateClassMetadata{}, "regen.core/MsgUpdateClassMetadata", nil) cdc.RegisterConcrete(&MsgUpdateClassIssuers{}, "regen.core/MsgUpdateClassIssuers", nil) - cdc.RegisterConcrete(&MsgNewCreditType{}, "regen.core/MsgNewCreditType", nil) } diff --git a/x/ecocredit/core/msg_create_project.go b/x/ecocredit/core/msg_create_project.go index 54af8bf2bd..47692de9ab 100644 --- a/x/ecocredit/core/msg_create_project.go +++ b/x/ecocredit/core/msg_create_project.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + "github.com/regen-network/regen-ledger/x/ecocredit" ) diff --git a/x/ecocredit/core/msg_credit_type_proposal.go b/x/ecocredit/core/msg_credit_type_proposal.go index a56400437a..251d05fddd 100644 --- a/x/ecocredit/core/msg_credit_type_proposal.go +++ b/x/ecocredit/core/msg_credit_type_proposal.go @@ -13,7 +13,6 @@ var _ govtypes.Content = &CreditTypeProposal{} const ( ProposalType = "CreditTypeProposal" - RouterKey = ecocredit.ModuleName ) func init() { @@ -24,7 +23,7 @@ func NewCreditTypeProposal(title, description string, ct CreditType) govtypes.Co return &CreditTypeProposal{title, description, &ct} } -func (m *CreditTypeProposal) ProposalRoute() string { return RouterKey } +func (m *CreditTypeProposal) ProposalRoute() string { return ecocredit.RouterKey } func (m *CreditTypeProposal) ProposalType() string { return ProposalType } diff --git a/x/ecocredit/expected_keepers.go b/x/ecocredit/expected_keepers.go index d2bcf65c37..86ec22b767 100644 --- a/x/ecocredit/expected_keepers.go +++ b/x/ecocredit/expected_keepers.go @@ -5,8 +5,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/params/types" - - "github.com/regen-network/regen-ledger/x/ecocredit/core" ) // AccountKeeper defines the expected interface needed to create and retrieve accounts. @@ -37,12 +35,6 @@ type BankKeeper interface { GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin } -// Keeper defines the expected interface needed to prune expired buy and sell orders. -type Keeper interface { - PruneOrders(ctx sdk.Context) error - NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error -} - type DistributionKeeper interface { FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error } diff --git a/x/ecocredit/keys.go b/x/ecocredit/keys.go index a0a18edf26..8d3c21aac1 100644 --- a/x/ecocredit/keys.go +++ b/x/ecocredit/keys.go @@ -16,8 +16,8 @@ import ( const ( // ModuleName is the module name constant used in many places - ModuleName = "ecocredit" - + ModuleName = "ecocredit" + RouterKey = ModuleName DefaultParamspace = ModuleName TradableBalancePrefix byte = 0x0 diff --git a/x/ecocredit/mocks/expected_keepers.go b/x/ecocredit/mocks/expected_keepers.go index 7dba138029..f0d27abceb 100644 --- a/x/ecocredit/mocks/expected_keepers.go +++ b/x/ecocredit/mocks/expected_keepers.go @@ -238,43 +238,6 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } -// MockKeeper is a mock of Keeper interface. -type MockKeeper struct { - ctrl *gomock.Controller - recorder *MockKeeperMockRecorder -} - -// MockKeeperMockRecorder is the mock recorder for MockKeeper. -type MockKeeperMockRecorder struct { - mock *MockKeeper -} - -// NewMockKeeper creates a new mock instance. -func NewMockKeeper(ctrl *gomock.Controller) *MockKeeper { - mock := &MockKeeper{ctrl: ctrl} - mock.recorder = &MockKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockKeeper) EXPECT() *MockKeeperMockRecorder { - return m.recorder -} - -// PruneOrders mocks base method. -func (m *MockKeeper) PruneOrders(ctx types.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PruneOrders", ctx) - ret0, _ := ret[0].(error) - return ret0 -} - -// PruneOrders indicates an expected call of PruneOrders. -func (mr *MockKeeperMockRecorder) PruneOrders(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PruneOrders", reflect.TypeOf((*MockKeeper)(nil).PruneOrders), ctx) -} - // MockDistributionKeeper is a mock of DistributionKeeper interface. type MockDistributionKeeper struct { ctrl *gomock.Controller diff --git a/x/ecocredit/module/module.go b/x/ecocredit/module/module.go index 74ee51fd0b..ef8bc8c246 100644 --- a/x/ecocredit/module/module.go +++ b/x/ecocredit/module/module.go @@ -42,7 +42,7 @@ type Module struct { accountKeeper ecocredit.AccountKeeper bankKeeper ecocredit.BankKeeper distributionKeeper ecocredit.DistributionKeeper - Keeper ecocredit.Keeper + Keeper server.Keeper } // NewModule returns a new Module object. @@ -204,7 +204,7 @@ func (Module) WeightedOperations(simState module.SimulationState) []simtypes.Wei // BeginBlock checks if there are any expired sell or buy orders and removes them from state. func (a Module) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - err := ecocredit.BeginBlocker(ctx, a.Keeper) + err := server.BeginBlocker(ctx, a.Keeper) if err != nil { panic(err) } diff --git a/x/ecocredit/abci.go b/x/ecocredit/server/abci.go similarity index 65% rename from x/ecocredit/abci.go rename to x/ecocredit/server/abci.go index c0a8e75061..6988215f53 100644 --- a/x/ecocredit/abci.go +++ b/x/ecocredit/server/abci.go @@ -1,15 +1,17 @@ -package ecocredit +package server import ( "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/regen-network/regen-ledger/x/ecocredit" ) // BeginBlocker checks if there are any expired sell or buy orders and removes them from state. func BeginBlocker(ctx sdk.Context, k Keeper) error { - defer telemetry.ModuleMeasureSince(ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(ecocredit.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) if err := k.PruneOrders(ctx); err != nil { return err diff --git a/x/ecocredit/server/abci_test.go b/x/ecocredit/server/abci_test.go new file mode 100644 index 0000000000..4f2b050511 --- /dev/null +++ b/x/ecocredit/server/abci_test.go @@ -0,0 +1,174 @@ +package server + +import ( + "context" + "testing" + + "github.com/cosmos/cosmos-sdk/orm/model/ormdb" + "github.com/cosmos/cosmos-sdk/orm/model/ormtable" + "github.com/cosmos/cosmos-sdk/orm/testing/ormtest" + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/golang/mock/gomock" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + "gotest.tools/v3/assert" + + api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" + "github.com/regen-network/regen-ledger/types/ormutil" + "github.com/regen-network/regen-ledger/x/ecocredit" + coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" + "github.com/regen-network/regen-ledger/x/ecocredit/mocks" + "github.com/regen-network/regen-ledger/x/ecocredit/server/core" +) + +type TestSuite struct { + module module.AppModule + keeper Keeper + stateStore api.StateStore + querier sdk.Querier + handler govtypes.Handler + sdkCtx sdk.Context + ctx context.Context +} + +func setupTest(t *testing.T) TestSuite { + s := TestSuite{} + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db) + storeKey := sdk.NewKVStoreKey("test") + cms.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) + assert.NilError(t, cms.LoadLatestVersion()) + ormCtx := ormtable.WrapContextDefault(ormtest.NewMemoryBackend()) + s.sdkCtx = sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()).WithContext(ormCtx) + s.ctx = sdk.WrapSDKContext(s.sdkCtx) + + ormDB, err := ormdb.NewModuleDB(&ecocredit.ModuleSchema, ormdb.ModuleDBOptions{}) + assert.NilError(t, err) + s.stateStore, err = api.NewStateStore(ormDB) + ctrl := gomock.NewController(t) + bankKeeper := mocks.NewMockBankKeeper(ctrl) + paramsKeeper := mocks.NewMockParamKeeper(ctrl) + s.keeper = core.NewKeeper(s.stateStore, bankKeeper, paramsKeeper) + s.handler = NewCreditTypeProposalHandler(s.keeper) + return s +} + +func TestCreditTypeProposal_BasicValid(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "BIO", + Name: "biodiversity", + Unit: "meters squared", + Precision: 6, + } + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "dude wheres my credit type?", + Description: "and then?", + CreditType: ct, + }) + assert.NilError(t, err) + ct2, err := s.stateStore.CreditTypeTable().Get(s.ctx, "BIO") + assert.NilError(t, err) + assertCreditTypesEqual(t, ct, ct2) +} + +func TestCreditTypeProposal_InvalidPrecision(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "BIO", + Name: "biodiversity", + Unit: "meters squared", + Precision: 3, + } + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "My New Credit Type", + Description: "its very cool and awesome", + CreditType: ct, + }) + assert.ErrorContains(t, err, "credit type precision is currently locked to 6") +} + +func TestCreditTypeProposal_InvalidAbbreviation(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "biO", + Name: "biodiversity", + Unit: "meters squared", + Precision: 6, + } + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "My New Credit Type", + Description: "its very cool and awesome", + CreditType: ct, + }) + assert.ErrorContains(t, err, "credit type abbreviation must be 1-3 uppercase latin letters") +} + +func TestCreditTypeProposal_NoName(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "BIO", + Unit: "meters squared", + Precision: 6, + } + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "My New Credit Type", + Description: "its very cool and awesome", + CreditType: ct, + }) + assert.ErrorContains(t, err, "name cannot be empty") +} + +func TestCreditTypeProposal_NoUnit(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "BIO", + Name: "FooBar", + Precision: 6, + } + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "My New Credit Type", + Description: "its very cool and awesome", + CreditType: ct, + }) + assert.ErrorContains(t, err, "unit cannot be empty") +} + +func TestCreditTypeProposal_Duplicate(t *testing.T) { + t.Parallel() + s := setupTest(t) + ct := &coretypes.CreditType{ + Abbreviation: "BIO", + Name: "FooBar", + Unit: "many", + Precision: 6, + } + var pulsarCreditType api.CreditType + assert.NilError(t, ormutil.GogoToPulsarSlow(ct, &pulsarCreditType)) + assert.NilError(t, s.stateStore.CreditTypeTable().Insert(s.ctx, &pulsarCreditType)) + err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + Title: "My New Credit Type", + Description: "its very cool and awesome", + CreditType: ct, + }) + assert.ErrorContains(t, err, "could not insert credit type with abbreviation BIO") +} + +func assertCreditTypesEqual(t *testing.T, ct *coretypes.CreditType, ct2 *api.CreditType) { + assert.Check(t, ct != nil) + assert.Check(t, ct2 != nil) + + assert.Equal(t, ct.Abbreviation, ct2.Abbreviation) + assert.Equal(t, ct.Name, ct2.Name) + assert.Equal(t, ct.Unit, ct2.Unit) + assert.Equal(t, ct.Precision, ct2.Precision) +} diff --git a/x/ecocredit/server/core/keeper.go b/x/ecocredit/server/core/keeper.go index 7109d8871b..85a360b002 100644 --- a/x/ecocredit/server/core/keeper.go +++ b/x/ecocredit/server/core/keeper.go @@ -1,6 +1,8 @@ package core import ( + sdk "github.com/cosmos/cosmos-sdk/types" + api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/core" @@ -15,6 +17,11 @@ type Keeper struct { paramsKeeper ecocredit.ParamKeeper } +func (k Keeper) PruneOrders(ctx sdk.Context) error { + //TODO implement me + panic("implement me") +} + func NewKeeper(ss api.StateStore, bk ecocredit.BankKeeper, pk ecocredit.ParamKeeper) Keeper { return Keeper{ stateStore: ss, diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go new file mode 100644 index 0000000000..f28a127833 --- /dev/null +++ b/x/ecocredit/server/expected_keepers.go @@ -0,0 +1,13 @@ +package server + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/regen-network/regen-ledger/x/ecocredit/core" +) + +// Keeper defines the expected interface needed to prune expired buy and sell orders. +type Keeper interface { + PruneOrders(ctx sdk.Context) error + NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error +} diff --git a/x/ecocredit/handler.go b/x/ecocredit/server/handler.go similarity index 97% rename from x/ecocredit/handler.go rename to x/ecocredit/server/handler.go index 3a179ca6bd..179019c3c9 100644 --- a/x/ecocredit/handler.go +++ b/x/ecocredit/server/handler.go @@ -1,4 +1,4 @@ -package ecocredit +package server import ( sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/ecocredit/server/mocks/expected_keepers.go b/x/ecocredit/server/mocks/expected_keepers.go new file mode 100644 index 0000000000..05fabee4db --- /dev/null +++ b/x/ecocredit/server/mocks/expected_keepers.go @@ -0,0 +1,64 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/ecocredit/server/expected_keepers.go + +// Package mocks is a generated GoMock package. +package mocks + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + gomock "github.com/golang/mock/gomock" + core "github.com/regen-network/regen-ledger/x/ecocredit/core" +) + +// MockKeeper is a mock of Keeper interface. +type MockKeeper struct { + ctrl *gomock.Controller + recorder *MockKeeperMockRecorder +} + +// MockKeeperMockRecorder is the mock recorder for MockKeeper. +type MockKeeperMockRecorder struct { + mock *MockKeeper +} + +// NewMockKeeper creates a new mock instance. +func NewMockKeeper(ctrl *gomock.Controller) *MockKeeper { + mock := &MockKeeper{ctrl: ctrl} + mock.recorder = &MockKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockKeeper) EXPECT() *MockKeeperMockRecorder { + return m.recorder +} + +// NewCreditType mocks base method. +func (m *MockKeeper) NewCreditType(ctx types.Context, ctp *core.CreditTypeProposal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewCreditType", ctx, ctp) + ret0, _ := ret[0].(error) + return ret0 +} + +// NewCreditType indicates an expected call of NewCreditType. +func (mr *MockKeeperMockRecorder) NewCreditType(ctx, ctp interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewCreditType", reflect.TypeOf((*MockKeeper)(nil).NewCreditType), ctx, ctp) +} + +// PruneOrders mocks base method. +func (m *MockKeeper) PruneOrders(ctx types.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PruneOrders", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// PruneOrders indicates an expected call of PruneOrders. +func (mr *MockKeeperMockRecorder) PruneOrders(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PruneOrders", reflect.TypeOf((*MockKeeper)(nil).PruneOrders), ctx) +} diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index 71c0f6f138..3475404723 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -250,7 +250,7 @@ func RegisterServices( accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper, distKeeper ecocredit.DistributionKeeper, -) ecocredit.Keeper { +) Keeper { impl := newServer(configurator.ModuleKey(), paramSpace, accountKeeper, bankKeeper, distKeeper, configurator.Marshaler()) ecocredit.RegisterMsgServer(configurator.MsgServer(), impl) From b04bb2e51015e2a3ca13786d2f4e4569bfe6c61f Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 18:17:14 -0700 Subject: [PATCH 05/25] chore: cleanup dead code --- api/regen/ecocredit/v1/proposal.pulsar.go | 744 ---------------------- api/regen/ecocredit/v1/tx.pulsar.go | 3 - api/regen/ecocredit/v1/types.pulsar.go | 703 +++++++++++++++++++- app/app.go | 4 +- proto/regen/ecocredit/v1/proposal.proto | 17 - proto/regen/ecocredit/v1/tx.proto | 1 - proto/regen/ecocredit/v1/types.proto | 15 + x/ecocredit/client/core/proposal.go | 4 +- x/ecocredit/core/proposal.pb.go | 432 ------------- x/ecocredit/core/tx.pb.go | 144 ++--- x/ecocredit/core/types.pb.go | 353 +++++++++- x/ecocredit/server/utils/utils.go | 8 - 12 files changed, 1084 insertions(+), 1344 deletions(-) delete mode 100644 api/regen/ecocredit/v1/proposal.pulsar.go delete mode 100644 proto/regen/ecocredit/v1/proposal.proto delete mode 100644 x/ecocredit/core/proposal.pb.go diff --git a/api/regen/ecocredit/v1/proposal.pulsar.go b/api/regen/ecocredit/v1/proposal.pulsar.go deleted file mode 100644 index 3b268213e6..0000000000 --- a/api/regen/ecocredit/v1/proposal.pulsar.go +++ /dev/null @@ -1,744 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package ecocreditv1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/gogo/protobuf/gogoproto" - 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_CreditTypeProposal protoreflect.MessageDescriptor - fd_CreditTypeProposal_title protoreflect.FieldDescriptor - fd_CreditTypeProposal_description protoreflect.FieldDescriptor - fd_CreditTypeProposal_credit_type protoreflect.FieldDescriptor -) - -func init() { - file_regen_ecocredit_v1_proposal_proto_init() - md_CreditTypeProposal = File_regen_ecocredit_v1_proposal_proto.Messages().ByName("CreditTypeProposal") - fd_CreditTypeProposal_title = md_CreditTypeProposal.Fields().ByName("title") - fd_CreditTypeProposal_description = md_CreditTypeProposal.Fields().ByName("description") - fd_CreditTypeProposal_credit_type = md_CreditTypeProposal.Fields().ByName("credit_type") -} - -var _ protoreflect.Message = (*fastReflection_CreditTypeProposal)(nil) - -type fastReflection_CreditTypeProposal CreditTypeProposal - -func (x *CreditTypeProposal) ProtoReflect() protoreflect.Message { - return (*fastReflection_CreditTypeProposal)(x) -} - -func (x *CreditTypeProposal) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1_proposal_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_CreditTypeProposal_messageType fastReflection_CreditTypeProposal_messageType -var _ protoreflect.MessageType = fastReflection_CreditTypeProposal_messageType{} - -type fastReflection_CreditTypeProposal_messageType struct{} - -func (x fastReflection_CreditTypeProposal_messageType) Zero() protoreflect.Message { - return (*fastReflection_CreditTypeProposal)(nil) -} -func (x fastReflection_CreditTypeProposal_messageType) New() protoreflect.Message { - return new(fastReflection_CreditTypeProposal) -} -func (x fastReflection_CreditTypeProposal_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_CreditTypeProposal -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_CreditTypeProposal) Descriptor() protoreflect.MessageDescriptor { - return md_CreditTypeProposal -} - -// 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_CreditTypeProposal) Type() protoreflect.MessageType { - return _fastReflection_CreditTypeProposal_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_CreditTypeProposal) New() protoreflect.Message { - return new(fastReflection_CreditTypeProposal) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_CreditTypeProposal) Interface() protoreflect.ProtoMessage { - return (*CreditTypeProposal)(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_CreditTypeProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Title != "" { - value := protoreflect.ValueOfString(x.Title) - if !f(fd_CreditTypeProposal_title, value) { - return - } - } - if x.Description != "" { - value := protoreflect.ValueOfString(x.Description) - if !f(fd_CreditTypeProposal_description, value) { - return - } - } - if x.CreditType != nil { - value := protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) - if !f(fd_CreditTypeProposal_credit_type, 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_CreditTypeProposal) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.title": - return x.Title != "" - case "regen.ecocredit.v1.CreditTypeProposal.description": - return x.Description != "" - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - return x.CreditType != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.title": - x.Title = "" - case "regen.ecocredit.v1.CreditTypeProposal.description": - x.Description = "" - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - x.CreditType = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.title": - value := x.Title - return protoreflect.ValueOfString(value) - case "regen.ecocredit.v1.CreditTypeProposal.description": - value := x.Description - return protoreflect.ValueOfString(value) - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - value := x.CreditType - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.title": - x.Title = value.Interface().(string) - case "regen.ecocredit.v1.CreditTypeProposal.description": - x.Description = value.Interface().(string) - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - x.CreditType = value.Message().Interface().(*CreditType) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - if x.CreditType == nil { - x.CreditType = new(CreditType) - } - return protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) - case "regen.ecocredit.v1.CreditTypeProposal.title": - panic(fmt.Errorf("field title of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) - case "regen.ecocredit.v1.CreditTypeProposal.description": - panic(fmt.Errorf("field description of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "regen.ecocredit.v1.CreditTypeProposal.title": - return protoreflect.ValueOfString("") - case "regen.ecocredit.v1.CreditTypeProposal.description": - return protoreflect.ValueOfString("") - case "regen.ecocredit.v1.CreditTypeProposal.credit_type": - m := new(CreditType) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) - } - panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.CreditTypeProposal", 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*CreditTypeProposal) - 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.Title) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Description) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.CreditType != nil { - l = options.Size(x.CreditType) - 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().(*CreditTypeProposal) - 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 x.CreditType != nil { - encoded, err := options.Marshal(x.CreditType) - 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.Description) > 0 { - i -= len(x.Description) - copy(dAtA[i:], x.Description) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) - i-- - dAtA[i] = 0x12 - } - if len(x.Title) > 0 { - i -= len(x.Title) - copy(dAtA[i:], x.Title) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) - 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().(*CreditTypeProposal) - 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: CreditTypeProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CreditTypeProposal: 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 Title", 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.Title = 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 Description", 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.Description = 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 CreditType", 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 - } - if x.CreditType == nil { - x.CreditType = &CreditType{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreditType); 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, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: regen/ecocredit/v1/proposal.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) -) - -// CreditTypeProposal is a gov Content type for adding a credit type. -type CreditTypeProposal struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` -} - -func (x *CreditTypeProposal) Reset() { - *x = CreditTypeProposal{} - if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1_proposal_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreditTypeProposal) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreditTypeProposal) ProtoMessage() {} - -// Deprecated: Use CreditTypeProposal.ProtoReflect.Descriptor instead. -func (*CreditTypeProposal) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1_proposal_proto_rawDescGZIP(), []int{0} -} - -func (x *CreditTypeProposal) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *CreditTypeProposal) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreditTypeProposal) GetCreditType() *CreditType { - if x != nil { - return x.CreditType - } - return nil -} - -var File_regen_ecocredit_v1_proposal_proto protoreflect.FileDescriptor - -var file_regen_ecocredit_v1_proposal_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x01, - 0x0a, 0x12, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x04, 0x98, - 0xa0, 0x1f, 0x00, 0x42, 0xdb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0d, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, - 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, - 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, - 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x67, - 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_regen_ecocredit_v1_proposal_proto_rawDescOnce sync.Once - file_regen_ecocredit_v1_proposal_proto_rawDescData = file_regen_ecocredit_v1_proposal_proto_rawDesc -) - -func file_regen_ecocredit_v1_proposal_proto_rawDescGZIP() []byte { - file_regen_ecocredit_v1_proposal_proto_rawDescOnce.Do(func() { - file_regen_ecocredit_v1_proposal_proto_rawDescData = protoimpl.X.CompressGZIP(file_regen_ecocredit_v1_proposal_proto_rawDescData) - }) - return file_regen_ecocredit_v1_proposal_proto_rawDescData -} - -var file_regen_ecocredit_v1_proposal_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_regen_ecocredit_v1_proposal_proto_goTypes = []interface{}{ - (*CreditTypeProposal)(nil), // 0: regen.ecocredit.v1.CreditTypeProposal - (*CreditType)(nil), // 1: regen.ecocredit.v1.CreditType -} -var file_regen_ecocredit_v1_proposal_proto_depIdxs = []int32{ - 1, // 0: regen.ecocredit.v1.CreditTypeProposal.credit_type:type_name -> regen.ecocredit.v1.CreditType - 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_regen_ecocredit_v1_proposal_proto_init() } -func file_regen_ecocredit_v1_proposal_proto_init() { - if File_regen_ecocredit_v1_proposal_proto != nil { - return - } - file_regen_ecocredit_v1_state_proto_init() - if !protoimpl.UnsafeEnabled { - file_regen_ecocredit_v1_proposal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreditTypeProposal); 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_regen_ecocredit_v1_proposal_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_regen_ecocredit_v1_proposal_proto_goTypes, - DependencyIndexes: file_regen_ecocredit_v1_proposal_proto_depIdxs, - MessageInfos: file_regen_ecocredit_v1_proposal_proto_msgTypes, - }.Build() - File_regen_ecocredit_v1_proposal_proto = out.File - file_regen_ecocredit_v1_proposal_proto_rawDesc = nil - file_regen_ecocredit_v1_proposal_proto_goTypes = nil - file_regen_ecocredit_v1_proposal_proto_depIdxs = nil -} diff --git a/api/regen/ecocredit/v1/tx.pulsar.go b/api/regen/ecocredit/v1/tx.pulsar.go index 14077e92db..428bc58415 100644 --- a/api/regen/ecocredit/v1/tx.pulsar.go +++ b/api/regen/ecocredit/v1/tx.pulsar.go @@ -14917,8 +14917,6 @@ var file_regen_ecocredit_v1_tx_proto_rawDesc = []byte{ 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, @@ -15258,7 +15256,6 @@ func file_regen_ecocredit_v1_tx_proto_init() { if File_regen_ecocredit_v1_tx_proto != nil { return } - file_regen_ecocredit_v1_state_proto_init() file_regen_ecocredit_v1_types_proto_init() if !protoimpl.UnsafeEnabled { file_regen_ecocredit_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { diff --git a/api/regen/ecocredit/v1/types.pulsar.go b/api/regen/ecocredit/v1/types.pulsar.go index 06d6d36b74..e25b073409 100644 --- a/api/regen/ecocredit/v1/types.pulsar.go +++ b/api/regen/ecocredit/v1/types.pulsar.go @@ -2116,6 +2116,569 @@ func (x *fastReflection_OriginTx) ProtoMethods() *protoiface.Methods { } } +var ( + md_CreditTypeProposal protoreflect.MessageDescriptor + fd_CreditTypeProposal_title protoreflect.FieldDescriptor + fd_CreditTypeProposal_description protoreflect.FieldDescriptor + fd_CreditTypeProposal_credit_type protoreflect.FieldDescriptor +) + +func init() { + file_regen_ecocredit_v1_types_proto_init() + md_CreditTypeProposal = File_regen_ecocredit_v1_types_proto.Messages().ByName("CreditTypeProposal") + fd_CreditTypeProposal_title = md_CreditTypeProposal.Fields().ByName("title") + fd_CreditTypeProposal_description = md_CreditTypeProposal.Fields().ByName("description") + fd_CreditTypeProposal_credit_type = md_CreditTypeProposal.Fields().ByName("credit_type") +} + +var _ protoreflect.Message = (*fastReflection_CreditTypeProposal)(nil) + +type fastReflection_CreditTypeProposal CreditTypeProposal + +func (x *CreditTypeProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_CreditTypeProposal)(x) +} + +func (x *CreditTypeProposal) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1_types_proto_msgTypes[3] + 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_CreditTypeProposal_messageType fastReflection_CreditTypeProposal_messageType +var _ protoreflect.MessageType = fastReflection_CreditTypeProposal_messageType{} + +type fastReflection_CreditTypeProposal_messageType struct{} + +func (x fastReflection_CreditTypeProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_CreditTypeProposal)(nil) +} +func (x fastReflection_CreditTypeProposal_messageType) New() protoreflect.Message { + return new(fastReflection_CreditTypeProposal) +} +func (x fastReflection_CreditTypeProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CreditTypeProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CreditTypeProposal) Descriptor() protoreflect.MessageDescriptor { + return md_CreditTypeProposal +} + +// 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_CreditTypeProposal) Type() protoreflect.MessageType { + return _fastReflection_CreditTypeProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CreditTypeProposal) New() protoreflect.Message { + return new(fastReflection_CreditTypeProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CreditTypeProposal) Interface() protoreflect.ProtoMessage { + return (*CreditTypeProposal)(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_CreditTypeProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_CreditTypeProposal_title, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_CreditTypeProposal_description, value) { + return + } + } + if x.CreditType != nil { + value := protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + if !f(fd_CreditTypeProposal_credit_type, 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_CreditTypeProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + return x.Title != "" + case "regen.ecocredit.v1.CreditTypeProposal.description": + return x.Description != "" + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + return x.CreditType != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + x.Title = "" + case "regen.ecocredit.v1.CreditTypeProposal.description": + x.Description = "" + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + x.CreditType = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.CreditTypeProposal.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + value := x.CreditType + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + x.Title = value.Interface().(string) + case "regen.ecocredit.v1.CreditTypeProposal.description": + x.Description = value.Interface().(string) + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + x.CreditType = value.Message().Interface().(*CreditType) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + if x.CreditType == nil { + x.CreditType = new(CreditType) + } + return protoreflect.ValueOfMessage(x.CreditType.ProtoReflect()) + case "regen.ecocredit.v1.CreditTypeProposal.title": + panic(fmt.Errorf("field title of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) + case "regen.ecocredit.v1.CreditTypeProposal.description": + panic(fmt.Errorf("field description of message regen.ecocredit.v1.CreditTypeProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.CreditTypeProposal.title": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.CreditTypeProposal.description": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.CreditTypeProposal.credit_type": + m := new(CreditType) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.CreditTypeProposal")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.CreditTypeProposal 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_CreditTypeProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.CreditTypeProposal", 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) 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_CreditTypeProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CreditTypeProposal) + 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.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CreditType != nil { + l = options.Size(x.CreditType) + 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().(*CreditTypeProposal) + 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 x.CreditType != nil { + encoded, err := options.Marshal(x.CreditType) + 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.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + 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().(*CreditTypeProposal) + 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: CreditTypeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CreditTypeProposal: 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 Title", 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.Title = 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 Description", 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.Description = 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 CreditType", 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 + } + if x.CreditType == nil { + x.CreditType = &CreditType{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreditType); 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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2319,6 +2882,62 @@ func (x *OriginTx) GetId() string { return "" } +// CreditTypeProposal is a gov Content type for adding a credit type. +type CreditTypeProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // title is the title of the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description is the description of the proposal. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // credit_type is the credit type to be added to the network if the proposal + // passes. + CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (x *CreditTypeProposal) Reset() { + *x = CreditTypeProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreditTypeProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreditTypeProposal) ProtoMessage() {} + +// Deprecated: Use CreditTypeProposal.ProtoReflect.Descriptor instead. +func (*CreditTypeProposal) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_types_proto_rawDescGZIP(), []int{3} +} + +func (x *CreditTypeProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreditTypeProposal) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreditTypeProposal) GetCreditType() *CreditType { + if x != nil { + return x.CreditType + } + return nil +} + var File_regen_ecocredit_v1_types_proto protoreflect.FileDescriptor var file_regen_ecocredit_v1_types_proto_rawDesc = []byte{ @@ -2369,21 +2988,31 @@ var file_regen_ecocredit_v1_types_proto_rawDesc = []byte{ 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x08, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x54, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x79, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x79, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x42, 0xd8, 0x01, 0x0a, 0x16, - 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, - 0x76, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, - 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x12, + 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x04, 0x98, 0xa0, 0x1f, + 0x00, 0x42, 0xd8, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, + 0x69, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x12, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x12, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2398,24 +3027,26 @@ func file_regen_ecocredit_v1_types_proto_rawDescGZIP() []byte { return file_regen_ecocredit_v1_types_proto_rawDescData } -var file_regen_ecocredit_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_regen_ecocredit_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_regen_ecocredit_v1_types_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: regen.ecocredit.v1.Params - (*AskDenom)(nil), // 1: regen.ecocredit.v1.AskDenom - (*OriginTx)(nil), // 2: regen.ecocredit.v1.OriginTx - (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin - (*CreditType)(nil), // 4: regen.ecocredit.v1.CreditType + (*Params)(nil), // 0: regen.ecocredit.v1.Params + (*AskDenom)(nil), // 1: regen.ecocredit.v1.AskDenom + (*OriginTx)(nil), // 2: regen.ecocredit.v1.OriginTx + (*CreditTypeProposal)(nil), // 3: regen.ecocredit.v1.CreditTypeProposal + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*CreditType)(nil), // 5: regen.ecocredit.v1.CreditType } var file_regen_ecocredit_v1_types_proto_depIdxs = []int32{ - 3, // 0: regen.ecocredit.v1.Params.credit_class_fee:type_name -> cosmos.base.v1beta1.Coin - 3, // 1: regen.ecocredit.v1.Params.basket_fee:type_name -> cosmos.base.v1beta1.Coin - 4, // 2: regen.ecocredit.v1.Params.credit_types:type_name -> regen.ecocredit.v1.CreditType + 4, // 0: regen.ecocredit.v1.Params.credit_class_fee:type_name -> cosmos.base.v1beta1.Coin + 4, // 1: regen.ecocredit.v1.Params.basket_fee:type_name -> cosmos.base.v1beta1.Coin + 5, // 2: regen.ecocredit.v1.Params.credit_types:type_name -> regen.ecocredit.v1.CreditType 1, // 3: regen.ecocredit.v1.Params.allowed_ask_denoms:type_name -> regen.ecocredit.v1.AskDenom - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 5, // 4: regen.ecocredit.v1.CreditTypeProposal.credit_type:type_name -> regen.ecocredit.v1.CreditType + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_regen_ecocredit_v1_types_proto_init() } @@ -2461,6 +3092,18 @@ func file_regen_ecocredit_v1_types_proto_init() { return nil } } + file_regen_ecocredit_v1_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreditTypeProposal); 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{ @@ -2468,7 +3111,7 @@ func file_regen_ecocredit_v1_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_v1_types_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/app/app.go b/app/app.go index e648ca8d93..687271cba7 100644 --- a/app/app.go +++ b/app/app.go @@ -349,7 +349,7 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) //. + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( @@ -724,7 +724,7 @@ func (app *RegenApp) RegisterTendermintService(clientCtx client.Context) { } // RegisterSwaggerAPI registers swagger route with API Server -func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) { +func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router) { statikFS, err := fs.New() if err != nil { panic(err) diff --git a/proto/regen/ecocredit/v1/proposal.proto b/proto/regen/ecocredit/v1/proposal.proto deleted file mode 100644 index 9da7f65526..0000000000 --- a/proto/regen/ecocredit/v1/proposal.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package regen.ecocredit.v1; - -import "regen/ecocredit/v1/state.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/core"; - -// CreditTypeProposal is a gov Content type for adding a credit type. -message CreditTypeProposal { - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - CreditType credit_type = 3; -} diff --git a/proto/regen/ecocredit/v1/tx.proto b/proto/regen/ecocredit/v1/tx.proto index baa2976559..e17ab5403d 100644 --- a/proto/regen/ecocredit/v1/tx.proto +++ b/proto/regen/ecocredit/v1/tx.proto @@ -5,7 +5,6 @@ package regen.ecocredit.v1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "regen/ecocredit/v1/state.proto"; import "regen/ecocredit/v1/types.proto"; option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/core"; diff --git a/proto/regen/ecocredit/v1/types.proto b/proto/regen/ecocredit/v1/types.proto index 362df87e16..f7143bf9e3 100644 --- a/proto/regen/ecocredit/v1/types.proto +++ b/proto/regen/ecocredit/v1/types.proto @@ -62,3 +62,18 @@ message OriginTx { // the id of a transaction based on a type (tx id, serial number) string id = 2; } + +// CreditTypeProposal is a gov Content type for adding a credit type. +message CreditTypeProposal { + option (gogoproto.goproto_stringer) = false; + + // title is the title of the proposal. + string title = 1; + + // description is the description of the proposal. + string description = 2; + + // credit_type is the credit type to be added to the network if the proposal + // passes. + CreditType credit_type = 3; +} diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go index d58a2f8bda..28d56557c4 100644 --- a/x/ecocredit/client/core/proposal.go +++ b/x/ecocredit/client/core/proposal.go @@ -51,8 +51,6 @@ func TxCreditTypeProposalCmd() *cobra.Command { return fmt.Errorf("invalid proposal: %w", err) } - from := clientCtx.GetFromAddress() - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) if err != nil { return err @@ -62,7 +60,7 @@ func TxCreditTypeProposalCmd() *cobra.Command { return err } var content types.Content = &proposal - msg, err := types.NewMsgSubmitProposal(content, deposit, from) + msg, err := types.NewMsgSubmitProposal(content, deposit, clientCtx.GetFromAddress()) if err != nil { return err } diff --git a/x/ecocredit/core/proposal.pb.go b/x/ecocredit/core/proposal.pb.go deleted file mode 100644 index abf3112bef..0000000000 --- a/x/ecocredit/core/proposal.pb.go +++ /dev/null @@ -1,432 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: regen/ecocredit/v1/proposal.proto - -package core - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// CreditTypeProposal is a gov Content type for adding a credit type. -type CreditTypeProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` -} - -func (m *CreditTypeProposal) Reset() { *m = CreditTypeProposal{} } -func (*CreditTypeProposal) ProtoMessage() {} -func (*CreditTypeProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_894af4f6d55c77b4, []int{0} -} -func (m *CreditTypeProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreditTypeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreditTypeProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreditTypeProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreditTypeProposal.Merge(m, src) -} -func (m *CreditTypeProposal) XXX_Size() int { - return m.Size() -} -func (m *CreditTypeProposal) XXX_DiscardUnknown() { - xxx_messageInfo_CreditTypeProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_CreditTypeProposal proto.InternalMessageInfo - -func (m *CreditTypeProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *CreditTypeProposal) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *CreditTypeProposal) GetCreditType() *CreditType { - if m != nil { - return m.CreditType - } - return nil -} - -func init() { - proto.RegisterType((*CreditTypeProposal)(nil), "regen.ecocredit.v1.CreditTypeProposal") -} - -func init() { proto.RegisterFile("regen/ecocredit/v1/proposal.proto", fileDescriptor_894af4f6d55c77b4) } - -var fileDescriptor_894af4f6d55c77b4 = []byte{ - // 255 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x4a, 0x4d, 0x4f, - 0xcd, 0xd3, 0x4f, 0x4d, 0xce, 0x4f, 0x2e, 0x4a, 0x4d, 0xc9, 0x2c, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, - 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, - 0x2b, 0xd1, 0x83, 0x2b, 0xd1, 0x2b, 0x33, 0x94, 0x92, 0xc3, 0xa2, 0xad, 0xb8, 0x24, 0xb1, 0x24, - 0x15, 0xa2, 0x47, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0x20, 0xa2, 0x4a, - 0x93, 0x19, 0xb9, 0x84, 0x9c, 0xc1, 0xea, 0x43, 0x2a, 0x0b, 0x52, 0x03, 0xa0, 0xd6, 0x08, 0x89, - 0x70, 0xb1, 0x96, 0x64, 0x96, 0xe4, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x38, - 0x42, 0x0a, 0x5c, 0xdc, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0x99, 0xf9, 0x79, 0x12, - 0x4c, 0x60, 0x39, 0x64, 0x21, 0x21, 0x7b, 0x2e, 0x6e, 0x88, 0xed, 0xf1, 0x25, 0x95, 0x05, 0xa9, - 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x72, 0x7a, 0x98, 0xce, 0xd5, 0x43, 0x58, 0x1a, 0xc4, - 0x95, 0x0c, 0x67, 0x5b, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0x14, 0x70, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, - 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x66, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, - 0xb9, 0xfa, 0x60, 0x53, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xa1, 0xbc, 0x9c, 0xd4, - 0x94, 0xf4, 0xd4, 0x22, 0xfd, 0x0a, 0xa4, 0x70, 0x48, 0xce, 0x2f, 0x4a, 0x4d, 0x62, 0x03, 0x7b, - 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xbf, 0x58, 0xb5, 0x5d, 0x01, 0x00, 0x00, -} - -func (m *CreditTypeProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreditTypeProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreditTypeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CreditType != nil { - { - size, err := m.CreditType.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { - offset -= sovProposal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CreditTypeProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CreditType != nil { - l = m.CreditType.Size() - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func sovProposal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProposal(x uint64) (n int) { - return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CreditTypeProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return 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 fmt.Errorf("proto: CreditTypeProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreditTypeProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreditType == nil { - m.CreditType = &CreditType{} - } - if err := m.CreditType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProposal(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProposal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProposal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProposal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/ecocredit/core/tx.pb.go b/x/ecocredit/core/tx.pb.go index b2f6470ac1..02041c35cf 100644 --- a/x/ecocredit/core/tx.pb.go +++ b/x/ecocredit/core/tx.pb.go @@ -1601,82 +1601,82 @@ func init() { func init() { proto.RegisterFile("regen/ecocredit/v1/tx.proto", fileDescriptor_2b8ae49f50a3ddbd) } var fileDescriptor_2b8ae49f50a3ddbd = []byte{ - // 1196 bytes of a gzipped FileDescriptorProto + // 1190 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xdd, 0x6e, 0xe3, 0x44, 0x14, 0xae, 0x93, 0xb4, 0x49, 0x4e, 0x48, 0xdb, 0x9d, 0x96, 0x2a, 0xeb, 0x6e, 0xd3, 0x60, 0x58, 0x36, 0xfb, 0x83, 0xad, 0x76, 0x25, 0xa4, 0x0a, 0x21, 0xd4, 0x76, 0x91, 0x5a, 0x89, 0xc0, 0x2a, - 0x14, 0x21, 0x21, 0xa1, 0x68, 0x62, 0x9f, 0x75, 0x0d, 0x89, 0x27, 0xb2, 0xa7, 0x3f, 0x7b, 0xcd, + 0x14, 0x21, 0x21, 0xa1, 0x68, 0x62, 0xcf, 0xba, 0x86, 0x64, 0x26, 0xb2, 0xa7, 0x3f, 0x7b, 0xcd, 0x0b, 0xf4, 0x3d, 0x90, 0x40, 0x42, 0x48, 0xbc, 0x02, 0x97, 0xbd, 0xe4, 0x02, 0x09, 0x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0xb5, 0x7c, 0x23, 0xdf, 0xac, 0x6c, 0xbf, 0x67, 0xdf, 0xec, 0x5f, 0x5b, 0xec, 0x71, 0xa8, + 0x80, 0x6d, 0x6d, 0x92, 0xca, 0x54, 0x61, 0x2c, 0x53, 0x9f, 0x01, 0x44, 0x1c, 0x87, 0xbc, 0xe3, + 0x61, 0x9e, 0x94, 0xdd, 0xb4, 0x65, 0xcb, 0xdb, 0x49, 0xcb, 0xdb, 0x47, 0x49, 0xcb, 0xef, 0x15, + 0x2e, 0xfe, 0xd9, 0x34, 0xda, 0x65, 0x61, 0xf3, 0x02, 0x73, 0x82, 0x3e, 0x81, 0x12, 0xa1, 0x9e, + 0x34, 0x5f, 0xb8, 0xa5, 0x79, 0x91, 0x50, 0x4f, 0x18, 0x23, 0x28, 0xb0, 0x01, 0xa1, 0xb5, 0x62, + 0xc3, 0x68, 0x96, 0xda, 0xe2, 0x1b, 0xed, 0x40, 0x99, 0x85, 0x81, 0x1f, 0xd0, 0x0e, 0x3f, 0xaf, + 0x95, 0x04, 0xe3, 0x83, 0x49, 0xd1, 0x7e, 0x25, 0x40, 0x47, 0xe7, 0xed, 0x12, 0x53, 0x5f, 0x31, + 0x1d, 0x65, 0x9c, 0xd4, 0xca, 0x22, 0x48, 0xf1, 0x6d, 0xfd, 0x62, 0x40, 0x35, 0x95, 0x18, 0xf4, + 0x00, 0xca, 0x21, 0x71, 0x83, 0x41, 0x40, 0x28, 0x4f, 0xaa, 0xa6, 0x05, 0xe8, 0x11, 0x2c, 0xf1, + 0x10, 0x7b, 0xb8, 0xdb, 0x23, 0x1d, 0xdc, 0x67, 0x27, 0x94, 0xab, 0x7a, 0x2c, 0x26, 0xe2, 0x5d, + 0x21, 0x45, 0x0f, 0x61, 0x31, 0x24, 0x3c, 0x08, 0x89, 0x97, 0xe0, 0x64, 0x17, 0x56, 0x95, 0x54, + 0xc1, 0x1c, 0x58, 0x91, 0x82, 0x3e, 0xa1, 0x37, 0xba, 0x11, 0x0d, 0x55, 0x49, 0x43, 0x5a, 0x3b, + 0x23, 0x87, 0x4a, 0x38, 0xae, 0xfb, 0x6d, 0x13, 0x2a, 0xdd, 0x58, 0xd0, 0xf1, 0x08, 0x65, 0x7d, + 0xe5, 0x3a, 0x08, 0xd1, 0x8b, 0x58, 0x62, 0xfd, 0x6d, 0xc0, 0x4a, 0x2b, 0xf2, 0x5b, 0x01, 0xe5, + 0xc2, 0x72, 0x5f, 0x24, 0x2b, 0x9a, 0xda, 0x76, 0x63, 0x84, 0xb9, 0x71, 0xc2, 0xbb, 0x36, 0x5e, + 0xaa, 0x94, 0x85, 0xff, 0x55, 0xca, 0xf9, 0x91, 0x52, 0x7e, 0x08, 0xef, 0xb4, 0x22, 0xff, 0x6b, + 0x82, 0x7b, 0x99, 0xa7, 0xc9, 0xda, 0x80, 0xf5, 0x09, 0x59, 0x48, 0xd2, 0x68, 0xad, 0xc1, 0xea, + 0x28, 0x8d, 0x96, 0xff, 0x9e, 0x83, 0xa2, 0x50, 0x50, 0x2f, 0xa6, 0x8e, 0x08, 0xf5, 0x86, 0xd4, + 0x72, 0x95, 0xee, 0x9d, 0xdc, 0x78, 0xef, 0xec, 0x42, 0x51, 0x06, 0x15, 0xa9, 0x6c, 0x3d, 0x9a, + 0x14, 0xad, 0xda, 0xc3, 0x8e, 0xff, 0x24, 0xbe, 0x25, 0x76, 0xe6, 0xaf, 0x06, 0x54, 0x46, 0x14, + 0x33, 0x6b, 0xfe, 0xf6, 0xfb, 0xf5, 0x1e, 0x2c, 0xa9, 0x88, 0x74, 0x26, 0x2f, 0x0d, 0x28, 0xb7, + 0x22, 0xbf, 0x2d, 0xc0, 0x71, 0x2e, 0x8f, 0x59, 0x6f, 0x24, 0x97, 0x72, 0x85, 0x3e, 0x1f, 0x66, + 0x2b, 0x27, 0xb2, 0xf5, 0x74, 0x4a, 0xb6, 0x24, 0x8f, 0x2d, 0x7f, 0xc6, 0x33, 0x16, 0x4f, 0x37, + 0xed, 0xa5, 0xba, 0x07,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, 0xc6, 0xc2, 0x1f, 0xd5, 0xaa, 0x47, 0x3c, 0x9f, 0x84, 0xce, 0xf9, 0xc8, 0xff, 0xb5, + 0x2e, 0x0b, 0x49, 0x77, 0x41, 0xbc, 0xfa, 0x9f, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x33, 0xdf, + 0x31, 0xee, 0x7e, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ecocredit/core/types.pb.go b/x/ecocredit/core/types.pb.go index 1cdc6babdc..379eb42802 100644 --- a/x/ecocredit/core/types.pb.go +++ b/x/ecocredit/core/types.pb.go @@ -242,47 +242,116 @@ func (m *OriginTx) GetId() string { return "" } +// CreditTypeProposal is a gov Content type for adding a credit type. +type CreditTypeProposal struct { + // title is the title of the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description is the description of the proposal. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // credit_type is the credit type to be added to the network if the proposal + // passes. + CreditType *CreditType `protobuf:"bytes,3,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` +} + +func (m *CreditTypeProposal) Reset() { *m = CreditTypeProposal{} } +func (*CreditTypeProposal) ProtoMessage() {} +func (*CreditTypeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_7b044b6b740b984f, []int{3} +} +func (m *CreditTypeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreditTypeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreditTypeProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreditTypeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreditTypeProposal.Merge(m, src) +} +func (m *CreditTypeProposal) XXX_Size() int { + return m.Size() +} +func (m *CreditTypeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CreditTypeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CreditTypeProposal proto.InternalMessageInfo + +func (m *CreditTypeProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CreditTypeProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *CreditTypeProposal) GetCreditType() *CreditType { + if m != nil { + return m.CreditType + } + return nil +} + func init() { proto.RegisterType((*Params)(nil), "regen.ecocredit.v1.Params") proto.RegisterType((*AskDenom)(nil), "regen.ecocredit.v1.AskDenom") proto.RegisterType((*OriginTx)(nil), "regen.ecocredit.v1.OriginTx") + proto.RegisterType((*CreditTypeProposal)(nil), "regen.ecocredit.v1.CreditTypeProposal") } func init() { proto.RegisterFile("regen/ecocredit/v1/types.proto", fileDescriptor_7b044b6b740b984f) } var fileDescriptor_7b044b6b740b984f = []byte{ - // 486 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xcd, 0x8e, 0xd3, 0x30, - 0x10, 0xc7, 0x9b, 0x86, 0x5d, 0xb5, 0xde, 0x0f, 0x15, 0xab, 0x42, 0xa1, 0x42, 0xd9, 0xa8, 0x5c, - 0x22, 0xc1, 0x3a, 0x14, 0x10, 0xf7, 0xdd, 0x02, 0x07, 0x2e, 0xac, 0xa2, 0x3d, 0x71, 0xa9, 0x9c, - 0x78, 0x08, 0x26, 0x69, 0x1c, 0xd9, 0xde, 0x6e, 0xfb, 0x16, 0x3c, 0x07, 0x4f, 0xb2, 0xc7, 0x3d, - 0x72, 0xe1, 0x43, 0xed, 0x8b, 0xa0, 0xd8, 0x6e, 0xb5, 0x12, 0x7b, 0xe4, 0x94, 0x99, 0xf9, 0x8f, - 0xe7, 0xf7, 0x9f, 0xd8, 0x28, 0x94, 0x50, 0x40, 0x9d, 0x40, 0x2e, 0x72, 0x09, 0x8c, 0xeb, 0x64, - 0x31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5, 0x9d, 0xc7, - 0x9c, 0x0b, 0x09, 0xd9, 0xbe, 0x79, 0xc9, 0xaf, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x52, 0x0a, - 0xa5, 0x8b, 0x55, 0x03, 0x00, 0x00, + // 546 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0x8e, 0xe3, 0x36, 0x4a, 0x2e, 0x6d, 0x15, 0x4e, 0x11, 0x32, 0x11, 0x72, 0xac, 0xb0, 0x58, + 0x82, 0xda, 0x04, 0x10, 0x03, 0x0b, 0x6a, 0x03, 0x0c, 0x2c, 0x44, 0x56, 0x27, 0x96, 0xe8, 0x6c, + 0x3f, 0xcc, 0x11, 0xc7, 0x67, 0xdd, 0x5d, 0xd3, 0xe4, 0xbf, 0x40, 0x62, 0x61, 0x64, 0xe6, 0x2f, + 0xe9, 0xd8, 0x91, 0x85, 0x1f, 0x4a, 0xfe, 0x11, 0xe4, 0xbb, 0x4b, 0x1a, 0x89, 0x4a, 0x2c, 0x9d, + 0xfc, 0xde, 0xfb, 0xde, 0x7d, 0xdf, 0xf7, 0x9e, 0xef, 0x90, 0xcb, 0x21, 0x83, 0x22, 0x84, 0x84, + 0x25, 0x1c, 0x52, 0x2a, 0xc3, 0xf9, 0x30, 0x94, 0xcb, 0x12, 0x44, 0x50, 0x72, 0x26, 0x19, 0xc6, + 0x0a, 0x0f, 0xb6, 0x78, 0x30, 0x1f, 0xf6, 0xba, 0x19, 0xcb, 0x98, 0x82, 0xc3, 0x2a, 0xd2, 0x9d, + 0x3d, 0x37, 0x61, 0x62, 0xc6, 0x44, 0x18, 0x13, 0x01, 0xe1, 0x7c, 0x18, 0x83, 0x24, 0xc3, 0x30, + 0x61, 0xb4, 0xd8, 0xe0, 0x37, 0x28, 0x09, 0x49, 0x24, 0x68, 0x7c, 0xf0, 0xd3, 0x46, 0x8d, 0x31, + 0xe1, 0x64, 0x26, 0xf0, 0x39, 0xea, 0xe8, 0x9e, 0x49, 0x92, 0x13, 0x21, 0x26, 0x1f, 0x00, 0x1c, + 0xcb, 0xb3, 0xfd, 0xf6, 0x93, 0x7b, 0x81, 0x56, 0x09, 0x2a, 0x95, 0xc0, 0xa8, 0x04, 0x23, 0x46, + 0x8b, 0xd3, 0xc7, 0x97, 0xbf, 0xfa, 0xb5, 0xef, 0xbf, 0xfb, 0x7e, 0x46, 0xe5, 0xc7, 0xf3, 0x38, + 0x48, 0xd8, 0x2c, 0x34, 0x96, 0xf4, 0xe7, 0x58, 0xa4, 0x53, 0x33, 0x5b, 0x75, 0x40, 0x44, 0x47, + 0x5a, 0x64, 0x54, 0x69, 0xbc, 0x01, 0xc0, 0x9f, 0x10, 0x8a, 0x89, 0x98, 0x82, 0x54, 0x82, 0xf5, + 0xdb, 0x17, 0x6c, 0x69, 0xfa, 0x4a, 0xeb, 0x19, 0xba, 0x4b, 0xf2, 0x9c, 0x5d, 0x40, 0x6a, 0x66, + 0x4c, 0x38, 0x10, 0xc9, 0xb8, 0x70, 0x6c, 0xcf, 0xf6, 0x5b, 0x51, 0xd7, 0xa0, 0xca, 0xdc, 0xc8, + 0x60, 0xf8, 0x21, 0xba, 0xa3, 0xea, 0x39, 0x15, 0x72, 0x02, 0x05, 0x89, 0x73, 0x48, 0x9d, 0x3d, + 0xcf, 0xf2, 0x9b, 0x51, 0x67, 0x0b, 0xbc, 0xd6, 0x75, 0x7c, 0x82, 0x0e, 0xcc, 0x16, 0x95, 0x07, + 0x67, 0x5f, 0x0d, 0xe4, 0x06, 0xff, 0xfe, 0xd1, 0x60, 0xa4, 0xa2, 0xb3, 0x65, 0x09, 0x51, 0x3b, + 0xd9, 0xc6, 0x02, 0xbf, 0x45, 0x78, 0xe3, 0x92, 0x88, 0xe9, 0x24, 0x85, 0x82, 0xcd, 0x84, 0xd3, + 0x50, 0x44, 0xf7, 0x6f, 0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0x76, 0x9e, 0x58, 0xc2, 0x38, 0xc4, + 0x0d, 0xf5, 0xbe, 0x9e, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xe1, 0xb0, 0x4c, 0xeb, 0x03, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -462,6 +531,55 @@ func (m *OriginTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CreditTypeProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreditTypeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreditTypeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreditType != nil { + { + size, err := m.CreditType.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -552,6 +670,27 @@ func (m *OriginTx) Size() (n int) { return n } +func (m *CreditTypeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.CreditType != nil { + l = m.CreditType.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1043,6 +1182,156 @@ func (m *OriginTx) Unmarshal(dAtA []byte) error { } return nil } +func (m *CreditTypeProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return 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 fmt.Errorf("proto: CreditTypeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreditTypeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreditType == nil { + m.CreditType = &CreditType{} + } + if err := m.CreditType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ecocredit/server/utils/utils.go b/x/ecocredit/server/utils/utils.go index 6f2d982225..65091d28ad 100644 --- a/x/ecocredit/server/utils/utils.go +++ b/x/ecocredit/server/utils/utils.go @@ -3,8 +3,6 @@ package utils import ( "context" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/types/math" "github.com/regen-network/regen-ledger/x/ecocredit" @@ -53,9 +51,3 @@ func GetNonNegativeFixedDecs(precision uint32, decimals ...string) ([]math.Dec, } return decs, nil } - -// IsGovAddr returns weather or not the passed addr is the governance module address -func IsGovAddr(ak ecocredit.AccountKeeper, addr types.AccAddress) bool { - govAddr := ak.GetModuleAddress(govtypes.ModuleName) - return govAddr.Equals(addr) -} From 195b51ea28943dfed4795d472fe71c75724bda01 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 18:32:27 -0700 Subject: [PATCH 06/25] chore: cleanup code --- x/ecocredit/server/abci_test.go | 2 +- x/ecocredit/server/core/keeper.go | 7 ------- x/ecocredit/server/expected_keepers.go | 4 ++++ x/ecocredit/server/handler.go | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/x/ecocredit/server/abci_test.go b/x/ecocredit/server/abci_test.go index 4f2b050511..c4289beda8 100644 --- a/x/ecocredit/server/abci_test.go +++ b/x/ecocredit/server/abci_test.go @@ -27,7 +27,7 @@ import ( type TestSuite struct { module module.AppModule - keeper Keeper + keeper ProposalKeeper stateStore api.StateStore querier sdk.Querier handler govtypes.Handler diff --git a/x/ecocredit/server/core/keeper.go b/x/ecocredit/server/core/keeper.go index 85a360b002..7109d8871b 100644 --- a/x/ecocredit/server/core/keeper.go +++ b/x/ecocredit/server/core/keeper.go @@ -1,8 +1,6 @@ package core import ( - sdk "github.com/cosmos/cosmos-sdk/types" - api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/core" @@ -17,11 +15,6 @@ type Keeper struct { paramsKeeper ecocredit.ParamKeeper } -func (k Keeper) PruneOrders(ctx sdk.Context) error { - //TODO implement me - panic("implement me") -} - func NewKeeper(ss api.StateStore, bk ecocredit.BankKeeper, pk ecocredit.ParamKeeper) Keeper { return Keeper{ stateStore: ss, diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go index f28a127833..4eaa0bea74 100644 --- a/x/ecocredit/server/expected_keepers.go +++ b/x/ecocredit/server/expected_keepers.go @@ -9,5 +9,9 @@ import ( // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { PruneOrders(ctx sdk.Context) error +} + +// ProposalKeeper defines the expected interface for ecocredit module proposals. +type ProposalKeeper interface { NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error } diff --git a/x/ecocredit/server/handler.go b/x/ecocredit/server/handler.go index 179019c3c9..37f5a4a2ff 100644 --- a/x/ecocredit/server/handler.go +++ b/x/ecocredit/server/handler.go @@ -8,7 +8,7 @@ import ( coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" ) -func NewCreditTypeProposalHandler(k Keeper) govtypes.Handler { +func NewCreditTypeProposalHandler(k ProposalKeeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { case *coretypes.CreditTypeProposal: @@ -19,6 +19,6 @@ func NewCreditTypeProposalHandler(k Keeper) govtypes.Handler { } } -func handleCreditTypeProposal(ctx sdk.Context, k Keeper, proposal *coretypes.CreditTypeProposal) error { +func handleCreditTypeProposal(ctx sdk.Context, k ProposalKeeper, proposal *coretypes.CreditTypeProposal) error { return k.NewCreditType(ctx, proposal) } From 6d2f020a984144565d45d45bb90632585e5660c7 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:02:57 -0700 Subject: [PATCH 07/25] chore: fix app error --- x/ecocredit/server/expected_keepers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go index 4eaa0bea74..059a1ab3c8 100644 --- a/x/ecocredit/server/expected_keepers.go +++ b/x/ecocredit/server/expected_keepers.go @@ -8,6 +8,7 @@ import ( // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { + ProposalKeeper PruneOrders(ctx sdk.Context) error } From c2e72a96a59be82c4f9f4d0a10ac83ff745cb596 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:17:24 -0700 Subject: [PATCH 08/25] chore: add dummy REST proposal handler --- x/ecocredit/client/core/proposal.go | 8 +++++++- x/ecocredit/core/msg_credit_type_proposal.go | 4 ---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go index 28d56557c4..51d6654e07 100644 --- a/x/ecocredit/client/core/proposal.go +++ b/x/ecocredit/client/core/proposal.go @@ -5,6 +5,7 @@ import ( "strconv" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/cosmos/cosmos-sdk/x/gov/client/rest" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -16,7 +17,12 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit/core" ) -var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, nil) +var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, func(context client.Context) rest.ProposalRESTHandler { + return rest.ProposalRESTHandler{ // TODO: what to do here?? + SubRoute: "", + Handler: nil, + } +}) func TxCreditTypeProposalCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/ecocredit/core/msg_credit_type_proposal.go b/x/ecocredit/core/msg_credit_type_proposal.go index 251d05fddd..bab7349db5 100644 --- a/x/ecocredit/core/msg_credit_type_proposal.go +++ b/x/ecocredit/core/msg_credit_type_proposal.go @@ -19,10 +19,6 @@ func init() { govtypes.RegisterProposalType(ProposalType) } -func NewCreditTypeProposal(title, description string, ct CreditType) govtypes.Content { - return &CreditTypeProposal{title, description, &ct} -} - func (m *CreditTypeProposal) ProposalRoute() string { return ecocredit.RouterKey } func (m *CreditTypeProposal) ProposalType() string { return ProposalType } From 8690a080f9774a17339f51002580aa4726ad2405 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:19:04 -0700 Subject: [PATCH 09/25] chore: regen mocks --- x/ecocredit/server/mocks/expected_keepers.go | 64 -------------------- 1 file changed, 64 deletions(-) delete mode 100644 x/ecocredit/server/mocks/expected_keepers.go diff --git a/x/ecocredit/server/mocks/expected_keepers.go b/x/ecocredit/server/mocks/expected_keepers.go deleted file mode 100644 index 05fabee4db..0000000000 --- a/x/ecocredit/server/mocks/expected_keepers.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: x/ecocredit/server/expected_keepers.go - -// Package mocks is a generated GoMock package. -package mocks - -import ( - reflect "reflect" - - types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" - core "github.com/regen-network/regen-ledger/x/ecocredit/core" -) - -// MockKeeper is a mock of Keeper interface. -type MockKeeper struct { - ctrl *gomock.Controller - recorder *MockKeeperMockRecorder -} - -// MockKeeperMockRecorder is the mock recorder for MockKeeper. -type MockKeeperMockRecorder struct { - mock *MockKeeper -} - -// NewMockKeeper creates a new mock instance. -func NewMockKeeper(ctrl *gomock.Controller) *MockKeeper { - mock := &MockKeeper{ctrl: ctrl} - mock.recorder = &MockKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockKeeper) EXPECT() *MockKeeperMockRecorder { - return m.recorder -} - -// NewCreditType mocks base method. -func (m *MockKeeper) NewCreditType(ctx types.Context, ctp *core.CreditTypeProposal) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewCreditType", ctx, ctp) - ret0, _ := ret[0].(error) - return ret0 -} - -// NewCreditType indicates an expected call of NewCreditType. -func (mr *MockKeeperMockRecorder) NewCreditType(ctx, ctp interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewCreditType", reflect.TypeOf((*MockKeeper)(nil).NewCreditType), ctx, ctp) -} - -// PruneOrders mocks base method. -func (m *MockKeeper) PruneOrders(ctx types.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PruneOrders", ctx) - ret0, _ := ret[0].(error) - return ret0 -} - -// PruneOrders indicates an expected call of PruneOrders. -func (mr *MockKeeperMockRecorder) PruneOrders(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PruneOrders", reflect.TypeOf((*MockKeeper)(nil).PruneOrders), ctx) -} From f99cd386bbaf625b85616441646041e0ccdbdc21 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:28:51 -0700 Subject: [PATCH 10/25] chore: not invalid request --- x/ecocredit/server/core/new_credit_type.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/ecocredit/server/core/new_credit_type.go b/x/ecocredit/server/core/new_credit_type.go index 25f47784a6..b54f9e452a 100644 --- a/x/ecocredit/server/core/new_credit_type.go +++ b/x/ecocredit/server/core/new_credit_type.go @@ -1,6 +1,8 @@ package core import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -23,7 +25,7 @@ func (k Keeper) NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) err Unit: ct.Unit, Precision: ct.Precision, }); err != nil { - return sdkerrors.ErrInvalidRequest.Wrapf("could not insert credit type with abbreviation %s: %s", ct.Abbreviation, err.Error()) + return fmt.Errorf("could not insert credit type with abbreviation %s: %w", ct.Abbreviation, err) } return nil } From 0fcb39a53e352bc98e4315ebad3fdd2a976ebcbd Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 13 Apr 2022 08:50:45 -0700 Subject: [PATCH 11/25] chore: clean test --- x/ecocredit/server/abci_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ecocredit/server/abci_test.go b/x/ecocredit/server/abci_test.go index c4289beda8..b238430f90 100644 --- a/x/ecocredit/server/abci_test.go +++ b/x/ecocredit/server/abci_test.go @@ -67,8 +67,8 @@ func TestCreditTypeProposal_BasicValid(t *testing.T) { Precision: 6, } err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ - Title: "dude wheres my credit type?", - Description: "and then?", + Title: "my credit type", + Description: "yay", CreditType: ct, }) assert.NilError(t, err) From 9cb59708966cf3030d12cd4e5136799b3b964c15 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 13 Apr 2022 10:08:41 -0700 Subject: [PATCH 12/25] refactor: move proposal handler code into server/core --- app/app.go | 2 +- .../{handler.go => core/proposal_handler.go} | 7 +- .../proposal_handler_test.go} | 79 +++++-------------- x/ecocredit/server/expected_keepers.go | 9 +-- 4 files changed, 28 insertions(+), 69 deletions(-) rename x/ecocredit/server/{handler.go => core/proposal_handler.go} (79%) rename x/ecocredit/server/{abci_test.go => core/proposal_handler_test.go} (57%) diff --git a/app/app.go b/app/app.go index 687271cba7..df0e7c27a5 100644 --- a/app/app.go +++ b/app/app.go @@ -102,7 +102,7 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit/basket" "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module" - ecoServer "github.com/regen-network/regen-ledger/x/ecocredit/server" + ecoServer "github.com/regen-network/regen-ledger/x/ecocredit/server/core" // unnamed import of statik for swagger UI support _ "github.com/regen-network/regen-ledger/v3/client/docs/statik" diff --git a/x/ecocredit/server/handler.go b/x/ecocredit/server/core/proposal_handler.go similarity index 79% rename from x/ecocredit/server/handler.go rename to x/ecocredit/server/core/proposal_handler.go index 37f5a4a2ff..5211b83fad 100644 --- a/x/ecocredit/server/handler.go +++ b/x/ecocredit/server/core/proposal_handler.go @@ -1,4 +1,4 @@ -package server +package core import ( sdk "github.com/cosmos/cosmos-sdk/types" @@ -8,6 +8,11 @@ import ( coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" ) +// ProposalKeeper defines the expected interface for ecocredit module proposals. +type ProposalKeeper interface { + NewCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error +} + func NewCreditTypeProposalHandler(k ProposalKeeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { diff --git a/x/ecocredit/server/abci_test.go b/x/ecocredit/server/core/proposal_handler_test.go similarity index 57% rename from x/ecocredit/server/abci_test.go rename to x/ecocredit/server/core/proposal_handler_test.go index b238430f90..6fae867687 100644 --- a/x/ecocredit/server/abci_test.go +++ b/x/ecocredit/server/core/proposal_handler_test.go @@ -1,72 +1,26 @@ -package server +package core import ( - "context" "testing" - "github.com/cosmos/cosmos-sdk/orm/model/ormdb" - "github.com/cosmos/cosmos-sdk/orm/model/ormtable" - "github.com/cosmos/cosmos-sdk/orm/testing/ormtest" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/golang/mock/gomock" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" "gotest.tools/v3/assert" api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/types/ormutil" - "github.com/regen-network/regen-ledger/x/ecocredit" coretypes "github.com/regen-network/regen-ledger/x/ecocredit/core" - "github.com/regen-network/regen-ledger/x/ecocredit/mocks" - "github.com/regen-network/regen-ledger/x/ecocredit/server/core" ) -type TestSuite struct { - module module.AppModule - keeper ProposalKeeper - stateStore api.StateStore - querier sdk.Querier - handler govtypes.Handler - sdkCtx sdk.Context - ctx context.Context -} - -func setupTest(t *testing.T) TestSuite { - s := TestSuite{} - db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db) - storeKey := sdk.NewKVStoreKey("test") - cms.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - assert.NilError(t, cms.LoadLatestVersion()) - ormCtx := ormtable.WrapContextDefault(ormtest.NewMemoryBackend()) - s.sdkCtx = sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()).WithContext(ormCtx) - s.ctx = sdk.WrapSDKContext(s.sdkCtx) - - ormDB, err := ormdb.NewModuleDB(&ecocredit.ModuleSchema, ormdb.ModuleDBOptions{}) - assert.NilError(t, err) - s.stateStore, err = api.NewStateStore(ormDB) - ctrl := gomock.NewController(t) - bankKeeper := mocks.NewMockBankKeeper(ctrl) - paramsKeeper := mocks.NewMockParamKeeper(ctrl) - s.keeper = core.NewKeeper(s.stateStore, bankKeeper, paramsKeeper) - s.handler = NewCreditTypeProposalHandler(s.keeper) - return s -} - func TestCreditTypeProposal_BasicValid(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "BIO", Name: "biodiversity", Unit: "meters squared", Precision: 6, } - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "my credit type", Description: "yay", CreditType: ct, @@ -79,14 +33,15 @@ func TestCreditTypeProposal_BasicValid(t *testing.T) { func TestCreditTypeProposal_InvalidPrecision(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "BIO", Name: "biodiversity", Unit: "meters squared", Precision: 3, } - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "My New Credit Type", Description: "its very cool and awesome", CreditType: ct, @@ -96,14 +51,15 @@ func TestCreditTypeProposal_InvalidPrecision(t *testing.T) { func TestCreditTypeProposal_InvalidAbbreviation(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "biO", Name: "biodiversity", Unit: "meters squared", Precision: 6, } - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "My New Credit Type", Description: "its very cool and awesome", CreditType: ct, @@ -113,13 +69,14 @@ func TestCreditTypeProposal_InvalidAbbreviation(t *testing.T) { func TestCreditTypeProposal_NoName(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "BIO", Unit: "meters squared", Precision: 6, } - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "My New Credit Type", Description: "its very cool and awesome", CreditType: ct, @@ -129,13 +86,14 @@ func TestCreditTypeProposal_NoName(t *testing.T) { func TestCreditTypeProposal_NoUnit(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "BIO", Name: "FooBar", Precision: 6, } - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "My New Credit Type", Description: "its very cool and awesome", CreditType: ct, @@ -145,7 +103,8 @@ func TestCreditTypeProposal_NoUnit(t *testing.T) { func TestCreditTypeProposal_Duplicate(t *testing.T) { t.Parallel() - s := setupTest(t) + s := setupBase(t) + handler := NewCreditTypeProposalHandler(s.k) ct := &coretypes.CreditType{ Abbreviation: "BIO", Name: "FooBar", @@ -155,7 +114,7 @@ func TestCreditTypeProposal_Duplicate(t *testing.T) { var pulsarCreditType api.CreditType assert.NilError(t, ormutil.GogoToPulsarSlow(ct, &pulsarCreditType)) assert.NilError(t, s.stateStore.CreditTypeTable().Insert(s.ctx, &pulsarCreditType)) - err := s.handler(s.sdkCtx, &coretypes.CreditTypeProposal{ + err := handler(s.sdkCtx, &coretypes.CreditTypeProposal{ Title: "My New Credit Type", Description: "its very cool and awesome", CreditType: ct, diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go index 059a1ab3c8..4ae479d682 100644 --- a/x/ecocredit/server/expected_keepers.go +++ b/x/ecocredit/server/expected_keepers.go @@ -3,16 +3,11 @@ package server import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/regen-network/regen-ledger/x/ecocredit/core" + core2 "github.com/regen-network/regen-ledger/x/ecocredit/server/core" ) // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { - ProposalKeeper + core2.ProposalKeeper PruneOrders(ctx sdk.Context) error } - -// ProposalKeeper defines the expected interface for ecocredit module proposals. -type ProposalKeeper interface { - NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error -} From e7ab09cc9bc8f1beafbeec17883df2f22c021352 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 13 Apr 2022 10:28:54 -0700 Subject: [PATCH 13/25] chore: add tests for new types --- .../core/msg_credit_type_proposal_test.go | 54 ++++++++++++ x/ecocredit/core/msg_credit_type_test.go | 87 +++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 x/ecocredit/core/msg_credit_type_proposal_test.go create mode 100644 x/ecocredit/core/msg_credit_type_test.go diff --git a/x/ecocredit/core/msg_credit_type_proposal_test.go b/x/ecocredit/core/msg_credit_type_proposal_test.go new file mode 100644 index 0000000000..9c3299e84d --- /dev/null +++ b/x/ecocredit/core/msg_credit_type_proposal_test.go @@ -0,0 +1,54 @@ +package core + +import ( + "testing" + + "gotest.tools/v3/assert" +) + +func TestCreditTypeProposal_ValidateBasic(t *testing.T) { + validCreditType := &CreditType{"C", "carbon", "carbon ton", 6} + type fields struct { + Title string + Description string + CreditType *CreditType + } + tests := []struct { + name string + fields fields + errMsg string + }{ + { + name: "valid", + fields: fields{ + Title: "hello", + Description: "world", + CreditType: validCreditType, + }, + }, + { + name: "invalid: nil credit type", + fields: fields{ + Title: "hi", + Description: "hello", + CreditType: nil, + }, + errMsg: "credit type cannot be nil", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + m := &CreditTypeProposal{ + Title: tt.fields.Title, + Description: tt.fields.Description, + CreditType: tt.fields.CreditType, + } + err := m.ValidateBasic() + if len(tt.errMsg) != 0 { + assert.ErrorContains(t, err, tt.errMsg) + } else { + assert.NilError(t, err) + } + }) + } +} diff --git a/x/ecocredit/core/msg_credit_type_test.go b/x/ecocredit/core/msg_credit_type_test.go new file mode 100644 index 0000000000..6f5b818ac1 --- /dev/null +++ b/x/ecocredit/core/msg_credit_type_test.go @@ -0,0 +1,87 @@ +package core + +import ( + "testing" + + "gotest.tools/v3/assert" +) + +func TestCreditType_Validate(t *testing.T) { + type fields struct { + Abbreviation string + Name string + Unit string + Precision uint32 + } + tests := []struct { + name string + fields fields + errMsg string + }{ + { + name: "valid", + fields: fields{ + Abbreviation: "C", + Name: "carbon", + Unit: "ton", + Precision: 6, + }, + }, + { + name: "invalid: no abbreviation", + fields: fields{ + Abbreviation: "", + }, + errMsg: "credit type abbreviation must be 1-3 uppercase latin letters", + }, + { + name: "invalid: abbreviation too long", + fields: fields{ + Abbreviation: "CARB", + }, + errMsg: "credit type abbreviation must be 1-3 uppercase latin letters", + }, + { + name: "invalid no name", + fields: fields{ + Abbreviation: "C", + Name: "", + }, + errMsg: "name cannot be empty", + }, + { + name: "invalid no unit", + fields: fields{ + Abbreviation: "C", + Name: "carbon", + }, + errMsg: "unit cannot be empty", + }, + { + name: "invalid precision", + fields: fields{ + Abbreviation: "C", + Name: "carbon", + Unit: "ton", + Precision: 3, + }, + errMsg: "credit type precision is currently locked to 6", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + m := CreditType{ + Abbreviation: tt.fields.Abbreviation, + Name: tt.fields.Name, + Unit: tt.fields.Unit, + Precision: tt.fields.Precision, + } + err := m.Validate() + if len(tt.errMsg) != 0 { + assert.ErrorContains(t, err, tt.errMsg) + } else { + assert.NilError(t, err) + } + }) + } +} From e10b59b6b01c7dac5f4d7b1f24c78af6042c831b Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 13 Apr 2022 10:36:35 -0700 Subject: [PATCH 14/25] refactor: use setCustomModuleBasics --- app/app.go | 10 ---------- app/experimental_appconfig.go | 2 ++ app/stable_appconfig.go | 13 ++++++++++++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/app.go b/app/app.go index df0e7c27a5..c27fc1c92f 100644 --- a/app/app.go +++ b/app/app.go @@ -8,10 +8,6 @@ import ( "os" "github.com/CosmWasm/wasmd/x/wasm" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - "github.com/cosmos/ibc-go/v2/modules/apps/transfer" ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" @@ -100,7 +96,6 @@ import ( data "github.com/regen-network/regen-ledger/x/data/module" "github.com/regen-network/regen-ledger/x/ecocredit" "github.com/regen-network/regen-ledger/x/ecocredit/basket" - "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module" ecoServer "github.com/regen-network/regen-ledger/x/ecocredit/server/core" @@ -143,11 +138,6 @@ var ( authzmodule.AppModuleBasic{}, ecocreditmodule.Module{}, data.Module{}, - gov.NewAppModuleBasic( - paramsclient.ProposalHandler, distrclient.ProposalHandler, - upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - core.CreditTypeProposalHandler, - ), }, setCustomModuleBasics()...)..., ) diff --git a/app/experimental_appconfig.go b/app/experimental_appconfig.go index 01091af900..3914f83bf5 100644 --- a/app/experimental_appconfig.go +++ b/app/experimental_appconfig.go @@ -30,6 +30,7 @@ import ( moduletypes "github.com/regen-network/regen-ledger/types/module" "github.com/regen-network/regen-ledger/types/module/server" + "github.com/regen-network/regen-ledger/x/ecocredit/client/core" group "github.com/regen-network/regen-ledger/x/group/module" ) @@ -40,6 +41,7 @@ func setCustomModuleBasics() []module.AppModuleBasic { wasmclient.ProposalHandlers, paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, + core.CreditTypeProposalHandler, )..., ), wasm.AppModuleBasic{}, diff --git a/app/stable_appconfig.go b/app/stable_appconfig.go index 6b4aa1a862..f77241d74f 100644 --- a/app/stable_appconfig.go +++ b/app/stable_appconfig.go @@ -7,6 +7,10 @@ package app import ( "github.com/CosmWasm/wasmd/x/wasm" + distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" + "github.com/cosmos/cosmos-sdk/x/gov" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -20,10 +24,17 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/regen-network/regen-ledger/types/module/server" + "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ) func setCustomModuleBasics() []module.AppModuleBasic { - return []module.AppModuleBasic{} + return []module.AppModuleBasic{ + gov.NewAppModuleBasic( + paramsclient.ProposalHandler, distrclient.ProposalHandler, + upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, + core.CreditTypeProposalHandler, + ), + } } // setCustomModules registers new modules with the server module manager. From 834d8362a28b06875f1353bc512de5ee7b4e591f Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:45:25 -0700 Subject: [PATCH 15/25] fix: restore setCustomKeepers --- app/app.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/app.go b/app/app.go index c27fc1c92f..51b1c78d34 100644 --- a/app/app.go +++ b/app/app.go @@ -403,6 +403,8 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest &stakingKeeper, govRouter, ) + app.setCustomKeepers(bApp, keys, appCodec, govRouter, homePath, appOpts, wasmOpts) + var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) app.mm = module.NewManager( @@ -579,6 +581,14 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest return app } +// MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by +// Regenapp. It is useful for tests and clients who do not want to construct the +// full Regenapp +func MakeCodecs() (codec.Codec, *codec.LegacyAmino) { + config := MakeEncodingConfig() + return config.Marshaler, config.Amino +} + // Name returns the name of the App func (app *RegenApp) Name() string { return app.BaseApp.Name() } From 8f40361406eff4d88084de4c70e6e623634f9ec3 Mon Sep 17 00:00:00 2001 From: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:33:22 -0700 Subject: [PATCH 16/25] Update x/ecocredit/server/expected_keepers.go Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/ecocredit/server/expected_keepers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go index 4ae479d682..0be67f45a0 100644 --- a/x/ecocredit/server/expected_keepers.go +++ b/x/ecocredit/server/expected_keepers.go @@ -3,11 +3,11 @@ package server import ( sdk "github.com/cosmos/cosmos-sdk/types" - core2 "github.com/regen-network/regen-ledger/x/ecocredit/server/core" + "github.com/regen-network/regen-ledger/x/ecocredit/server/core" ) // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { - core2.ProposalKeeper + core.ProposalKeeper PruneOrders(ctx sdk.Context) error } From af4f04fe51757dc2017e29ee0dfdfe1a179c7971 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:37:35 -0700 Subject: [PATCH 17/25] chore: assert credit type name length --- x/ecocredit/core/msg_credit_type.go | 7 +++++++ x/ecocredit/core/msg_credit_type_test.go | 10 ++++++++++ .../core/{new_credit_type.go => add_credit_type.go} | 0 3 files changed, 17 insertions(+) rename x/ecocredit/server/core/{new_credit_type.go => add_credit_type.go} (100%) diff --git a/x/ecocredit/core/msg_credit_type.go b/x/ecocredit/core/msg_credit_type.go index c3cb38ddcd..d02f6a5966 100644 --- a/x/ecocredit/core/msg_credit_type.go +++ b/x/ecocredit/core/msg_credit_type.go @@ -4,6 +4,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +const ( + maxCreditTypeNameLength = 75 +) + func (m CreditType) Validate() error { if err := ValidateCreditTypeAbbreviation(m.Abbreviation); err != nil { return err @@ -11,6 +15,9 @@ func (m CreditType) Validate() error { if len(m.Name) == 0 { return sdkerrors.ErrInvalidRequest.Wrap("name cannot be empty") } + if len(m.Name) > maxCreditTypeNameLength { + return sdkerrors.ErrInvalidRequest.Wrapf("credit type name cannot exceed %d characters", maxCreditTypeNameLength) + } if len(m.Unit) == 0 { return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") } diff --git a/x/ecocredit/core/msg_credit_type_test.go b/x/ecocredit/core/msg_credit_type_test.go index 6f5b818ac1..0d60de3873 100644 --- a/x/ecocredit/core/msg_credit_type_test.go +++ b/x/ecocredit/core/msg_credit_type_test.go @@ -1,6 +1,8 @@ package core import ( + "fmt" + "strings" "testing" "gotest.tools/v3/assert" @@ -49,6 +51,14 @@ func TestCreditType_Validate(t *testing.T) { }, errMsg: "name cannot be empty", }, + { + name: "invalid name too long name", + fields: fields{ + Abbreviation: "C", + Name: strings.Repeat("x", maxCreditTypeNameLength+1), + }, + errMsg: fmt.Sprintf("credit type name cannot exceed %d characters", maxCreditTypeNameLength), + }, { name: "invalid no unit", fields: fields{ diff --git a/x/ecocredit/server/core/new_credit_type.go b/x/ecocredit/server/core/add_credit_type.go similarity index 100% rename from x/ecocredit/server/core/new_credit_type.go rename to x/ecocredit/server/core/add_credit_type.go From 975f386c657b1f2d09e3fd1b561f57727a6a1d10 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:38:04 -0700 Subject: [PATCH 18/25] refactor: NewCreditType -> AddCreditType --- x/ecocredit/server/core/add_credit_type.go | 4 ++-- x/ecocredit/server/core/proposal_handler.go | 6 +++--- x/ecocredit/server/expected_keepers.go | 4 ++-- x/ecocredit/server/server.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x/ecocredit/server/core/add_credit_type.go b/x/ecocredit/server/core/add_credit_type.go index b54f9e452a..0c8ece1a9f 100644 --- a/x/ecocredit/server/core/add_credit_type.go +++ b/x/ecocredit/server/core/add_credit_type.go @@ -10,8 +10,8 @@ import ( "github.com/regen-network/regen-ledger/x/ecocredit/core" ) -// NewCreditType adds a new credit type to the network -func (k Keeper) NewCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error { +// AddCreditType adds a new credit type to the network +func (k Keeper) AddCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) error { if ctp == nil { return sdkerrors.ErrInvalidRequest.Wrap("nil proposal") } diff --git a/x/ecocredit/server/core/proposal_handler.go b/x/ecocredit/server/core/proposal_handler.go index 5211b83fad..1170708952 100644 --- a/x/ecocredit/server/core/proposal_handler.go +++ b/x/ecocredit/server/core/proposal_handler.go @@ -10,7 +10,7 @@ import ( // ProposalKeeper defines the expected interface for ecocredit module proposals. type ProposalKeeper interface { - NewCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error + AddCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error } func NewCreditTypeProposalHandler(k ProposalKeeper) govtypes.Handler { @@ -19,11 +19,11 @@ func NewCreditTypeProposalHandler(k ProposalKeeper) govtypes.Handler { case *coretypes.CreditTypeProposal: return handleCreditTypeProposal(ctx, k, c) default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized software upgrade proposal content type: %T", c) + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized credit type proposal content type: %T", c) } } } func handleCreditTypeProposal(ctx sdk.Context, k ProposalKeeper, proposal *coretypes.CreditTypeProposal) error { - return k.NewCreditType(ctx, proposal) + return k.AddCreditType(ctx, proposal) } diff --git a/x/ecocredit/server/expected_keepers.go b/x/ecocredit/server/expected_keepers.go index 4ae479d682..0be67f45a0 100644 --- a/x/ecocredit/server/expected_keepers.go +++ b/x/ecocredit/server/expected_keepers.go @@ -3,11 +3,11 @@ package server import ( sdk "github.com/cosmos/cosmos-sdk/types" - core2 "github.com/regen-network/regen-ledger/x/ecocredit/server/core" + "github.com/regen-network/regen-ledger/x/ecocredit/server/core" ) // Keeper defines the expected interface needed to prune expired buy and sell orders. type Keeper interface { - core2.ProposalKeeper + core.ProposalKeeper PruneOrders(ctx sdk.Context) error } diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index 3475404723..bf5b4d6fa2 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -82,8 +82,8 @@ type serverImpl struct { db ormdb.ModuleDB } -func (s serverImpl) NewCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error { - return s.coreKeeper.NewCreditType(ctx, ctp) +func (s serverImpl) AddCreditType(ctx sdk.Context, ctp *coretypes.CreditTypeProposal) error { + return s.coreKeeper.AddCreditType(ctx, ctp) } func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, From 567325be69ab80d95417c3898c0c520672d66e32 Mon Sep 17 00:00:00 2001 From: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:11:34 -0700 Subject: [PATCH 19/25] Update app/stable_appconfig.go Co-authored-by: Aaron Craelius --- app/stable_appconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/stable_appconfig.go b/app/stable_appconfig.go index f77241d74f..0cdd1d235e 100644 --- a/app/stable_appconfig.go +++ b/app/stable_appconfig.go @@ -24,7 +24,7 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/regen-network/regen-ledger/types/module/server" - "github.com/regen-network/regen-ledger/x/ecocredit/client/core" + ecocreditcore "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ) func setCustomModuleBasics() []module.AppModuleBasic { From 549d53ecc1636d32ba1d3114d05aad15bdb19643 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:12:01 -0700 Subject: [PATCH 20/25] chore: import alias --- app/stable_appconfig.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/stable_appconfig.go b/app/stable_appconfig.go index f77241d74f..9b1570a449 100644 --- a/app/stable_appconfig.go +++ b/app/stable_appconfig.go @@ -24,7 +24,7 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/regen-network/regen-ledger/types/module/server" - "github.com/regen-network/regen-ledger/x/ecocredit/client/core" + ecocreditcore "github.com/regen-network/regen-ledger/x/ecocredit/client/core" ) func setCustomModuleBasics() []module.AppModuleBasic { @@ -32,7 +32,7 @@ func setCustomModuleBasics() []module.AppModuleBasic { gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - core.CreditTypeProposalHandler, + ecocreditcore.CreditTypeProposalHandler, ), } } From eb1b2f56003f1b7cfc0edf93b27f2674d5ab2009 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:29:38 -0700 Subject: [PATCH 21/25] fix: remove duplicate credit type validate method --- x/ecocredit/core/genesis.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/x/ecocredit/core/genesis.go b/x/ecocredit/core/genesis.go index 9c8eb798f9..d2ebef495b 100644 --- a/x/ecocredit/core/genesis.go +++ b/x/ecocredit/core/genesis.go @@ -420,21 +420,3 @@ func (b BatchInfo) Validate() error { return nil } - -// Validate performs a basic validation of credit type -func (c CreditType) Validate() error { - if err := ValidateCreditTypeAbbreviation(c.Abbreviation); err != nil { - return err - } - if len(c.Name) == 0 { - return sdkerrors.ErrInvalidRequest.Wrap("name cannot be empty") - } - if len(c.Unit) == 0 { - return sdkerrors.ErrInvalidRequest.Wrap("unit cannot be empty") - } - if c.Precision != PRECISION { - return sdkerrors.ErrInvalidRequest.Wrapf("credit type precision is currently locked to %d", PRECISION) - } - - return nil -} From fa42e6d04ed4d1482337cb9516ad28a50cd7948e Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:42:42 -0700 Subject: [PATCH 22/25] chore: remove proposal cli method --- x/ecocredit/client/core/proposal.go | 78 ----------------------------- x/ecocredit/client/tx.go | 2 - 2 files changed, 80 deletions(-) delete mode 100644 x/ecocredit/client/core/proposal.go diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go deleted file mode 100644 index 51d6654e07..0000000000 --- a/x/ecocredit/client/core/proposal.go +++ /dev/null @@ -1,78 +0,0 @@ -package core - -import ( - "fmt" - "strconv" - - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/cosmos/cosmos-sdk/x/gov/client/rest" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - "github.com/cosmos/cosmos-sdk/x/gov/types" - - "github.com/regen-network/regen-ledger/x/ecocredit/core" -) - -var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, func(context client.Context) rest.ProposalRESTHandler { - return rest.ProposalRESTHandler{ // TODO: what to do here?? - SubRoute: "", - Handler: nil, - } -}) - -func TxCreditTypeProposalCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "credit-type-proposal [proposal-title] [proposal-description] [credit_type_abbreviation] [credit_type_name] [units] [precision] [flags]", - Args: cobra.ExactArgs(6), - Short: "Submit a proposal for a new credit type", - Long: "Submit a proposal to add a new credit type. The credit type abbreviation and name MUST be unique, else " + - "the proposal will fail upon execution. Units are measurements units (i.e. metric tonne). Precision is how " + - "many decimal places are allowed in the credits.", - Example: `regen tx gov submit-proposal credit-type-proposal "Add Biodiversity Type" "A biodiversity type would be great..." BIO biodiversity "sq. meters" 3`, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - title, desc, abbrev, name, units, precisionStr := args[0], args[1], args[2], args[3], args[4], args[5] - precisionU64, err := strconv.ParseUint(precisionStr, 10, 32) - if err != nil { - return fmt.Errorf("invalid precision %s: %w", precisionStr, err) - } - proposal := core.CreditTypeProposal{ - Title: title, - Description: desc, - CreditType: &core.CreditType{ - Abbreviation: abbrev, - Name: name, - Unit: units, - Precision: uint32(precisionU64), - }, - } - if err := proposal.ValidateBasic(); err != nil { - return fmt.Errorf("invalid proposal: %w", err) - } - - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return err - } - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - var content types.Content = &proposal - msg, err := types.NewMsgSubmitProposal(content, deposit, clientCtx.GetFromAddress()) - if err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") - return cmd -} diff --git a/x/ecocredit/client/tx.go b/x/ecocredit/client/tx.go index bccfcfb41f..65b741bdde 100644 --- a/x/ecocredit/client/tx.go +++ b/x/ecocredit/client/tx.go @@ -20,7 +20,6 @@ import ( "github.com/regen-network/regen-ledger/types" "github.com/regen-network/regen-ledger/x/ecocredit" basketcli "github.com/regen-network/regen-ledger/x/ecocredit/client/basket" - corecli "github.com/regen-network/regen-ledger/x/ecocredit/client/core" marketplacecli "github.com/regen-network/regen-ledger/x/ecocredit/client/marketplace" "github.com/regen-network/regen-ledger/x/ecocredit/core" ) @@ -46,7 +45,6 @@ func TxCmd(name string) *cobra.Command { TxUpdateClassIssuersCmd(), TxUpdateClassAdminCmd(), TxCreateProject(), - corecli.TxCreditTypeProposalCmd(), basketcli.TxCreateBasket(), basketcli.TxPutInBasket(), basketcli.TxTakeFromBasket(), From dddd63440c72f5f46d7d47bc57507c1554caea30 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 20 Apr 2022 09:07:18 -0700 Subject: [PATCH 23/25] Revert "chore: remove proposal cli method" This reverts commit fa42e6d04ed4d1482337cb9516ad28a50cd7948e. --- x/ecocredit/client/core/proposal.go | 78 +++++++++++++++++++++++++++++ x/ecocredit/client/tx.go | 2 + 2 files changed, 80 insertions(+) create mode 100644 x/ecocredit/client/core/proposal.go diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go new file mode 100644 index 0000000000..51d6654e07 --- /dev/null +++ b/x/ecocredit/client/core/proposal.go @@ -0,0 +1,78 @@ +package core + +import ( + "fmt" + "strconv" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/regen-network/regen-ledger/x/ecocredit/core" +) + +var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, func(context client.Context) rest.ProposalRESTHandler { + return rest.ProposalRESTHandler{ // TODO: what to do here?? + SubRoute: "", + Handler: nil, + } +}) + +func TxCreditTypeProposalCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "credit-type-proposal [proposal-title] [proposal-description] [credit_type_abbreviation] [credit_type_name] [units] [precision] [flags]", + Args: cobra.ExactArgs(6), + Short: "Submit a proposal for a new credit type", + Long: "Submit a proposal to add a new credit type. The credit type abbreviation and name MUST be unique, else " + + "the proposal will fail upon execution. Units are measurements units (i.e. metric tonne). Precision is how " + + "many decimal places are allowed in the credits.", + Example: `regen tx gov submit-proposal credit-type-proposal "Add Biodiversity Type" "A biodiversity type would be great..." BIO biodiversity "sq. meters" 3`, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + title, desc, abbrev, name, units, precisionStr := args[0], args[1], args[2], args[3], args[4], args[5] + precisionU64, err := strconv.ParseUint(precisionStr, 10, 32) + if err != nil { + return fmt.Errorf("invalid precision %s: %w", precisionStr, err) + } + proposal := core.CreditTypeProposal{ + Title: title, + Description: desc, + CreditType: &core.CreditType{ + Abbreviation: abbrev, + Name: name, + Unit: units, + Precision: uint32(precisionU64), + }, + } + if err := proposal.ValidateBasic(); err != nil { + return fmt.Errorf("invalid proposal: %w", err) + } + + depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + var content types.Content = &proposal + msg, err := types.NewMsgSubmitProposal(content, deposit, clientCtx.GetFromAddress()) + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") + return cmd +} diff --git a/x/ecocredit/client/tx.go b/x/ecocredit/client/tx.go index 65b741bdde..bccfcfb41f 100644 --- a/x/ecocredit/client/tx.go +++ b/x/ecocredit/client/tx.go @@ -20,6 +20,7 @@ import ( "github.com/regen-network/regen-ledger/types" "github.com/regen-network/regen-ledger/x/ecocredit" basketcli "github.com/regen-network/regen-ledger/x/ecocredit/client/basket" + corecli "github.com/regen-network/regen-ledger/x/ecocredit/client/core" marketplacecli "github.com/regen-network/regen-ledger/x/ecocredit/client/marketplace" "github.com/regen-network/regen-ledger/x/ecocredit/core" ) @@ -45,6 +46,7 @@ func TxCmd(name string) *cobra.Command { TxUpdateClassIssuersCmd(), TxUpdateClassAdminCmd(), TxCreateProject(), + corecli.TxCreditTypeProposalCmd(), basketcli.TxCreateBasket(), basketcli.TxPutInBasket(), basketcli.TxTakeFromBasket(), From 582fec63075f9c6635534f14f9efde193d10cfb0 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed, 20 Apr 2022 09:36:33 -0700 Subject: [PATCH 24/25] chore: revert cli removal --- x/ecocredit/client/core/proposal.go | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/x/ecocredit/client/core/proposal.go b/x/ecocredit/client/core/proposal.go index 51d6654e07..28e04c8b62 100644 --- a/x/ecocredit/client/core/proposal.go +++ b/x/ecocredit/client/core/proposal.go @@ -1,8 +1,10 @@ package core import ( + "encoding/json" "fmt" - "strconv" + "io/ioutil" + "strings" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" "github.com/cosmos/cosmos-sdk/x/gov/client/rest" @@ -18,7 +20,7 @@ import ( ) var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposalCmd, func(context client.Context) rest.ProposalRESTHandler { - return rest.ProposalRESTHandler{ // TODO: what to do here?? + return rest.ProposalRESTHandler{ SubRoute: "", Handler: nil, } @@ -26,32 +28,38 @@ var CreditTypeProposalHandler = govclient.NewProposalHandler(TxCreditTypeProposa func TxCreditTypeProposalCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "credit-type-proposal [proposal-title] [proposal-description] [credit_type_abbreviation] [credit_type_name] [units] [precision] [flags]", - Args: cobra.ExactArgs(6), + Use: "credit-type-proposal [path_to_file.json] [flags]", + Args: cobra.ExactArgs(1), Short: "Submit a proposal for a new credit type", - Long: "Submit a proposal to add a new credit type. The credit type abbreviation and name MUST be unique, else " + - "the proposal will fail upon execution. Units are measurements units (i.e. metric tonne). Precision is how " + - "many decimal places are allowed in the credits.", - Example: `regen tx gov submit-proposal credit-type-proposal "Add Biodiversity Type" "A biodiversity type would be great..." BIO biodiversity "sq. meters" 3`, + Long: strings.TrimSpace(`Submit a proposal to add a new credit type. +The json file MUST take the following form: +{ + "title": "some title", + "description": "some description", + "credit_type": { + "abbreviation": "C", + "name": "carbon", + "unit": "metric ton C02", + "precision": 6 + } +} +The credit type abbreviation MUST be unique, else the proposal will fail upon execution. Units are measurement units +(i.e. metric ton C02). Precision is how many decimal places are allowed in the credits.`), + Example: `regen tx gov submit-proposal credit-type-proposal my_file.json`, RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - title, desc, abbrev, name, units, precisionStr := args[0], args[1], args[2], args[3], args[4], args[5] - precisionU64, err := strconv.ParseUint(precisionStr, 10, 32) + proposalFile, err := ioutil.ReadFile(args[0]) if err != nil { - return fmt.Errorf("invalid precision %s: %w", precisionStr, err) + return err } - proposal := core.CreditTypeProposal{ - Title: title, - Description: desc, - CreditType: &core.CreditType{ - Abbreviation: abbrev, - Name: name, - Unit: units, - Precision: uint32(precisionU64), - }, + + var proposal core.CreditTypeProposal + err = json.Unmarshal(proposalFile, &proposal) + if err != nil { + return err } if err := proposal.ValidateBasic(); err != nil { return fmt.Errorf("invalid proposal: %w", err) From eaaf563e2637d37dcf3415d3b0bb4e0dfb130ff0 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu, 21 Apr 2022 14:59:58 -0700 Subject: [PATCH 25/25] chore: update error type --- x/ecocredit/server/core/add_credit_type.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/ecocredit/server/core/add_credit_type.go b/x/ecocredit/server/core/add_credit_type.go index 0c8ece1a9f..1cc451bd4b 100644 --- a/x/ecocredit/server/core/add_credit_type.go +++ b/x/ecocredit/server/core/add_credit_type.go @@ -1,8 +1,6 @@ package core import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -25,7 +23,7 @@ func (k Keeper) AddCreditType(ctx sdk.Context, ctp *core.CreditTypeProposal) err Unit: ct.Unit, Precision: ct.Precision, }); err != nil { - return fmt.Errorf("could not insert credit type with abbreviation %s: %w", ct.Abbreviation, err) + return sdkerrors.ErrInvalidRequest.Wrapf("could not insert credit type with abbreviation %s: %s", ct.Abbreviation, err.Error()) } return nil }