diff --git a/api/regen/ecocredit/v1/events.pulsar.go b/api/regen/ecocredit/v1/events.pulsar.go index 09cbd73deb..ab0a26940c 100644 --- a/api/regen/ecocredit/v1/events.pulsar.go +++ b/api/regen/ecocredit/v1/events.pulsar.go @@ -7243,6 +7243,7 @@ var ( fd_EventBridge_target protoreflect.FieldDescriptor fd_EventBridge_recipient protoreflect.FieldDescriptor fd_EventBridge_contract protoreflect.FieldDescriptor + fd_EventBridge_amount protoreflect.FieldDescriptor ) func init() { @@ -7251,6 +7252,7 @@ func init() { fd_EventBridge_target = md_EventBridge.Fields().ByName("target") fd_EventBridge_recipient = md_EventBridge.Fields().ByName("recipient") fd_EventBridge_contract = md_EventBridge.Fields().ByName("contract") + fd_EventBridge_amount = md_EventBridge.Fields().ByName("amount") } var _ protoreflect.Message = (*fastReflection_EventBridge)(nil) @@ -7336,6 +7338,12 @@ func (x *fastReflection_EventBridge) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventBridge_amount, value) { + return + } + } } // Has reports whether a field is populated. @@ -7357,6 +7365,8 @@ func (x *fastReflection_EventBridge) Has(fd protoreflect.FieldDescriptor) bool { return x.Recipient != "" case "regen.ecocredit.v1.EventBridge.contract": return x.Contract != "" + case "regen.ecocredit.v1.EventBridge.amount": + return x.Amount != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7379,6 +7389,8 @@ func (x *fastReflection_EventBridge) Clear(fd protoreflect.FieldDescriptor) { x.Recipient = "" case "regen.ecocredit.v1.EventBridge.contract": x.Contract = "" + case "regen.ecocredit.v1.EventBridge.amount": + x.Amount = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7404,6 +7416,9 @@ func (x *fastReflection_EventBridge) Get(descriptor protoreflect.FieldDescriptor case "regen.ecocredit.v1.EventBridge.contract": value := x.Contract return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.EventBridge.amount": + value := x.Amount + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7430,6 +7445,8 @@ func (x *fastReflection_EventBridge) Set(fd protoreflect.FieldDescriptor, value x.Recipient = value.Interface().(string) case "regen.ecocredit.v1.EventBridge.contract": x.Contract = value.Interface().(string) + case "regen.ecocredit.v1.EventBridge.amount": + x.Amount = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7456,6 +7473,8 @@ func (x *fastReflection_EventBridge) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field recipient of message regen.ecocredit.v1.EventBridge is not mutable")) case "regen.ecocredit.v1.EventBridge.contract": panic(fmt.Errorf("field contract of message regen.ecocredit.v1.EventBridge is not mutable")) + case "regen.ecocredit.v1.EventBridge.amount": + panic(fmt.Errorf("field amount of message regen.ecocredit.v1.EventBridge is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7475,6 +7494,8 @@ func (x *fastReflection_EventBridge) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfString("") case "regen.ecocredit.v1.EventBridge.contract": return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.EventBridge.amount": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridge")) @@ -7556,6 +7577,10 @@ func (x *fastReflection_EventBridge) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -7585,6 +7610,13 @@ func (x *fastReflection_EventBridge) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x22 + } if len(x.Contract) > 0 { i -= len(x.Contract) copy(dAtA[i:], x.Contract) @@ -7751,6 +7783,522 @@ func (x *fastReflection_EventBridge) ProtoMethods() *protoiface.Methods { } x.Contract = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventBridgeReceive protoreflect.MessageDescriptor + fd_EventBridgeReceive_project_id protoreflect.FieldDescriptor + fd_EventBridgeReceive_batch_denom protoreflect.FieldDescriptor +) + +func init() { + file_regen_ecocredit_v1_events_proto_init() + md_EventBridgeReceive = File_regen_ecocredit_v1_events_proto.Messages().ByName("EventBridgeReceive") + fd_EventBridgeReceive_project_id = md_EventBridgeReceive.Fields().ByName("project_id") + fd_EventBridgeReceive_batch_denom = md_EventBridgeReceive.Fields().ByName("batch_denom") +} + +var _ protoreflect.Message = (*fastReflection_EventBridgeReceive)(nil) + +type fastReflection_EventBridgeReceive EventBridgeReceive + +func (x *EventBridgeReceive) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventBridgeReceive)(x) +} + +func (x *EventBridgeReceive) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1_events_proto_msgTypes[16] + 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_EventBridgeReceive_messageType fastReflection_EventBridgeReceive_messageType +var _ protoreflect.MessageType = fastReflection_EventBridgeReceive_messageType{} + +type fastReflection_EventBridgeReceive_messageType struct{} + +func (x fastReflection_EventBridgeReceive_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventBridgeReceive)(nil) +} +func (x fastReflection_EventBridgeReceive_messageType) New() protoreflect.Message { + return new(fastReflection_EventBridgeReceive) +} +func (x fastReflection_EventBridgeReceive_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventBridgeReceive +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventBridgeReceive) Descriptor() protoreflect.MessageDescriptor { + return md_EventBridgeReceive +} + +// 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_EventBridgeReceive) Type() protoreflect.MessageType { + return _fastReflection_EventBridgeReceive_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventBridgeReceive) New() protoreflect.Message { + return new(fastReflection_EventBridgeReceive) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventBridgeReceive) Interface() protoreflect.ProtoMessage { + return (*EventBridgeReceive)(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_EventBridgeReceive) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProjectId != "" { + value := protoreflect.ValueOfString(x.ProjectId) + if !f(fd_EventBridgeReceive_project_id, value) { + return + } + } + if x.BatchDenom != "" { + value := protoreflect.ValueOfString(x.BatchDenom) + if !f(fd_EventBridgeReceive_batch_denom, 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_EventBridgeReceive) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + return x.ProjectId != "" + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + return x.BatchDenom != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + x.ProjectId = "" + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + x.BatchDenom = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + value := x.ProjectId + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + value := x.BatchDenom + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + x.ProjectId = value.Interface().(string) + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + x.BatchDenom = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + panic(fmt.Errorf("field project_id of message regen.ecocredit.v1.EventBridgeReceive is not mutable")) + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + panic(fmt.Errorf("field batch_denom of message regen.ecocredit.v1.EventBridgeReceive is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1.EventBridgeReceive.project_id": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1.EventBridgeReceive.batch_denom": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1.EventBridgeReceive")) + } + panic(fmt.Errorf("message regen.ecocredit.v1.EventBridgeReceive 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_EventBridgeReceive) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1.EventBridgeReceive", 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_EventBridgeReceive) 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_EventBridgeReceive) 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_EventBridgeReceive) 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_EventBridgeReceive) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventBridgeReceive) + 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.ProjectId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BatchDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventBridgeReceive) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.BatchDenom) > 0 { + i -= len(x.BatchDenom) + copy(dAtA[i:], x.BatchDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BatchDenom))) + i-- + dAtA[i] = 0x12 + } + if len(x.ProjectId) > 0 { + i -= len(x.ProjectId) + copy(dAtA[i:], x.ProjectId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProjectId))) + 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().(*EventBridgeReceive) + 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: EventBridgeReceive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventBridgeReceive: 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 ProjectId", 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.ProjectId = 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 BatchDenom", 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.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -8510,7 +9058,7 @@ func (x *EventAddCreditType) GetAbbreviation() string { return "" } -// EventBridge is emitted emitted when credits are bridged to another chain. +// EventBridge is emitted when credits are bridged to another chain. type EventBridge struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -8522,6 +9070,8 @@ type EventBridge struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` // contract is the contract address. Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` + // amount is the amount of credits. + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *EventBridge) Reset() { @@ -8565,6 +9115,61 @@ func (x *EventBridge) GetContract() string { return "" } +func (x *EventBridge) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +// EventBridgeReceive is emitted when credits are bridged from another chain. +type EventBridgeReceive struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // project_id is the unique identifier of the project that was either created + // or the existing project within which the credit batch exists. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + // batch_denom is the unique identifier of the credit batch either created + // or within which the credits were dynamically minted. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +func (x *EventBridgeReceive) Reset() { + *x = EventBridgeReceive{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1_events_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventBridgeReceive) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventBridgeReceive) ProtoMessage() {} + +// Deprecated: Use EventBridgeReceive.ProtoReflect.Descriptor instead. +func (*EventBridgeReceive) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1_events_proto_rawDescGZIP(), []int{16} +} + +func (x *EventBridgeReceive) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *EventBridgeReceive) GetBatchDenom() string { + if x != nil { + return x.BatchDenom + } + return "" +} + var File_regen_ecocredit_v1_events_proto protoreflect.FileDescriptor var file_regen_ecocredit_v1_events_proto_rawDesc = []byte{ @@ -8653,27 +9258,34 @@ var file_regen_ecocredit_v1_events_proto_rawDesc = []byte{ 0x6e, 0x74, 0x41, 0x64, 0x64, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x62, 0x62, 0x72, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x62, 0x62, 0x72, 0x65, 0x76, 0x69, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x5f, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, + 0x69, 0x6f, 0x6e, 0x22, 0x77, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x42, 0xd9, 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, - 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, + 0x72, 0x61, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x12, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x42, 0xd9, 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, 0x0b, 0x45, + 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -8688,7 +9300,7 @@ func file_regen_ecocredit_v1_events_proto_rawDescGZIP() []byte { return file_regen_ecocredit_v1_events_proto_rawDescData } -var file_regen_ecocredit_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_regen_ecocredit_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_regen_ecocredit_v1_events_proto_goTypes = []interface{}{ (*EventCreateClass)(nil), // 0: regen.ecocredit.v1.EventCreateClass (*EventCreateProject)(nil), // 1: regen.ecocredit.v1.EventCreateProject @@ -8706,11 +9318,12 @@ var file_regen_ecocredit_v1_events_proto_goTypes = []interface{}{ (*EventSealBatch)(nil), // 13: regen.ecocredit.v1.EventSealBatch (*EventAddCreditType)(nil), // 14: regen.ecocredit.v1.EventAddCreditType (*EventBridge)(nil), // 15: regen.ecocredit.v1.EventBridge - (*OriginTx)(nil), // 16: regen.ecocredit.v1.OriginTx + (*EventBridgeReceive)(nil), // 16: regen.ecocredit.v1.EventBridgeReceive + (*OriginTx)(nil), // 17: regen.ecocredit.v1.OriginTx } var file_regen_ecocredit_v1_events_proto_depIdxs = []int32{ - 16, // 0: regen.ecocredit.v1.EventCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx - 16, // 1: regen.ecocredit.v1.EventMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 17, // 0: regen.ecocredit.v1.EventCreateBatch.origin_tx:type_name -> regen.ecocredit.v1.OriginTx + 17, // 1: regen.ecocredit.v1.EventMintBatchCredits.origin_tx:type_name -> regen.ecocredit.v1.OriginTx 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -8917,6 +9530,18 @@ func file_regen_ecocredit_v1_events_proto_init() { return nil } } + file_regen_ecocredit_v1_events_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventBridgeReceive); 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{ @@ -8924,7 +9549,7 @@ func file_regen_ecocredit_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/api/regen/ecocredit/v1/tx_grpc.pb.go b/api/regen/ecocredit/v1/tx_grpc.pb.go index 57091e102e..3b23496407 100644 --- a/api/regen/ecocredit/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1/tx_grpc.pb.go @@ -92,8 +92,8 @@ type MsgClient interface { // Bridge cancels a specified amount of tradable credits and emits a special // bridge event handled by an external bridge service. Bridge(ctx context.Context, in *MsgBridge, opts ...grpc.CallOption) (*MsgBridgeResponse, error) - // BridgeReceive processes credits being sent from an external registry or network to - // Regen Ledger. + // BridgeReceive processes credits being sent from an external registry or + // network to Regen Ledger. BridgeReceive(ctx context.Context, in *MsgBridgeReceive, opts ...grpc.CallOption) (*MsgBridgeReceiveResponse, error) } @@ -314,8 +314,8 @@ type MsgServer interface { // Bridge cancels a specified amount of tradable credits and emits a special // bridge event handled by an external bridge service. Bridge(context.Context, *MsgBridge) (*MsgBridgeResponse, error) - // BridgeReceive processes credits being sent from an external registry or network to - // Regen Ledger. + // BridgeReceive processes credits being sent from an external registry or + // network to Regen Ledger. BridgeReceive(context.Context, *MsgBridgeReceive) (*MsgBridgeReceiveResponse, error) mustEmbedUnimplementedMsgServer() } diff --git a/go.mod b/go.mod index 6d8999ed16..9dbeb2c5c2 100644 --- a/go.mod +++ b/go.mod @@ -134,7 +134,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect ) replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 0c4267bf18..35d840d7b4 100644 --- a/go.sum +++ b/go.sum @@ -1368,6 +1368,4 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/proto/regen/ecocredit/basket/v1/query.proto b/proto/regen/ecocredit/basket/v1/query.proto index 7ac261f63e..daeeedf073 100644 --- a/proto/regen/ecocredit/basket/v1/query.proto +++ b/proto/regen/ecocredit/basket/v1/query.proto @@ -44,12 +44,10 @@ service Query { option (google.api.http) = { get : "/regen/ecocredit/basket/v1/basket-balance/{basket_denom}/" "{batch_denom}" - additional_bindings : [ - { - get : "/regen/ecocredit/basket/v1/baskets/{basket_denom}/balances/" - "{batch_denom}" - } - ] + additional_bindings : [ { + get : "/regen/ecocredit/basket/v1/baskets/{basket_denom}/balances/" + "{batch_denom}" + } ] }; } } diff --git a/proto/regen/ecocredit/v1/events.proto b/proto/regen/ecocredit/v1/events.proto index e64a0bd0d2..019300ba0a 100644 --- a/proto/regen/ecocredit/v1/events.proto +++ b/proto/regen/ecocredit/v1/events.proto @@ -183,8 +183,9 @@ message EventAddCreditType { string abbreviation = 1; } -// EventBridge is emitted emitted when credits are bridged to another chain. +// EventBridge is emitted when credits are bridged to another chain. message EventBridge { + // target is the target chain. string target = 1; @@ -193,4 +194,19 @@ message EventBridge { // contract is the contract address. string contract = 3; -} \ No newline at end of file + + // amount is the amount of credits. + string amount = 4; +} + +// EventBridgeReceive is emitted when credits are bridged from another chain. +message EventBridgeReceive { + + // project_id is the unique identifier of the project that was either created + // or the existing project within which the credit batch exists. + string project_id = 1; + + // batch_denom is the unique identifier of the credit batch either created + // or within which the credits were dynamically minted. + string batch_denom = 2; +} diff --git a/proto/regen/ecocredit/v1/tx.proto b/proto/regen/ecocredit/v1/tx.proto index 59d795fe1a..7f4b1bc50c 100644 --- a/proto/regen/ecocredit/v1/tx.proto +++ b/proto/regen/ecocredit/v1/tx.proto @@ -102,8 +102,8 @@ service Msg { // bridge event handled by an external bridge service. rpc Bridge(MsgBridge) returns (MsgBridgeResponse); - // BridgeReceive processes credits being sent from an external registry or network to - // Regen Ledger. + // BridgeReceive processes credits being sent from an external registry or + // network to Regen Ledger. rpc BridgeReceive(MsgBridgeReceive) returns (MsgBridgeReceiveResponse); } diff --git a/x/ecocredit/core/events.pb.go b/x/ecocredit/core/events.pb.go index fbeb9035ba..0b172cf7be 100644 --- a/x/ecocredit/core/events.pb.go +++ b/x/ecocredit/core/events.pb.go @@ -868,7 +868,7 @@ func (m *EventAddCreditType) GetAbbreviation() string { return "" } -// EventBridge is emitted emitted when credits are bridged to another chain. +// EventBridge is emitted when credits are bridged to another chain. type EventBridge struct { // target is the target chain. Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` @@ -876,6 +876,8 @@ type EventBridge struct { Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` // contract is the contract address. Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` + // amount is the amount of credits. + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` } func (m *EventBridge) Reset() { *m = EventBridge{} } @@ -932,6 +934,70 @@ func (m *EventBridge) GetContract() string { return "" } +func (m *EventBridge) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +// EventBridgeReceive is emitted when credits are bridged from another chain. +type EventBridgeReceive struct { + // project_id is the unique identifier of the project that was either created + // or the existing project within which the credit batch exists. + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + // batch_denom is the unique identifier of the credit batch either created + // or within which the credits were dynamically minted. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +func (m *EventBridgeReceive) Reset() { *m = EventBridgeReceive{} } +func (m *EventBridgeReceive) String() string { return proto.CompactTextString(m) } +func (*EventBridgeReceive) ProtoMessage() {} +func (*EventBridgeReceive) Descriptor() ([]byte, []int) { + return fileDescriptor_e32415575ff8b4b2, []int{16} +} +func (m *EventBridgeReceive) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBridgeReceive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventBridgeReceive.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 *EventBridgeReceive) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBridgeReceive.Merge(m, src) +} +func (m *EventBridgeReceive) XXX_Size() int { + return m.Size() +} +func (m *EventBridgeReceive) XXX_DiscardUnknown() { + xxx_messageInfo_EventBridgeReceive.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBridgeReceive proto.InternalMessageInfo + +func (m *EventBridgeReceive) GetProjectId() string { + if m != nil { + return m.ProjectId + } + return "" +} + +func (m *EventBridgeReceive) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + func init() { proto.RegisterType((*EventCreateClass)(nil), "regen.ecocredit.v1.EventCreateClass") proto.RegisterType((*EventCreateProject)(nil), "regen.ecocredit.v1.EventCreateProject") @@ -949,50 +1015,52 @@ func init() { proto.RegisterType((*EventSealBatch)(nil), "regen.ecocredit.v1.EventSealBatch") proto.RegisterType((*EventAddCreditType)(nil), "regen.ecocredit.v1.EventAddCreditType") proto.RegisterType((*EventBridge)(nil), "regen.ecocredit.v1.EventBridge") + proto.RegisterType((*EventBridgeReceive)(nil), "regen.ecocredit.v1.EventBridgeReceive") } func init() { proto.RegisterFile("regen/ecocredit/v1/events.proto", fileDescriptor_e32415575ff8b4b2) } var fileDescriptor_e32415575ff8b4b2 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xc1, 0x4f, 0x13, 0x4f, - 0x14, 0x66, 0xe1, 0x47, 0x7f, 0xec, 0x43, 0xd0, 0x4c, 0x14, 0x91, 0xe0, 0x42, 0x36, 0x31, 0x72, - 0x61, 0x1b, 0x40, 0x0d, 0xc6, 0x13, 0x54, 0x0f, 0x1c, 0x88, 0xa4, 0xe2, 0xc5, 0x4b, 0x33, 0x3b, - 0xf3, 0x5c, 0x06, 0xdb, 0x99, 0xcd, 0xec, 0xb4, 0x40, 0xe2, 0xc1, 0x3f, 0xc1, 0xbf, 0xc6, 0xbf, - 0xc1, 0x23, 0x47, 0x8f, 0xa6, 0xfd, 0x47, 0xcc, 0xce, 0x4e, 0x17, 0xda, 0x92, 0xb6, 0x07, 0xbd, - 0xcd, 0xfb, 0xf2, 0xbe, 0xfd, 0xbe, 0x99, 0xb7, 0xdf, 0x83, 0x0d, 0x8d, 0x09, 0xca, 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0x96, 0xfc, 0x01, 0x69, 0x73, 0xba, - 0x55, 0x11, 0xee, 0xbb, 0xa5, 0x74, 0xc0, 0x79, 0x91, 0xb5, 0xd3, 0xab, 0x14, 0xf3, 0xd1, 0xd3, - 0x38, 0xd6, 0xd8, 0x11, 0xd4, 0x8e, 0xbe, 0xe0, 0x0d, 0x60, 0x61, 0xc3, 0x8d, 0xfe, 0x50, 0x0b, - 0x9e, 0x60, 0x3e, 0x2b, 0x43, 0x75, 0x82, 0xa6, 0x9f, 0x99, 0xa2, 0x9a, 0x90, 0x99, 0x35, 0x58, - 0x60, 0x4a, 0x1a, 0x4d, 0x59, 0x7f, 0xf6, 0x65, 0x7d, 0x78, 0xf2, 0xb3, 0x1b, 0x78, 0xd7, 0xdd, - 0xc0, 0xfb, 0xdd, 0x0d, 0xbc, 0xef, 0xbd, 0x60, 0xe6, 0xba, 0x17, 0xcc, 0xfc, 0xea, 0x05, 0x33, - 0x9f, 0x5e, 0x25, 0xc2, 0x9c, 0xb5, 0xe3, 0x88, 0xa9, 0x56, 0xd5, 0x66, 0x7c, 0x5b, 0xa2, 0xb9, - 0x50, 0xfa, 0x8b, 0xab, 0x9a, 0xc8, 0x13, 0xd4, 0xd5, 0xcb, 0x5b, 0xab, 0x9b, 0x29, 0x8d, 0x71, - 0xc5, 0xee, 0xed, 0xbd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0x47, 0x0b, 0xdc, 0x0e, 0x06, - 0x00, 0x00, + // 615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x4f, 0x14, 0x31, + 0x14, 0x66, 0xf8, 0xb1, 0x32, 0x0f, 0x41, 0xd3, 0x28, 0x22, 0xc1, 0x81, 0x4c, 0x62, 0xe4, 0xc2, + 0x6c, 0x00, 0x35, 0x18, 0x4f, 0xb0, 0x7a, 0xe0, 0x40, 0x24, 0xeb, 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0x2e, 0xef, 0x0a, 0x79, 0x5b, 0xfa, 0x5e, 0xc2, 0x93, + 0x71, 0xce, 0x7e, 0x96, 0xf5, 0x50, 0xdf, 0x9a, 0xd9, 0x57, 0xb0, 0x34, 0xce, 0x3a, 0x40, 0x43, + 0x39, 0x35, 0xf4, 0x36, 0xda, 0xce, 0x88, 0x98, 0x8b, 0x7a, 0x61, 0xb1, 0x22, 0xef, 0x6f, 0x61, + 0xf9, 0x3a, 0xb3, 0x94, 0xac, 0x20, 0x6f, 0xc2, 0x82, 0x25, 0x7f, 0x44, 0xda, 0xb9, 0xdb, 0x53, + 0x11, 0xee, 0xb8, 0x47, 0x69, 0x97, 0xf3, 0x22, 0x6b, 0xad, 0xb3, 0x14, 0xf3, 0xd1, 0xd3, 0x38, + 0xd6, 0xd8, 0x17, 0xd4, 0x8e, 0xbe, 0xe0, 0x8d, 0x60, 0xe1, 0x89, 0x1b, 0xfd, 0x9e, 0x16, 0x3c, + 0xc1, 0x7c, 0x56, 0x86, 0xea, 0x04, 0xcd, 0x20, 0x33, 0x45, 0x55, 0x91, 0x99, 0x65, 0x98, 0x65, + 0x4a, 0x1a, 0x4d, 0xd9, 0x60, 0xf6, 0x65, 0x3d, 0x74, 0x2b, 0xa6, 0x87, 0x6f, 0x45, 0xd8, 0x72, + 0x96, 0x0b, 0xe1, 0x26, 0x32, 0x14, 0x7d, 0xac, 0x38, 0x9a, 0xca, 0x3b, 0xb8, 0x77, 0xf8, 0xeb, + 0x22, 0xf0, 0xce, 0x2f, 0x02, 0xef, 0xcf, 0x45, 0xe0, 0xfd, 0xb8, 0x0c, 0x26, 0xce, 0x2f, 0x83, + 0x89, 0xdf, 0x97, 0xc1, 0xc4, 0xe7, 0xd7, 0x89, 0x30, 0x47, 0xbd, 0x38, 0x62, 0xaa, 0x5b, 0xb7, + 0x2f, 0xca, 0x86, 0x44, 0x73, 0xa2, 0xf4, 0x57, 0x57, 0x75, 0x90, 0x27, 0xa8, 0xeb, 0xa7, 0x43, + 0x3f, 0x0a, 0xa6, 0x34, 0xc6, 0x35, 0xfb, 0x97, 0xd8, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xf6, + 0xea, 0xa1, 0x44, 0x7c, 0x06, 0x00, 0x00, } func (m *EventCreateClass) Marshal() (dAtA []byte, err error) { @@ -1573,6 +1641,13 @@ func (m *EventBridge) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x22 + } if len(m.Contract) > 0 { i -= len(m.Contract) copy(dAtA[i:], m.Contract) @@ -1597,6 +1672,43 @@ func (m *EventBridge) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventBridgeReceive) 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 *EventBridgeReceive) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBridgeReceive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.ProjectId) > 0 { + i -= len(m.ProjectId) + copy(dAtA[i:], m.ProjectId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ProjectId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1877,6 +1989,27 @@ func (m *EventBridge) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventBridgeReceive) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -3697,6 +3830,152 @@ func (m *EventBridge) Unmarshal(dAtA []byte) error { } m.Contract = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBridgeReceive) 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 ErrIntOverflowEvents + } + 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: EventBridgeReceive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBridgeReceive: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/ecocredit/core/tx.pb.go b/x/ecocredit/core/tx.pb.go index 54b8f7cdc0..e66e942386 100644 --- a/x/ecocredit/core/tx.pb.go +++ b/x/ecocredit/core/tx.pb.go @@ -2265,8 +2265,8 @@ type MsgClient interface { // Bridge cancels a specified amount of tradable credits and emits a special // bridge event handled by an external bridge service. Bridge(ctx context.Context, in *MsgBridge, opts ...grpc.CallOption) (*MsgBridgeResponse, error) - // BridgeReceive processes credits being sent from an external registry or network to - // Regen Ledger. + // BridgeReceive processes credits being sent from an external registry or + // network to Regen Ledger. BridgeReceive(ctx context.Context, in *MsgBridgeReceive, opts ...grpc.CallOption) (*MsgBridgeReceiveResponse, error) } @@ -2485,8 +2485,8 @@ type MsgServer interface { // Bridge cancels a specified amount of tradable credits and emits a special // bridge event handled by an external bridge service. Bridge(context.Context, *MsgBridge) (*MsgBridgeResponse, error) - // BridgeReceive processes credits being sent from an external registry or network to - // Regen Ledger. + // BridgeReceive processes credits being sent from an external registry or + // network to Regen Ledger. BridgeReceive(context.Context, *MsgBridgeReceive) (*MsgBridgeReceiveResponse, error) } diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index 99a11b12b2..98eb7743aa 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -27,7 +27,6 @@ require ( google.golang.org/protobuf v1.27.1 gotest.tools/v3 v3.1.0 pgregory.net/rapid v0.4.7 - sigs.k8s.io/yaml v1.2.0 ) require ( diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index f9185cfd01..b8c939fe1a 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -1464,6 +1464,4 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/ecocredit/server/core/bridge.go b/x/ecocredit/server/core/bridge.go index 07ce8d5b97..f9b507f9cb 100644 --- a/x/ecocredit/server/core/bridge.go +++ b/x/ecocredit/server/core/bridge.go @@ -20,12 +20,15 @@ func (k Keeper) Bridge(ctx context.Context, req *core.MsgBridge) (*core.MsgBridg } sdkCtx := types.UnwrapSDKContext(ctx) - if err = sdkCtx.EventManager().EmitTypedEvent(&core.EventBridge{ - Target: req.Target, - Recipient: req.Recipient, - Contract: req.Contract, - }); err != nil { - return nil, err + for _, credit := range req.Credits { + if err = sdkCtx.EventManager().EmitTypedEvent(&core.EventBridge{ + Target: req.Target, + Recipient: req.Recipient, + Contract: req.Contract, + Amount: credit.Amount, + }); err != nil { + return nil, err + } } return &core.MsgBridgeResponse{}, nil diff --git a/x/ecocredit/server/core/bridge_receive.go b/x/ecocredit/server/core/bridge_receive.go index 7c6f6aff34..71a24ecec1 100644 --- a/x/ecocredit/server/core/bridge_receive.go +++ b/x/ecocredit/server/core/bridge_receive.go @@ -23,7 +23,9 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( return nil, err } + var event *core.EventBridgeReceive var response *core.MsgBridgeReceiveResponse + // if no project was found, create one + issue batch if project == nil { projectRes, err := k.CreateProject(ctx, &core.MsgCreateProject{ @@ -40,7 +42,10 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( Issuer: req.Issuer, ProjectId: projectRes.ProjectId, Issuance: []*core.BatchIssuance{ - {Recipient: req.Batch.Recipient, TradableAmount: req.Batch.Amount}, + { + Recipient: req.Batch.Recipient, + TradableAmount: req.Batch.Amount, + }, }, Metadata: req.Batch.Metadata, StartDate: req.Batch.StartDate, @@ -52,7 +57,14 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( if err != nil { return nil, err } - response = &core.MsgBridgeReceiveResponse{BatchDenom: batchRes.BatchDenom, ProjectId: projectRes.ProjectId} + event = &core.EventBridgeReceive{ + BatchDenom: batchRes.BatchDenom, + ProjectId: projectRes.ProjectId, + } + response = &core.MsgBridgeReceiveResponse{ + BatchDenom: batchRes.BatchDenom, + ProjectId: projectRes.ProjectId, + } } else { batch, err := k.getBatchFromBridgeReq(ctx, req.Batch, project.Id, bridgeServiceAddr) if err != nil { @@ -64,7 +76,10 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( Issuer: req.Issuer, BatchDenom: batch.Denom, Issuance: []*core.BatchIssuance{ - {Recipient: req.Batch.Recipient, TradableAmount: req.Batch.Amount}, + { + Recipient: req.Batch.Recipient, + TradableAmount: req.Batch.Amount, + }, }, OriginTx: req.OriginTx, Note: req.Note, @@ -72,14 +87,24 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( if err != nil { return nil, err } - response = &core.MsgBridgeReceiveResponse{BatchDenom: batch.Denom, ProjectId: project.Id} + event = &core.EventBridgeReceive{ + BatchDenom: batch.Denom, + ProjectId: project.Id, + } + response = &core.MsgBridgeReceiveResponse{ + BatchDenom: batch.Denom, + ProjectId: project.Id, + } } else { // batch was nil, so we need to create one. res, err := k.CreateBatch(ctx, &core.MsgCreateBatch{ Issuer: req.Issuer, ProjectId: project.Id, Issuance: []*core.BatchIssuance{ - {Recipient: req.Batch.Recipient, TradableAmount: req.Batch.Amount}, + { + Recipient: req.Batch.Recipient, + TradableAmount: req.Batch.Amount, + }, }, Metadata: req.Batch.Metadata, StartDate: req.Batch.StartDate, @@ -91,10 +116,21 @@ func (k Keeper) BridgeReceive(ctx context.Context, req *core.MsgBridgeReceive) ( if err != nil { return nil, err } - response = &core.MsgBridgeReceiveResponse{BatchDenom: res.BatchDenom, ProjectId: project.Id} + event = &core.EventBridgeReceive{ + BatchDenom: res.BatchDenom, + ProjectId: project.Id, + } + response = &core.MsgBridgeReceiveResponse{ + BatchDenom: res.BatchDenom, + ProjectId: project.Id, + } } } - // TODO: emit event? + + if err = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(event); err != nil { + return nil, err + } + return response, nil } diff --git a/x/group/go.mod b/x/group/go.mod index 3a019f2743..9a0f222250 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -127,7 +127,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect ) replace github.com/cosmos/cosmos-sdk => github.com/regen-network/cosmos-sdk v0.45.0-regen-1 diff --git a/x/group/go.sum b/x/group/go.sum index 9a0629d9c1..c1c3587093 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -1598,6 +1598,5 @@ rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=