diff --git a/api/regen/ecocredit/basket/v1/tx.pulsar.go b/api/regen/ecocredit/basket/v1/tx.pulsar.go index 57ccc10afe..79b41fd84f 100644 --- a/api/regen/ecocredit/basket/v1/tx.pulsar.go +++ b/api/regen/ecocredit/basket/v1/tx.pulsar.go @@ -3761,6 +3761,7 @@ type MsgCreate struct { // allowed_classes are the credit classes allowed to be put in the basket AllowedClasses []string `protobuf:"bytes,7,rep,name=allowed_classes,json=allowedClasses,proto3" json:"allowed_classes,omitempty"` // date_criteria is the date criteria for batches admitted to the basket. + // At most, only one of the fields in the date_criteria should be set. DateCriteria *DateCriteria `protobuf:"bytes,8,opt,name=date_criteria,json=dateCriteria,proto3" json:"date_criteria,omitempty"` // fee is the fee that the curator will pay to create the basket. It must be // >= the required Params.basket_creation_fee. We include the fee explicitly diff --git a/api/regen/ecocredit/basket/v1/types.pulsar.go b/api/regen/ecocredit/basket/v1/types.pulsar.go index ba7bbc345b..b67bf081a9 100644 --- a/api/regen/ecocredit/basket/v1/types.pulsar.go +++ b/api/regen/ecocredit/basket/v1/types.pulsar.go @@ -576,20 +576,16 @@ func (x *fastReflection_DateCriteria) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_DateCriteria) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sum != nil { - switch o := x.Sum.(type) { - case *DateCriteria_MinStartDate: - v := o.MinStartDate - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_DateCriteria_min_start_date, value) { - return - } - case *DateCriteria_StartDateWindow: - v := o.StartDateWindow - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_DateCriteria_start_date_window, value) { - return - } + if x.MinStartDate != nil { + value := protoreflect.ValueOfMessage(x.MinStartDate.ProtoReflect()) + if !f(fd_DateCriteria_min_start_date, value) { + return + } + } + if x.StartDateWindow != nil { + value := protoreflect.ValueOfMessage(x.StartDateWindow.ProtoReflect()) + if !f(fd_DateCriteria_start_date_window, value) { + return } } } @@ -608,21 +604,9 @@ func (x *fastReflection_DateCriteria) Range(f func(protoreflect.FieldDescriptor, func (x *fastReflection_DateCriteria) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - if x.Sum == nil { - return false - } else if _, ok := x.Sum.(*DateCriteria_MinStartDate); ok { - return true - } else { - return false - } + return x.MinStartDate != nil case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - if x.Sum == nil { - return false - } else if _, ok := x.Sum.(*DateCriteria_StartDateWindow); ok { - return true - } else { - return false - } + return x.StartDateWindow != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -640,9 +624,9 @@ func (x *fastReflection_DateCriteria) Has(fd protoreflect.FieldDescriptor) bool func (x *fastReflection_DateCriteria) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - x.Sum = nil + x.MinStartDate = nil case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - x.Sum = nil + x.StartDateWindow = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -660,21 +644,11 @@ func (x *fastReflection_DateCriteria) Clear(fd protoreflect.FieldDescriptor) { func (x *fastReflection_DateCriteria) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - if x.Sum == nil { - return protoreflect.ValueOfMessage((*timestamppb.Timestamp)(nil).ProtoReflect()) - } else if v, ok := x.Sum.(*DateCriteria_MinStartDate); ok { - return protoreflect.ValueOfMessage(v.MinStartDate.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*timestamppb.Timestamp)(nil).ProtoReflect()) - } + value := x.MinStartDate + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - if x.Sum == nil { - return protoreflect.ValueOfMessage((*durationpb.Duration)(nil).ProtoReflect()) - } else if v, ok := x.Sum.(*DateCriteria_StartDateWindow); ok { - return protoreflect.ValueOfMessage(v.StartDateWindow.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*durationpb.Duration)(nil).ProtoReflect()) - } + value := x.StartDateWindow + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -696,11 +670,9 @@ func (x *fastReflection_DateCriteria) Get(descriptor protoreflect.FieldDescripto func (x *fastReflection_DateCriteria) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - cv := value.Message().Interface().(*timestamppb.Timestamp) - x.Sum = &DateCriteria_MinStartDate{MinStartDate: cv} + x.MinStartDate = value.Message().Interface().(*timestamppb.Timestamp) case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - cv := value.Message().Interface().(*durationpb.Duration) - x.Sum = &DateCriteria_StartDateWindow{StartDateWindow: cv} + x.StartDateWindow = value.Message().Interface().(*durationpb.Duration) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -722,37 +694,15 @@ func (x *fastReflection_DateCriteria) Set(fd protoreflect.FieldDescriptor, value func (x *fastReflection_DateCriteria) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - if x.Sum == nil { - value := ×tamppb.Timestamp{} - oneofValue := &DateCriteria_MinStartDate{MinStartDate: value} - x.Sum = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Sum.(type) { - case *DateCriteria_MinStartDate: - return protoreflect.ValueOfMessage(m.MinStartDate.ProtoReflect()) - default: - value := ×tamppb.Timestamp{} - oneofValue := &DateCriteria_MinStartDate{MinStartDate: value} - x.Sum = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) + if x.MinStartDate == nil { + x.MinStartDate = new(timestamppb.Timestamp) } + return protoreflect.ValueOfMessage(x.MinStartDate.ProtoReflect()) case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - if x.Sum == nil { - value := &durationpb.Duration{} - oneofValue := &DateCriteria_StartDateWindow{StartDateWindow: value} - x.Sum = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Sum.(type) { - case *DateCriteria_StartDateWindow: - return protoreflect.ValueOfMessage(m.StartDateWindow.ProtoReflect()) - default: - value := &durationpb.Duration{} - oneofValue := &DateCriteria_StartDateWindow{StartDateWindow: value} - x.Sum = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) + if x.StartDateWindow == nil { + x.StartDateWindow = new(durationpb.Duration) } + return protoreflect.ValueOfMessage(x.StartDateWindow.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -767,11 +717,11 @@ func (x *fastReflection_DateCriteria) Mutable(fd protoreflect.FieldDescriptor) p func (x *fastReflection_DateCriteria) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "regen.ecocredit.basket.v1.DateCriteria.min_start_date": - value := ×tamppb.Timestamp{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "regen.ecocredit.basket.v1.DateCriteria.start_date_window": - value := &durationpb.Duration{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.basket.v1.DateCriteria")) @@ -785,16 +735,6 @@ func (x *fastReflection_DateCriteria) NewField(fd protoreflect.FieldDescriptor) // It panics if the oneof descriptor does not belong to this message. func (x *fastReflection_DateCriteria) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { - case "regen.ecocredit.basket.v1.DateCriteria.sum": - if x.Sum == nil { - return nil - } - switch x.Sum.(type) { - case *DateCriteria_MinStartDate: - return x.Descriptor().Fields().ByName("min_start_date") - case *DateCriteria_StartDateWindow: - return x.Descriptor().Fields().ByName("start_date_window") - } default: panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.basket.v1.DateCriteria", d.FullName())) } @@ -851,17 +791,11 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - switch x := x.Sum.(type) { - case *DateCriteria_MinStartDate: - if x == nil { - break - } + if x.MinStartDate != nil { l = options.Size(x.MinStartDate) n += 1 + l + runtime.Sov(uint64(l)) - case *DateCriteria_StartDateWindow: - if x == nil { - break - } + } + if x.StartDateWindow != nil { l = options.Size(x.StartDateWindow) n += 1 + l + runtime.Sov(uint64(l)) } @@ -894,9 +828,8 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - switch x := x.Sum.(type) { - case *DateCriteria_MinStartDate: - encoded, err := options.Marshal(x.MinStartDate) + if x.StartDateWindow != nil { + encoded, err := options.Marshal(x.StartDateWindow) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -907,9 +840,10 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa - case *DateCriteria_StartDateWindow: - encoded, err := options.Marshal(x.StartDateWindow) + dAtA[i] = 0x12 + } + if x.MinStartDate != nil { + encoded, err := options.Marshal(x.MinStartDate) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -920,7 +854,7 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1000,11 +934,12 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - v := ×tamppb.Timestamp{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { + if x.MinStartDate == nil { + x.MinStartDate = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MinStartDate); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Sum = &DateCriteria_MinStartDate{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -1035,11 +970,12 @@ func (x *fastReflection_DateCriteria) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - v := &durationpb.Duration{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { + if x.StartDateWindow == nil { + x.StartDateWindow = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartDateWindow); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Sum = &DateCriteria_StartDateWindow{v} iNdEx = postIndex default: iNdEx = preIndex @@ -1137,18 +1073,23 @@ func (x *BasketCredit) GetAmount() string { return "" } -// DateCriteria represents a basket credit batch date criteria. +// DateCriteria represents the information for credit acceptance in a basket. +// At most, only one of the values should be set. type DateCriteria struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // sum is the oneof representing the date criteria. - // - // Types that are assignable to Sum: - // *DateCriteria_MinStartDate - // *DateCriteria_StartDateWindow - Sum isDateCriteria_Sum `protobuf_oneof:"sum"` + // min_start_date (optional) is the earliest start date for batches of credits allowed + // into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + MinStartDate *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=min_start_date,json=minStartDate,proto3" json:"min_start_date,omitempty"` + // start_date_window (optional) is a duration of time measured into the past which sets + // a cutoff for batch start dates when adding new credits to the basket. + // Based on the current block timestamp, credits whose start date is before + // `block_timestamp - batch_date_window` will not be allowed into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + StartDateWindow *durationpb.Duration `protobuf:"bytes,2,opt,name=start_date_window,json=startDateWindow,proto3" json:"start_date_window,omitempty"` } func (x *DateCriteria) Reset() { @@ -1171,49 +1112,20 @@ func (*DateCriteria) Descriptor() ([]byte, []int) { return file_regen_ecocredit_basket_v1_types_proto_rawDescGZIP(), []int{1} } -func (x *DateCriteria) GetSum() isDateCriteria_Sum { - if x != nil { - return x.Sum - } - return nil -} - func (x *DateCriteria) GetMinStartDate() *timestamppb.Timestamp { - if x, ok := x.GetSum().(*DateCriteria_MinStartDate); ok { + if x != nil { return x.MinStartDate } return nil } func (x *DateCriteria) GetStartDateWindow() *durationpb.Duration { - if x, ok := x.GetSum().(*DateCriteria_StartDateWindow); ok { + if x != nil { return x.StartDateWindow } return nil } -type isDateCriteria_Sum interface { - isDateCriteria_Sum() -} - -type DateCriteria_MinStartDate struct { - // min_start_date is the earliest start date for batches of credits allowed - // into the basket. - MinStartDate *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=min_start_date,json=minStartDate,proto3,oneof"` -} - -type DateCriteria_StartDateWindow struct { - // start_date_window is a duration of time measured into the past which sets - // a cutoff for batch start dates when adding new credits to the basket. - // Based on the current block timestamp, credits whose start date is before - // `block_timestamp - batch_date_window` will not be allowed into the basket. - StartDateWindow *durationpb.Duration `protobuf:"bytes,2,opt,name=start_date_window,json=startDateWindow,proto3,oneof"` -} - -func (*DateCriteria_MinStartDate) isDateCriteria_Sum() {} - -func (*DateCriteria_StartDateWindow) isDateCriteria_Sum() {} - var File_regen_ecocredit_basket_v1_types_proto protoreflect.FileDescriptor var file_regen_ecocredit_basket_v1_types_proto_rawDesc = []byte{ @@ -1229,34 +1141,34 @@ var file_regen_ecocredit_basket_v1_types_proto_rawDesc = []byte{ 0x64, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa2, 0x01, 0x0a, - 0x0c, 0x44, 0x61, 0x74, 0x65, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x12, 0x42, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x97, 0x01, 0x0a, + 0x0c, 0x44, 0x61, 0x74, 0x65, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, - 0x65, 0x12, 0x47, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x44, 0x61, 0x74, 0x65, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, - 0x6d, 0x42, 0x80, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x62, 0x61, 0x73, 0x6b, 0x65, 0x74, - 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x4c, 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, 0x62, 0x61, 0x73, - 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x52, 0x45, 0x42, 0xaa, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x45, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x5c, 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, - 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, - 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, + 0x45, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, + 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x42, 0x80, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x62, + 0x61, 0x73, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4c, 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, 0x62, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x61, 0x73, 0x6b, + 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x42, 0xaa, 0x02, 0x19, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x42, 0x61, 0x73, + 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, + 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x25, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x5c, 0x42, 0x61, 0x73, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x42, + 0x61, 0x73, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1319,10 +1231,6 @@ func file_regen_ecocredit_basket_v1_types_proto_init() { } } } - file_regen_ecocredit_basket_v1_types_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*DateCriteria_MinStartDate)(nil), - (*DateCriteria_StartDateWindow)(nil), - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/regen/ecocredit/basket/v1/tx.proto b/proto/regen/ecocredit/basket/v1/tx.proto index 195538156d..e598051a62 100644 --- a/proto/regen/ecocredit/basket/v1/tx.proto +++ b/proto/regen/ecocredit/basket/v1/tx.proto @@ -82,6 +82,7 @@ message MsgCreate { repeated string allowed_classes = 7; // date_criteria is the date criteria for batches admitted to the basket. + // At most, only one of the fields in the date_criteria should be set. DateCriteria date_criteria = 8; // fee is the fee that the curator will pay to create the basket. It must be diff --git a/proto/regen/ecocredit/basket/v1/types.proto b/proto/regen/ecocredit/basket/v1/types.proto index 49493e06ac..83f0529769 100644 --- a/proto/regen/ecocredit/basket/v1/types.proto +++ b/proto/regen/ecocredit/basket/v1/types.proto @@ -19,19 +19,21 @@ message BasketCredit { string amount = 2; } -// DateCriteria represents a basket credit batch date criteria. +// DateCriteria represents the information for credit acceptance in a basket. +// At most, only one of the values should be set. +// NOTE: gogo proto `oneof` is not compatible with Amino signing, hence we directly define +// both `start_date_window` and `min_start_date`. In the future, with pulsar, this should change +// and we should use `oneof`. message DateCriteria { - - // sum is the oneof representing the date criteria. - oneof sum { - // min_start_date is the earliest start date for batches of credits allowed - // into the basket. - google.protobuf.Timestamp min_start_date = 1; - - // start_date_window is a duration of time measured into the past which sets - // a cutoff for batch start dates when adding new credits to the basket. - // Based on the current block timestamp, credits whose start date is before - // `block_timestamp - batch_date_window` will not be allowed into the basket. - google.protobuf.Duration start_date_window = 2; - } -} \ No newline at end of file + // min_start_date (optional) is the earliest start date for batches of credits allowed + // into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + google.protobuf.Timestamp min_start_date = 1; + + // start_date_window (optional) is a duration of time measured into the past which sets + // a cutoff for batch start dates when adding new credits to the basket. + // Based on the current block timestamp, credits whose start date is before + // `block_timestamp - batch_date_window` will not be allowed into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + google.protobuf.Duration start_date_window = 2; +} diff --git a/x/ecocredit/basket/tx.pb.go b/x/ecocredit/basket/tx.pb.go index b11ea65e30..808b0012d6 100644 --- a/x/ecocredit/basket/tx.pb.go +++ b/x/ecocredit/basket/tx.pb.go @@ -83,6 +83,7 @@ type MsgCreate struct { // allowed_classes are the credit classes allowed to be put in the basket AllowedClasses []string `protobuf:"bytes,7,rep,name=allowed_classes,json=allowedClasses,proto3" json:"allowed_classes,omitempty"` // date_criteria is the date criteria for batches admitted to the basket. + // At most, only one of the fields in the date_criteria should be set. DateCriteria *DateCriteria `protobuf:"bytes,8,opt,name=date_criteria,json=dateCriteria,proto3" json:"date_criteria,omitempty"` // fee is the fee that the curator will pay to create the basket. It must be // >= the required Params.basket_creation_fee. We include the fee explicitly diff --git a/x/ecocredit/basket/types.pb.go b/x/ecocredit/basket/types.pb.go index c3fa7be7ed..bfda218363 100644 --- a/x/ecocredit/basket/types.pb.go +++ b/x/ecocredit/basket/types.pb.go @@ -80,14 +80,19 @@ func (m *BasketCredit) GetAmount() string { return "" } -// DateCriteria represents a basket credit batch date criteria. +// DateCriteria represents the information for credit acceptance in a basket. +// At most, only one of the values should be set. type DateCriteria struct { - // sum is the oneof representing the date criteria. - // - // Types that are valid to be assigned to Sum: - // *DateCriteria_MinStartDate - // *DateCriteria_StartDateWindow - Sum isDateCriteria_Sum `protobuf_oneof:"sum"` + // min_start_date (optional) is the earliest start date for batches of credits allowed + // into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + MinStartDate *types.Timestamp `protobuf:"bytes,1,opt,name=min_start_date,json=minStartDate,proto3" json:"min_start_date,omitempty"` + // start_date_window (optional) is a duration of time measured into the past which sets + // a cutoff for batch start dates when adding new credits to the basket. + // Based on the current block timestamp, credits whose start date is before + // `block_timestamp - batch_date_window` will not be allowed into the basket. + // At most only one of `start_date_window` and `min_start_date` can be set. + StartDateWindow *types.Duration `protobuf:"bytes,2,opt,name=start_date_window,json=startDateWindow,proto3" json:"start_date_window,omitempty"` } func (m *DateCriteria) Reset() { *m = DateCriteria{} } @@ -123,51 +128,20 @@ func (m *DateCriteria) XXX_DiscardUnknown() { var xxx_messageInfo_DateCriteria proto.InternalMessageInfo -type isDateCriteria_Sum interface { - isDateCriteria_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type DateCriteria_MinStartDate struct { - MinStartDate *types.Timestamp `protobuf:"bytes,1,opt,name=min_start_date,json=minStartDate,proto3,oneof" json:"min_start_date,omitempty"` -} -type DateCriteria_StartDateWindow struct { - StartDateWindow *types.Duration `protobuf:"bytes,2,opt,name=start_date_window,json=startDateWindow,proto3,oneof" json:"start_date_window,omitempty"` -} - -func (*DateCriteria_MinStartDate) isDateCriteria_Sum() {} -func (*DateCriteria_StartDateWindow) isDateCriteria_Sum() {} - -func (m *DateCriteria) GetSum() isDateCriteria_Sum { - if m != nil { - return m.Sum - } - return nil -} - func (m *DateCriteria) GetMinStartDate() *types.Timestamp { - if x, ok := m.GetSum().(*DateCriteria_MinStartDate); ok { - return x.MinStartDate + if m != nil { + return m.MinStartDate } return nil } func (m *DateCriteria) GetStartDateWindow() *types.Duration { - if x, ok := m.GetSum().(*DateCriteria_StartDateWindow); ok { - return x.StartDateWindow + if m != nil { + return m.StartDateWindow } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*DateCriteria) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*DateCriteria_MinStartDate)(nil), - (*DateCriteria_StartDateWindow)(nil), - } -} - func init() { proto.RegisterType((*BasketCredit)(nil), "regen.ecocredit.basket.v1.BasketCredit") proto.RegisterType((*DateCriteria)(nil), "regen.ecocredit.basket.v1.DateCriteria") @@ -178,28 +152,27 @@ func init() { } var fileDescriptor_e6c256e957c69c4d = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x41, 0x4f, 0xc2, 0x30, - 0x18, 0x86, 0x37, 0x8d, 0x24, 0x16, 0xa2, 0x71, 0x07, 0x03, 0x1c, 0x8a, 0x21, 0x31, 0xf1, 0x62, - 0x1b, 0xf0, 0xe2, 0x79, 0x90, 0xc0, 0x79, 0x9a, 0x98, 0x78, 0x59, 0xba, 0xed, 0x73, 0x34, 0xd0, - 0x96, 0x74, 0xdf, 0x40, 0xff, 0x85, 0xbf, 0xc1, 0x5f, 0xe3, 0x91, 0xa3, 0x47, 0x03, 0x7f, 0xc4, - 0xd0, 0x81, 0x26, 0x72, 0xfc, 0xbe, 0xf7, 0x7d, 0x9f, 0xbe, 0x6d, 0xc9, 0xb5, 0x85, 0x1c, 0x34, - 0x87, 0xd4, 0xa4, 0x16, 0x32, 0x89, 0x3c, 0x11, 0xc5, 0x14, 0x90, 0x2f, 0x7a, 0x1c, 0xdf, 0xe6, - 0x50, 0xb0, 0xb9, 0x35, 0x68, 0x82, 0x96, 0xb3, 0xb1, 0x5f, 0x1b, 0xab, 0x6c, 0x6c, 0xd1, 0x6b, - 0x77, 0x72, 0x63, 0xf2, 0x19, 0x70, 0x67, 0x4c, 0xca, 0x17, 0x8e, 0x52, 0x41, 0x81, 0x42, 0xcd, - 0xab, 0x6c, 0x9b, 0xfe, 0x37, 0x64, 0xa5, 0x15, 0x28, 0x8d, 0xae, 0xf4, 0xee, 0x88, 0x34, 0x42, - 0x47, 0x1b, 0x38, 0x74, 0xd0, 0x21, 0xf5, 0x44, 0x60, 0x3a, 0x89, 0x33, 0xd0, 0x46, 0x35, 0xfd, - 0x2b, 0xff, 0xe6, 0x34, 0x22, 0x6e, 0x35, 0xdc, 0x6e, 0x82, 0x4b, 0x52, 0x13, 0xca, 0x94, 0x1a, - 0x9b, 0x47, 0x4e, 0xdb, 0x4d, 0xdd, 0x0f, 0x9f, 0x34, 0x86, 0x02, 0x61, 0x60, 0x25, 0x82, 0x95, - 0x22, 0x08, 0xc9, 0x99, 0x92, 0x3a, 0x2e, 0x50, 0x58, 0x8c, 0x33, 0x81, 0xe0, 0x60, 0xf5, 0x7e, - 0x9b, 0x55, 0x95, 0xd8, 0xbe, 0x12, 0x7b, 0xdc, 0x77, 0x1e, 0x7b, 0x51, 0x43, 0x49, 0xfd, 0xb0, - 0x8d, 0x6c, 0x59, 0xc1, 0x88, 0x5c, 0xfc, 0xe5, 0xe3, 0xa5, 0xd4, 0x99, 0x59, 0xba, 0x73, 0xeb, - 0xfd, 0xd6, 0x01, 0x66, 0xb8, 0xbb, 0xd9, 0xd8, 0x8b, 0xce, 0x8b, 0x3d, 0xe2, 0xc9, 0x65, 0xc2, - 0x13, 0x72, 0x5c, 0x94, 0x2a, 0x8c, 0x3e, 0xd7, 0xd4, 0x5f, 0xad, 0xa9, 0xff, 0xbd, 0xa6, 0xfe, - 0xfb, 0x86, 0x7a, 0xab, 0x0d, 0xf5, 0xbe, 0x36, 0xd4, 0x7b, 0xbe, 0xcf, 0x25, 0x4e, 0xca, 0x84, - 0xa5, 0x46, 0x71, 0xf7, 0xdc, 0xb7, 0x1a, 0x70, 0x69, 0xec, 0x74, 0x37, 0xcd, 0x20, 0xcb, 0xc1, - 0xf2, 0xd7, 0x83, 0xcf, 0x4a, 0x6a, 0xae, 0xc0, 0xdd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, - 0x16, 0xb2, 0x08, 0xcd, 0x01, 0x00, 0x00, + // 318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x4e, 0x3a, 0x31, + 0x10, 0xc6, 0xe9, 0xff, 0x40, 0xf2, 0x2f, 0x44, 0xe3, 0x1e, 0x0c, 0x70, 0x28, 0x86, 0xc4, 0xc4, + 0x8b, 0x6d, 0xc0, 0x8b, 0x47, 0x03, 0x18, 0xef, 0xab, 0x89, 0x89, 0x97, 0x4d, 0x77, 0x3b, 0x2e, + 0x0d, 0xb4, 0x25, 0xdd, 0x59, 0xd0, 0xb7, 0xf0, 0xe6, 0x2b, 0x79, 0xe4, 0xe8, 0xd1, 0xc0, 0x8b, + 0x18, 0xba, 0xa0, 0x89, 0x1c, 0x67, 0xe6, 0xfb, 0x7e, 0xf3, 0xb5, 0x43, 0xcf, 0x3d, 0xe4, 0x60, + 0x05, 0x64, 0x2e, 0xf3, 0xa0, 0x34, 0x8a, 0x54, 0x16, 0x53, 0x40, 0xb1, 0xe8, 0x0b, 0x7c, 0x9d, + 0x43, 0xc1, 0xe7, 0xde, 0xa1, 0x8b, 0xda, 0x41, 0xc6, 0x7f, 0x64, 0xbc, 0x92, 0xf1, 0x45, 0xbf, + 0xd3, 0xcd, 0x9d, 0xcb, 0x67, 0x20, 0x82, 0x30, 0x2d, 0x9f, 0x05, 0x6a, 0x03, 0x05, 0x4a, 0x33, + 0xaf, 0xbc, 0x1d, 0xf6, 0x57, 0xa0, 0x4a, 0x2f, 0x51, 0x3b, 0x5b, 0xcd, 0x7b, 0x77, 0xb4, 0x39, + 0x0c, 0xb4, 0x51, 0x40, 0x47, 0x5d, 0xda, 0x48, 0x25, 0x66, 0x93, 0x44, 0x81, 0x75, 0xa6, 0x45, + 0xce, 0xc8, 0xc5, 0xff, 0x98, 0x86, 0xd6, 0x78, 0xdb, 0x89, 0x4e, 0x69, 0x5d, 0x1a, 0x57, 0x5a, + 0x6c, 0xfd, 0x0b, 0xb3, 0x5d, 0xd5, 0x7b, 0x27, 0xb4, 0x39, 0x96, 0x08, 0x23, 0xaf, 0x11, 0xbc, + 0x96, 0xd1, 0x0d, 0x3d, 0x32, 0xda, 0x26, 0x05, 0x4a, 0x8f, 0x89, 0x92, 0x08, 0x01, 0xd6, 0x18, + 0x74, 0x78, 0x15, 0x89, 0xef, 0x23, 0xf1, 0x87, 0x7d, 0xe6, 0xb8, 0x69, 0xb4, 0xbd, 0xdf, 0x1a, + 0xb6, 0xa4, 0xe8, 0x96, 0x9e, 0xfc, 0xba, 0x93, 0xa5, 0xb6, 0xca, 0x2d, 0xc3, 0xd6, 0xc6, 0xa0, + 0x7d, 0x00, 0x19, 0xef, 0xde, 0x15, 0x1f, 0x17, 0x7b, 0xc0, 0x63, 0x70, 0x0c, 0xe3, 0x8f, 0x35, + 0x23, 0xab, 0x35, 0x23, 0x5f, 0x6b, 0x46, 0xde, 0x36, 0xac, 0xb6, 0xda, 0xb0, 0xda, 0xe7, 0x86, + 0xd5, 0x9e, 0xae, 0x73, 0x8d, 0x93, 0x32, 0xe5, 0x99, 0x33, 0x22, 0xfc, 0xf1, 0xa5, 0x05, 0x5c, + 0x3a, 0x3f, 0xdd, 0x55, 0x33, 0x50, 0x39, 0x78, 0xf1, 0x72, 0x70, 0xa1, 0xb4, 0x1e, 0xf6, 0x5e, + 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x06, 0xdb, 0x38, 0x47, 0xc2, 0x01, 0x00, 0x00, } func (m *BasketCredit) Marshal() (dAtA []byte, err error) { @@ -259,28 +232,9 @@ func (m *DateCriteria) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *DateCriteria_MinStartDate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DateCriteria_MinStartDate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MinStartDate != nil { + if m.StartDateWindow != nil { { - size, err := m.MinStartDate.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.StartDateWindow.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -288,20 +242,11 @@ func (m *DateCriteria_MinStartDate) MarshalToSizedBuffer(dAtA []byte) (int, erro i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } - return len(dAtA) - i, nil -} -func (m *DateCriteria_StartDateWindow) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DateCriteria_StartDateWindow) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.StartDateWindow != nil { + if m.MinStartDate != nil { { - size, err := m.StartDateWindow.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.MinStartDate.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -309,10 +254,11 @@ func (m *DateCriteria_StartDateWindow) MarshalToSizedBuffer(dAtA []byte) (int, e i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } return len(dAtA) - i, nil } + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -342,18 +288,6 @@ func (m *BasketCredit) Size() (n int) { } func (m *DateCriteria) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *DateCriteria_MinStartDate) Size() (n int) { if m == nil { return 0 } @@ -363,14 +297,6 @@ func (m *DateCriteria_MinStartDate) Size() (n int) { l = m.MinStartDate.Size() n += 1 + l + sovTypes(uint64(l)) } - return n -} -func (m *DateCriteria_StartDateWindow) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l if m.StartDateWindow != nil { l = m.StartDateWindow.Size() n += 1 + l + sovTypes(uint64(l)) @@ -556,11 +482,12 @@ func (m *DateCriteria) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.Timestamp{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.MinStartDate == nil { + m.MinStartDate = &types.Timestamp{} + } + if err := m.MinStartDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &DateCriteria_MinStartDate{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -591,11 +518,12 @@ func (m *DateCriteria) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types.Duration{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.StartDateWindow == nil { + m.StartDateWindow = &types.Duration{} + } + if err := m.StartDateWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &DateCriteria_StartDateWindow{v} iNdEx = postIndex default: iNdEx = preIndex