diff --git a/api/poktroll/application/event.pulsar.go b/api/poktroll/application/event.pulsar.go index 5d15bcd4c..862011d23 100644 --- a/api/poktroll/application/event.pulsar.go +++ b/api/poktroll/application/event.pulsar.go @@ -498,6 +498,1759 @@ func (x *fastReflection_EventRedelegation) ProtoMethods() *protoiface.Methods { } } +var ( + md_EventTransferBegin protoreflect.MessageDescriptor + fd_EventTransferBegin_source_address protoreflect.FieldDescriptor + fd_EventTransferBegin_destination_address protoreflect.FieldDescriptor + fd_EventTransferBegin_source_application protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_event_proto_init() + md_EventTransferBegin = File_poktroll_application_event_proto.Messages().ByName("EventTransferBegin") + fd_EventTransferBegin_source_address = md_EventTransferBegin.Fields().ByName("source_address") + fd_EventTransferBegin_destination_address = md_EventTransferBegin.Fields().ByName("destination_address") + fd_EventTransferBegin_source_application = md_EventTransferBegin.Fields().ByName("source_application") +} + +var _ protoreflect.Message = (*fastReflection_EventTransferBegin)(nil) + +type fastReflection_EventTransferBegin EventTransferBegin + +func (x *EventTransferBegin) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTransferBegin)(x) +} + +func (x *EventTransferBegin) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventTransferBegin_messageType fastReflection_EventTransferBegin_messageType +var _ protoreflect.MessageType = fastReflection_EventTransferBegin_messageType{} + +type fastReflection_EventTransferBegin_messageType struct{} + +func (x fastReflection_EventTransferBegin_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTransferBegin)(nil) +} +func (x fastReflection_EventTransferBegin_messageType) New() protoreflect.Message { + return new(fastReflection_EventTransferBegin) +} +func (x fastReflection_EventTransferBegin_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferBegin +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTransferBegin) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferBegin +} + +// 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_EventTransferBegin) Type() protoreflect.MessageType { + return _fastReflection_EventTransferBegin_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTransferBegin) New() protoreflect.Message { + return new(fastReflection_EventTransferBegin) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTransferBegin) Interface() protoreflect.ProtoMessage { + return (*EventTransferBegin)(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_EventTransferBegin) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.SourceAddress != "" { + value := protoreflect.ValueOfString(x.SourceAddress) + if !f(fd_EventTransferBegin_source_address, value) { + return + } + } + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_EventTransferBegin_destination_address, value) { + return + } + } + if x.SourceApplication != nil { + value := protoreflect.ValueOfMessage(x.SourceApplication.ProtoReflect()) + if !f(fd_EventTransferBegin_source_application, 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_EventTransferBegin) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.EventTransferBegin.source_address": + return x.SourceAddress != "" + case "poktroll.application.EventTransferBegin.destination_address": + return x.DestinationAddress != "" + case "poktroll.application.EventTransferBegin.source_application": + return x.SourceApplication != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.EventTransferBegin.source_address": + x.SourceAddress = "" + case "poktroll.application.EventTransferBegin.destination_address": + x.DestinationAddress = "" + case "poktroll.application.EventTransferBegin.source_application": + x.SourceApplication = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.EventTransferBegin.source_address": + value := x.SourceAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferBegin.destination_address": + value := x.DestinationAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferBegin.source_application": + value := x.SourceApplication + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.EventTransferBegin.source_address": + x.SourceAddress = value.Interface().(string) + case "poktroll.application.EventTransferBegin.destination_address": + x.DestinationAddress = value.Interface().(string) + case "poktroll.application.EventTransferBegin.source_application": + x.SourceApplication = value.Message().Interface().(*Application) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferBegin.source_application": + if x.SourceApplication == nil { + x.SourceApplication = new(Application) + } + return protoreflect.ValueOfMessage(x.SourceApplication.ProtoReflect()) + case "poktroll.application.EventTransferBegin.source_address": + panic(fmt.Errorf("field source_address of message poktroll.application.EventTransferBegin is not mutable")) + case "poktroll.application.EventTransferBegin.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.EventTransferBegin is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferBegin.source_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferBegin.destination_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferBegin.source_application": + m := new(Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferBegin")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferBegin 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_EventTransferBegin) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.EventTransferBegin", 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_EventTransferBegin) 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_EventTransferBegin) 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_EventTransferBegin) 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_EventTransferBegin) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTransferBegin) + 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.SourceAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DestinationAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.SourceApplication != nil { + l = options.Size(x.SourceApplication) + 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().(*EventTransferBegin) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.SourceApplication != nil { + encoded, err := options.Marshal(x.SourceApplication) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.DestinationAddress) > 0 { + i -= len(x.DestinationAddress) + copy(dAtA[i:], x.DestinationAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.SourceAddress) > 0 { + i -= len(x.SourceAddress) + copy(dAtA[i:], x.SourceAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceAddress))) + 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().(*EventTransferBegin) + 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: EventTransferBegin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTransferBegin: 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 SourceAddress", 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.SourceAddress = 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 DestinationAddress", 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.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.SourceApplication == nil { + x.SourceApplication = &Application{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SourceApplication); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventTransferEnd protoreflect.MessageDescriptor + fd_EventTransferEnd_source_address protoreflect.FieldDescriptor + fd_EventTransferEnd_destination_address protoreflect.FieldDescriptor + fd_EventTransferEnd_destination_application protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_event_proto_init() + md_EventTransferEnd = File_poktroll_application_event_proto.Messages().ByName("EventTransferEnd") + fd_EventTransferEnd_source_address = md_EventTransferEnd.Fields().ByName("source_address") + fd_EventTransferEnd_destination_address = md_EventTransferEnd.Fields().ByName("destination_address") + fd_EventTransferEnd_destination_application = md_EventTransferEnd.Fields().ByName("destination_application") +} + +var _ protoreflect.Message = (*fastReflection_EventTransferEnd)(nil) + +type fastReflection_EventTransferEnd EventTransferEnd + +func (x *EventTransferEnd) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTransferEnd)(x) +} + +func (x *EventTransferEnd) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_event_proto_msgTypes[2] + 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_EventTransferEnd_messageType fastReflection_EventTransferEnd_messageType +var _ protoreflect.MessageType = fastReflection_EventTransferEnd_messageType{} + +type fastReflection_EventTransferEnd_messageType struct{} + +func (x fastReflection_EventTransferEnd_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTransferEnd)(nil) +} +func (x fastReflection_EventTransferEnd_messageType) New() protoreflect.Message { + return new(fastReflection_EventTransferEnd) +} +func (x fastReflection_EventTransferEnd_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferEnd +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTransferEnd) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferEnd +} + +// 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_EventTransferEnd) Type() protoreflect.MessageType { + return _fastReflection_EventTransferEnd_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTransferEnd) New() protoreflect.Message { + return new(fastReflection_EventTransferEnd) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTransferEnd) Interface() protoreflect.ProtoMessage { + return (*EventTransferEnd)(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_EventTransferEnd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.SourceAddress != "" { + value := protoreflect.ValueOfString(x.SourceAddress) + if !f(fd_EventTransferEnd_source_address, value) { + return + } + } + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_EventTransferEnd_destination_address, value) { + return + } + } + if x.DestinationApplication != nil { + value := protoreflect.ValueOfMessage(x.DestinationApplication.ProtoReflect()) + if !f(fd_EventTransferEnd_destination_application, 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_EventTransferEnd) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.EventTransferEnd.source_address": + return x.SourceAddress != "" + case "poktroll.application.EventTransferEnd.destination_address": + return x.DestinationAddress != "" + case "poktroll.application.EventTransferEnd.destination_application": + return x.DestinationApplication != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.EventTransferEnd.source_address": + x.SourceAddress = "" + case "poktroll.application.EventTransferEnd.destination_address": + x.DestinationAddress = "" + case "poktroll.application.EventTransferEnd.destination_application": + x.DestinationApplication = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.EventTransferEnd.source_address": + value := x.SourceAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferEnd.destination_address": + value := x.DestinationAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferEnd.destination_application": + value := x.DestinationApplication + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.EventTransferEnd.source_address": + x.SourceAddress = value.Interface().(string) + case "poktroll.application.EventTransferEnd.destination_address": + x.DestinationAddress = value.Interface().(string) + case "poktroll.application.EventTransferEnd.destination_application": + x.DestinationApplication = value.Message().Interface().(*Application) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferEnd.destination_application": + if x.DestinationApplication == nil { + x.DestinationApplication = new(Application) + } + return protoreflect.ValueOfMessage(x.DestinationApplication.ProtoReflect()) + case "poktroll.application.EventTransferEnd.source_address": + panic(fmt.Errorf("field source_address of message poktroll.application.EventTransferEnd is not mutable")) + case "poktroll.application.EventTransferEnd.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.EventTransferEnd is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferEnd.source_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferEnd.destination_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferEnd.destination_application": + m := new(Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferEnd")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferEnd 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_EventTransferEnd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.EventTransferEnd", 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_EventTransferEnd) 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_EventTransferEnd) 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_EventTransferEnd) 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_EventTransferEnd) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTransferEnd) + 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.SourceAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DestinationAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.DestinationApplication != nil { + l = options.Size(x.DestinationApplication) + 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().(*EventTransferEnd) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.DestinationApplication != nil { + encoded, err := options.Marshal(x.DestinationApplication) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.DestinationAddress) > 0 { + i -= len(x.DestinationAddress) + copy(dAtA[i:], x.DestinationAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.SourceAddress) > 0 { + i -= len(x.SourceAddress) + copy(dAtA[i:], x.SourceAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceAddress))) + 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().(*EventTransferEnd) + 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: EventTransferEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTransferEnd: 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 SourceAddress", 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.SourceAddress = 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 DestinationAddress", 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.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DestinationApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DestinationApplication == nil { + x.DestinationApplication = &Application{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DestinationApplication); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventTransferError protoreflect.MessageDescriptor + fd_EventTransferError_source_address protoreflect.FieldDescriptor + fd_EventTransferError_destination_address protoreflect.FieldDescriptor + fd_EventTransferError_source_application protoreflect.FieldDescriptor + fd_EventTransferError_error protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_event_proto_init() + md_EventTransferError = File_poktroll_application_event_proto.Messages().ByName("EventTransferError") + fd_EventTransferError_source_address = md_EventTransferError.Fields().ByName("source_address") + fd_EventTransferError_destination_address = md_EventTransferError.Fields().ByName("destination_address") + fd_EventTransferError_source_application = md_EventTransferError.Fields().ByName("source_application") + fd_EventTransferError_error = md_EventTransferError.Fields().ByName("error") +} + +var _ protoreflect.Message = (*fastReflection_EventTransferError)(nil) + +type fastReflection_EventTransferError EventTransferError + +func (x *EventTransferError) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTransferError)(x) +} + +func (x *EventTransferError) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_event_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventTransferError_messageType fastReflection_EventTransferError_messageType +var _ protoreflect.MessageType = fastReflection_EventTransferError_messageType{} + +type fastReflection_EventTransferError_messageType struct{} + +func (x fastReflection_EventTransferError_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTransferError)(nil) +} +func (x fastReflection_EventTransferError_messageType) New() protoreflect.Message { + return new(fastReflection_EventTransferError) +} +func (x fastReflection_EventTransferError_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferError +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTransferError) Descriptor() protoreflect.MessageDescriptor { + return md_EventTransferError +} + +// 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_EventTransferError) Type() protoreflect.MessageType { + return _fastReflection_EventTransferError_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTransferError) New() protoreflect.Message { + return new(fastReflection_EventTransferError) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTransferError) Interface() protoreflect.ProtoMessage { + return (*EventTransferError)(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_EventTransferError) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.SourceAddress != "" { + value := protoreflect.ValueOfString(x.SourceAddress) + if !f(fd_EventTransferError_source_address, value) { + return + } + } + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_EventTransferError_destination_address, value) { + return + } + } + if x.SourceApplication != nil { + value := protoreflect.ValueOfMessage(x.SourceApplication.ProtoReflect()) + if !f(fd_EventTransferError_source_application, value) { + return + } + } + if x.Error != "" { + value := protoreflect.ValueOfString(x.Error) + if !f(fd_EventTransferError_error, 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_EventTransferError) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.EventTransferError.source_address": + return x.SourceAddress != "" + case "poktroll.application.EventTransferError.destination_address": + return x.DestinationAddress != "" + case "poktroll.application.EventTransferError.source_application": + return x.SourceApplication != nil + case "poktroll.application.EventTransferError.error": + return x.Error != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.EventTransferError.source_address": + x.SourceAddress = "" + case "poktroll.application.EventTransferError.destination_address": + x.DestinationAddress = "" + case "poktroll.application.EventTransferError.source_application": + x.SourceApplication = nil + case "poktroll.application.EventTransferError.error": + x.Error = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.EventTransferError.source_address": + value := x.SourceAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferError.destination_address": + value := x.DestinationAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.EventTransferError.source_application": + value := x.SourceApplication + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.application.EventTransferError.error": + value := x.Error + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.EventTransferError.source_address": + x.SourceAddress = value.Interface().(string) + case "poktroll.application.EventTransferError.destination_address": + x.DestinationAddress = value.Interface().(string) + case "poktroll.application.EventTransferError.source_application": + x.SourceApplication = value.Message().Interface().(*Application) + case "poktroll.application.EventTransferError.error": + x.Error = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferError.source_application": + if x.SourceApplication == nil { + x.SourceApplication = new(Application) + } + return protoreflect.ValueOfMessage(x.SourceApplication.ProtoReflect()) + case "poktroll.application.EventTransferError.source_address": + panic(fmt.Errorf("field source_address of message poktroll.application.EventTransferError is not mutable")) + case "poktroll.application.EventTransferError.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.EventTransferError is not mutable")) + case "poktroll.application.EventTransferError.error": + panic(fmt.Errorf("field error of message poktroll.application.EventTransferError is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.EventTransferError.source_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferError.destination_address": + return protoreflect.ValueOfString("") + case "poktroll.application.EventTransferError.source_application": + m := new(Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.application.EventTransferError.error": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.EventTransferError")) + } + panic(fmt.Errorf("message poktroll.application.EventTransferError 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_EventTransferError) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.EventTransferError", 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_EventTransferError) 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_EventTransferError) 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_EventTransferError) 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_EventTransferError) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTransferError) + 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.SourceAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DestinationAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.SourceApplication != nil { + l = options.Size(x.SourceApplication) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Error) + 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().(*EventTransferError) + 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.Error) > 0 { + i -= len(x.Error) + copy(dAtA[i:], x.Error) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) + i-- + dAtA[i] = 0x22 + } + if x.SourceApplication != nil { + encoded, err := options.Marshal(x.SourceApplication) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.DestinationAddress) > 0 { + i -= len(x.DestinationAddress) + copy(dAtA[i:], x.DestinationAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.SourceAddress) > 0 { + i -= len(x.SourceAddress) + copy(dAtA[i:], x.SourceAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceAddress))) + 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().(*EventTransferError) + 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: EventTransferError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTransferError: 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 SourceAddress", 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.SourceAddress = 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 DestinationAddress", 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.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.SourceApplication == nil { + x.SourceApplication = &Application{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SourceApplication); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Error", 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.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -557,6 +2310,178 @@ func (x *EventRedelegation) GetGatewayAddress() string { return "" } +// EventTransferBegin is emitted whenever an application begins a transfer. It +// includes the source application state immediately after the transfer began. +type EventTransferBegin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SourceApplication *Application `protobuf:"bytes,3,opt,name=source_application,json=sourceApplication,proto3" json:"source_application,omitempty"` +} + +func (x *EventTransferBegin) Reset() { + *x = EventTransferBegin{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTransferBegin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTransferBegin) ProtoMessage() {} + +// Deprecated: Use EventTransferBegin.ProtoReflect.Descriptor instead. +func (*EventTransferBegin) Descriptor() ([]byte, []int) { + return file_poktroll_application_event_proto_rawDescGZIP(), []int{1} +} + +func (x *EventTransferBegin) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *EventTransferBegin) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +func (x *EventTransferBegin) GetSourceApplication() *Application { + if x != nil { + return x.SourceApplication + } + return nil +} + +// EventTransferEnd is emitted whenever an application transfer is completed. It +// includes the destination application state at the time the transfer completed. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +type EventTransferEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + DestinationApplication *Application `protobuf:"bytes,3,opt,name=destination_application,json=destinationApplication,proto3" json:"destination_application,omitempty"` +} + +func (x *EventTransferEnd) Reset() { + *x = EventTransferEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTransferEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTransferEnd) ProtoMessage() {} + +// Deprecated: Use EventTransferEnd.ProtoReflect.Descriptor instead. +func (*EventTransferEnd) Descriptor() ([]byte, []int) { + return file_poktroll_application_event_proto_rawDescGZIP(), []int{2} +} + +func (x *EventTransferEnd) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *EventTransferEnd) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +func (x *EventTransferEnd) GetDestinationApplication() *Application { + if x != nil { + return x.DestinationApplication + } + return nil +} + +// EventTransferError is emitted whenever an application transfer fails. It +// includes the source application state at the time the transfer failed and +// the error message. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +type EventTransferError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SourceApplication *Application `protobuf:"bytes,3,opt,name=source_application,json=sourceApplication,proto3" json:"source_application,omitempty"` + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *EventTransferError) Reset() { + *x = EventTransferError{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTransferError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTransferError) ProtoMessage() {} + +// Deprecated: Use EventTransferError.ProtoReflect.Descriptor instead. +func (*EventTransferError) Descriptor() ([]byte, []int) { + return file_poktroll_application_event_proto_rawDescGZIP(), []int{3} +} + +func (x *EventTransferError) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *EventTransferError) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +func (x *EventTransferError) GetSourceApplication() *Application { + if x != nil { + return x.SourceApplication + } + return nil +} + +func (x *EventTransferError) GetError() string { + if x != nil { + return x.Error + } + return "" +} + var File_poktroll_application_event_proto protoreflect.FileDescriptor var file_poktroll_application_event_proto_rawDesc = []byte{ @@ -566,29 +2491,79 @@ var file_poktroll_application_event_proto_rawDesc = []byte{ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x39, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x11, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0xf2, 0x01, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, - 0x61, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xc2, 0x01, - 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xfa, 0x01, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5a, 0x0a, 0x17, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x88, 0x02, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0xc2, 0x01, 0xd8, + 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, + 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -603,16 +2578,23 @@ func file_poktroll_application_event_proto_rawDescGZIP() []byte { return file_poktroll_application_event_proto_rawDescData } -var file_poktroll_application_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_application_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_application_event_proto_goTypes = []interface{}{ - (*EventRedelegation)(nil), // 0: poktroll.application.EventRedelegation + (*EventRedelegation)(nil), // 0: poktroll.application.EventRedelegation + (*EventTransferBegin)(nil), // 1: poktroll.application.EventTransferBegin + (*EventTransferEnd)(nil), // 2: poktroll.application.EventTransferEnd + (*EventTransferError)(nil), // 3: poktroll.application.EventTransferError + (*Application)(nil), // 4: poktroll.application.Application } var file_poktroll_application_event_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: poktroll.application.EventTransferBegin.source_application:type_name -> poktroll.application.Application + 4, // 1: poktroll.application.EventTransferEnd.destination_application:type_name -> poktroll.application.Application + 4, // 2: poktroll.application.EventTransferError.source_application:type_name -> poktroll.application.Application + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_poktroll_application_event_proto_init() } @@ -620,6 +2602,7 @@ func file_poktroll_application_event_proto_init() { if File_poktroll_application_event_proto != nil { return } + file_poktroll_application_types_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_application_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventRedelegation); i { @@ -633,6 +2616,42 @@ func file_poktroll_application_event_proto_init() { return nil } } + file_poktroll_application_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTransferBegin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_application_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTransferEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_application_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTransferError); 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{ @@ -640,7 +2659,7 @@ func file_poktroll_application_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_application_event_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index 2f0cbcda3..262392129 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -1511,12 +1511,14 @@ func (x *fastReflection_MsgStakeApplication) ProtoMethods() *protoiface.Methods } var ( - md_MsgStakeApplicationResponse protoreflect.MessageDescriptor + md_MsgStakeApplicationResponse protoreflect.MessageDescriptor + fd_MsgStakeApplicationResponse_application protoreflect.FieldDescriptor ) func init() { file_poktroll_application_tx_proto_init() md_MsgStakeApplicationResponse = File_poktroll_application_tx_proto.Messages().ByName("MsgStakeApplicationResponse") + fd_MsgStakeApplicationResponse_application = md_MsgStakeApplicationResponse.Fields().ByName("application") } var _ protoreflect.Message = (*fastReflection_MsgStakeApplicationResponse)(nil) @@ -1584,6 +1586,12 @@ func (x *fastReflection_MsgStakeApplicationResponse) Interface() protoreflect.Pr // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgStakeApplicationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgStakeApplicationResponse_application, value) { + return + } + } } // Has reports whether a field is populated. @@ -1599,6 +1607,8 @@ func (x *fastReflection_MsgStakeApplicationResponse) Range(f func(protoreflect.F // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgStakeApplicationResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + return x.Application != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1615,6 +1625,8 @@ func (x *fastReflection_MsgStakeApplicationResponse) Has(fd protoreflect.FieldDe // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeApplicationResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + x.Application = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1631,6 +1643,9 @@ func (x *fastReflection_MsgStakeApplicationResponse) Clear(fd protoreflect.Field // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgStakeApplicationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + value := x.Application + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1651,6 +1666,8 @@ func (x *fastReflection_MsgStakeApplicationResponse) Get(descriptor protoreflect // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeApplicationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + x.Application = value.Message().Interface().(*Application) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1671,6 +1688,11 @@ func (x *fastReflection_MsgStakeApplicationResponse) Set(fd protoreflect.FieldDe // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeApplicationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + if x.Application == nil { + x.Application = new(Application) + } + return protoreflect.ValueOfMessage(x.Application.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1684,6 +1706,9 @@ func (x *fastReflection_MsgStakeApplicationResponse) Mutable(fd protoreflect.Fie // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgStakeApplicationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgStakeApplicationResponse.application": + m := new(Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgStakeApplicationResponse")) @@ -1753,6 +1778,10 @@ func (x *fastReflection_MsgStakeApplicationResponse) ProtoMethods() *protoiface. var n int var l int _ = l + if x.Application != nil { + l = options.Size(x.Application) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1782,6 +1811,20 @@ func (x *fastReflection_MsgStakeApplicationResponse) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Application != nil { + encoded, err := options.Marshal(x.Application) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1831,6 +1874,42 @@ func (x *fastReflection_MsgStakeApplicationResponse) ProtoMethods() *protoiface. return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgStakeApplicationResponse: 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 Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Application == nil { + x.Application = &Application{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Application); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3127,12 +3206,14 @@ func (x *fastReflection_MsgDelegateToGateway) ProtoMethods() *protoiface.Methods } var ( - md_MsgDelegateToGatewayResponse protoreflect.MessageDescriptor + md_MsgDelegateToGatewayResponse protoreflect.MessageDescriptor + fd_MsgDelegateToGatewayResponse_application protoreflect.FieldDescriptor ) func init() { file_poktroll_application_tx_proto_init() md_MsgDelegateToGatewayResponse = File_poktroll_application_tx_proto.Messages().ByName("MsgDelegateToGatewayResponse") + fd_MsgDelegateToGatewayResponse_application = md_MsgDelegateToGatewayResponse.Fields().ByName("application") } var _ protoreflect.Message = (*fastReflection_MsgDelegateToGatewayResponse)(nil) @@ -3200,6 +3281,12 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Interface() protoreflect.P // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgDelegateToGatewayResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgDelegateToGatewayResponse_application, value) { + return + } + } } // Has reports whether a field is populated. @@ -3215,6 +3302,8 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Range(f func(protoreflect. // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgDelegateToGatewayResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + return x.Application != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3231,6 +3320,8 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Has(fd protoreflect.FieldD // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgDelegateToGatewayResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + x.Application = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3247,6 +3338,9 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Clear(fd protoreflect.Fiel // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgDelegateToGatewayResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + value := x.Application + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3267,6 +3361,8 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Get(descriptor protoreflec // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgDelegateToGatewayResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + x.Application = value.Message().Interface().(*Application) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3287,6 +3383,11 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Set(fd protoreflect.FieldD // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgDelegateToGatewayResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + if x.Application == nil { + x.Application = new(Application) + } + return protoreflect.ValueOfMessage(x.Application.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3300,6 +3401,9 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) Mutable(fd protoreflect.Fi // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgDelegateToGatewayResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgDelegateToGatewayResponse.application": + m := new(Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgDelegateToGatewayResponse")) @@ -3369,6 +3473,10 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) ProtoMethods() *protoiface var n int var l int _ = l + if x.Application != nil { + l = options.Size(x.Application) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -3398,6 +3506,20 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) ProtoMethods() *protoiface i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Application != nil { + encoded, err := options.Marshal(x.Application) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -3447,6 +3569,42 @@ func (x *fastReflection_MsgDelegateToGatewayResponse) ProtoMethods() *protoiface return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegateToGatewayResponse: 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 Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Application == nil { + x.Application = &Application{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Application); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -5384,6 +5542,8 @@ type MsgStakeApplicationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (x *MsgStakeApplicationResponse) Reset() { @@ -5406,6 +5566,13 @@ func (*MsgStakeApplicationResponse) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgStakeApplicationResponse) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + type MsgUnstakeApplication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5514,6 +5681,8 @@ type MsgDelegateToGatewayResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (x *MsgDelegateToGatewayResponse) Reset() { @@ -5536,6 +5705,13 @@ func (*MsgDelegateToGatewayResponse) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{7} } +func (x *MsgDelegateToGatewayResponse) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + type MsgUndelegateFromGateway struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5730,117 +5906,125 @@ var file_poktroll_application_tx_proto_rawDesc = []byte{ 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, - 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, + 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x62, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x15, 0x4d, 0x73, - 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0c, 0x82, - 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa6, 0x01, 0x0a, - 0x14, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x3f, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, + 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, + 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x63, 0x0a, 0x1c, 0x4d, 0x73, + 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xaa, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, + 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, + 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x22, 0x0a, 0x20, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, + 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xb9, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, - 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x22, 0x0a, 0x20, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x13, 0x82, - 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x65, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xcd, 0x05, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x70, 0x6f, + 0x69, 0x6e, 0x67, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x65, 0x0a, 0x1e, + 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xcd, 0x05, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x70, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x12, 0x55, 0x6e, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, - 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x33, 0x2e, 0x70, + 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, + 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x79, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, - 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, - 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, 0x01, - 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, - 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5878,24 +6062,26 @@ var file_poktroll_application_tx_proto_depIdxs = []int32{ 12, // 0: poktroll.application.MsgUpdateParams.params:type_name -> poktroll.application.Params 13, // 1: poktroll.application.MsgStakeApplication.stake:type_name -> cosmos.base.v1beta1.Coin 14, // 2: poktroll.application.MsgStakeApplication.services:type_name -> poktroll.shared.ApplicationServiceConfig - 15, // 3: poktroll.application.MsgTransferApplicationResponse.application:type_name -> poktroll.application.Application - 0, // 4: poktroll.application.Msg.UpdateParams:input_type -> poktroll.application.MsgUpdateParams - 2, // 5: poktroll.application.Msg.StakeApplication:input_type -> poktroll.application.MsgStakeApplication - 4, // 6: poktroll.application.Msg.UnstakeApplication:input_type -> poktroll.application.MsgUnstakeApplication - 6, // 7: poktroll.application.Msg.DelegateToGateway:input_type -> poktroll.application.MsgDelegateToGateway - 8, // 8: poktroll.application.Msg.UndelegateFromGateway:input_type -> poktroll.application.MsgUndelegateFromGateway - 10, // 9: poktroll.application.Msg.TransferApplication:input_type -> poktroll.application.MsgTransferApplication - 1, // 10: poktroll.application.Msg.UpdateParams:output_type -> poktroll.application.MsgUpdateParamsResponse - 3, // 11: poktroll.application.Msg.StakeApplication:output_type -> poktroll.application.MsgStakeApplicationResponse - 5, // 12: poktroll.application.Msg.UnstakeApplication:output_type -> poktroll.application.MsgUnstakeApplicationResponse - 7, // 13: poktroll.application.Msg.DelegateToGateway:output_type -> poktroll.application.MsgDelegateToGatewayResponse - 9, // 14: poktroll.application.Msg.UndelegateFromGateway:output_type -> poktroll.application.MsgUndelegateFromGatewayResponse - 11, // 15: poktroll.application.Msg.TransferApplication:output_type -> poktroll.application.MsgTransferApplicationResponse - 10, // [10:16] is the sub-list for method output_type - 4, // [4:10] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 15, // 3: poktroll.application.MsgStakeApplicationResponse.application:type_name -> poktroll.application.Application + 15, // 4: poktroll.application.MsgDelegateToGatewayResponse.application:type_name -> poktroll.application.Application + 15, // 5: poktroll.application.MsgTransferApplicationResponse.application:type_name -> poktroll.application.Application + 0, // 6: poktroll.application.Msg.UpdateParams:input_type -> poktroll.application.MsgUpdateParams + 2, // 7: poktroll.application.Msg.StakeApplication:input_type -> poktroll.application.MsgStakeApplication + 4, // 8: poktroll.application.Msg.UnstakeApplication:input_type -> poktroll.application.MsgUnstakeApplication + 6, // 9: poktroll.application.Msg.DelegateToGateway:input_type -> poktroll.application.MsgDelegateToGateway + 8, // 10: poktroll.application.Msg.UndelegateFromGateway:input_type -> poktroll.application.MsgUndelegateFromGateway + 10, // 11: poktroll.application.Msg.TransferApplication:input_type -> poktroll.application.MsgTransferApplication + 1, // 12: poktroll.application.Msg.UpdateParams:output_type -> poktroll.application.MsgUpdateParamsResponse + 3, // 13: poktroll.application.Msg.StakeApplication:output_type -> poktroll.application.MsgStakeApplicationResponse + 5, // 14: poktroll.application.Msg.UnstakeApplication:output_type -> poktroll.application.MsgUnstakeApplicationResponse + 7, // 15: poktroll.application.Msg.DelegateToGateway:output_type -> poktroll.application.MsgDelegateToGatewayResponse + 9, // 16: poktroll.application.Msg.UndelegateFromGateway:output_type -> poktroll.application.MsgUndelegateFromGatewayResponse + 11, // 17: poktroll.application.Msg.TransferApplication:output_type -> poktroll.application.MsgTransferApplicationResponse + 12, // [12:18] is the sub-list for method output_type + 6, // [6:12] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_poktroll_application_tx_proto_init() } diff --git a/api/poktroll/application/types.pulsar.go b/api/poktroll/application/types.pulsar.go index 60824543a..a2e9a5f2f 100644 --- a/api/poktroll/application/types.pulsar.go +++ b/api/poktroll/application/types.pulsar.go @@ -212,6 +212,7 @@ var ( fd_Application_delegatee_gateway_addresses protoreflect.FieldDescriptor fd_Application_pending_undelegations protoreflect.FieldDescriptor fd_Application_unstake_session_end_height protoreflect.FieldDescriptor + fd_Application_pending_transfer protoreflect.FieldDescriptor ) func init() { @@ -223,6 +224,7 @@ func init() { fd_Application_delegatee_gateway_addresses = md_Application.Fields().ByName("delegatee_gateway_addresses") fd_Application_pending_undelegations = md_Application.Fields().ByName("pending_undelegations") fd_Application_unstake_session_end_height = md_Application.Fields().ByName("unstake_session_end_height") + fd_Application_pending_transfer = md_Application.Fields().ByName("pending_transfer") } var _ protoreflect.Message = (*fastReflection_Application)(nil) @@ -326,6 +328,12 @@ func (x *fastReflection_Application) Range(f func(protoreflect.FieldDescriptor, return } } + if x.PendingTransfer != nil { + value := protoreflect.ValueOfMessage(x.PendingTransfer.ProtoReflect()) + if !f(fd_Application_pending_transfer, value) { + return + } + } } // Has reports whether a field is populated. @@ -353,6 +361,8 @@ func (x *fastReflection_Application) Has(fd protoreflect.FieldDescriptor) bool { return len(x.PendingUndelegations) != 0 case "poktroll.application.Application.unstake_session_end_height": return x.UnstakeSessionEndHeight != uint64(0) + case "poktroll.application.Application.pending_transfer": + return x.PendingTransfer != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.Application")) @@ -381,6 +391,8 @@ func (x *fastReflection_Application) Clear(fd protoreflect.FieldDescriptor) { x.PendingUndelegations = nil case "poktroll.application.Application.unstake_session_end_height": x.UnstakeSessionEndHeight = uint64(0) + case "poktroll.application.Application.pending_transfer": + x.PendingTransfer = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.Application")) @@ -424,6 +436,9 @@ func (x *fastReflection_Application) Get(descriptor protoreflect.FieldDescriptor case "poktroll.application.Application.unstake_session_end_height": value := x.UnstakeSessionEndHeight return protoreflect.ValueOfUint64(value) + case "poktroll.application.Application.pending_transfer": + value := x.PendingTransfer + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.Application")) @@ -462,6 +477,8 @@ func (x *fastReflection_Application) Set(fd protoreflect.FieldDescriptor, value x.PendingUndelegations = *cmv.m case "poktroll.application.Application.unstake_session_end_height": x.UnstakeSessionEndHeight = value.Uint() + case "poktroll.application.Application.pending_transfer": + x.PendingTransfer = value.Message().Interface().(*PendingApplicationTransfer) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.Application")) @@ -505,6 +522,11 @@ func (x *fastReflection_Application) Mutable(fd protoreflect.FieldDescriptor) pr } value := &_Application_5_map{m: &x.PendingUndelegations} return protoreflect.ValueOfMap(value) + case "poktroll.application.Application.pending_transfer": + if x.PendingTransfer == nil { + x.PendingTransfer = new(PendingApplicationTransfer) + } + return protoreflect.ValueOfMessage(x.PendingTransfer.ProtoReflect()) case "poktroll.application.Application.address": panic(fmt.Errorf("field address of message poktroll.application.Application is not mutable")) case "poktroll.application.Application.unstake_session_end_height": @@ -538,6 +560,9 @@ func (x *fastReflection_Application) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfMap(&_Application_5_map{m: &m}) case "poktroll.application.Application.unstake_session_end_height": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.application.Application.pending_transfer": + m := new(PendingApplicationTransfer) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.Application")) @@ -658,6 +683,10 @@ func (x *fastReflection_Application) ProtoMethods() *protoiface.Methods { if x.UnstakeSessionEndHeight != 0 { n += 1 + runtime.Sov(uint64(x.UnstakeSessionEndHeight)) } + if x.PendingTransfer != nil { + l = options.Size(x.PendingTransfer) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -687,6 +716,20 @@ func (x *fastReflection_Application) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.PendingTransfer != nil { + encoded, err := options.Marshal(x.PendingTransfer) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } if x.UnstakeSessionEndHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.UnstakeSessionEndHeight)) i-- @@ -1103,6 +1146,42 @@ func (x *fastReflection_Application) ProtoMethods() *protoiface.Methods { break } } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PendingTransfer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.PendingTransfer == nil { + x.PendingTransfer = &PendingApplicationTransfer{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PendingTransfer); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1618,6 +1697,474 @@ func (x *fastReflection_UndelegatingGatewayList) ProtoMethods() *protoiface.Meth } } +var ( + md_PendingApplicationTransfer protoreflect.MessageDescriptor + fd_PendingApplicationTransfer_destination_address protoreflect.FieldDescriptor + fd_PendingApplicationTransfer_session_end_height protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_types_proto_init() + md_PendingApplicationTransfer = File_poktroll_application_types_proto.Messages().ByName("PendingApplicationTransfer") + fd_PendingApplicationTransfer_destination_address = md_PendingApplicationTransfer.Fields().ByName("destination_address") + fd_PendingApplicationTransfer_session_end_height = md_PendingApplicationTransfer.Fields().ByName("session_end_height") +} + +var _ protoreflect.Message = (*fastReflection_PendingApplicationTransfer)(nil) + +type fastReflection_PendingApplicationTransfer PendingApplicationTransfer + +func (x *PendingApplicationTransfer) ProtoReflect() protoreflect.Message { + return (*fastReflection_PendingApplicationTransfer)(x) +} + +func (x *PendingApplicationTransfer) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_types_proto_msgTypes[2] + 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_PendingApplicationTransfer_messageType fastReflection_PendingApplicationTransfer_messageType +var _ protoreflect.MessageType = fastReflection_PendingApplicationTransfer_messageType{} + +type fastReflection_PendingApplicationTransfer_messageType struct{} + +func (x fastReflection_PendingApplicationTransfer_messageType) Zero() protoreflect.Message { + return (*fastReflection_PendingApplicationTransfer)(nil) +} +func (x fastReflection_PendingApplicationTransfer_messageType) New() protoreflect.Message { + return new(fastReflection_PendingApplicationTransfer) +} +func (x fastReflection_PendingApplicationTransfer_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PendingApplicationTransfer +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PendingApplicationTransfer) Descriptor() protoreflect.MessageDescriptor { + return md_PendingApplicationTransfer +} + +// 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_PendingApplicationTransfer) Type() protoreflect.MessageType { + return _fastReflection_PendingApplicationTransfer_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PendingApplicationTransfer) New() protoreflect.Message { + return new(fastReflection_PendingApplicationTransfer) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PendingApplicationTransfer) Interface() protoreflect.ProtoMessage { + return (*PendingApplicationTransfer)(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_PendingApplicationTransfer) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_PendingApplicationTransfer_destination_address, value) { + return + } + } + if x.SessionEndHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.SessionEndHeight) + if !f(fd_PendingApplicationTransfer_session_end_height, 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_PendingApplicationTransfer) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + return x.DestinationAddress != "" + case "poktroll.application.PendingApplicationTransfer.session_end_height": + return x.SessionEndHeight != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + x.DestinationAddress = "" + case "poktroll.application.PendingApplicationTransfer.session_end_height": + x.SessionEndHeight = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + value := x.DestinationAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.PendingApplicationTransfer.session_end_height": + value := x.SessionEndHeight + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + x.DestinationAddress = value.Interface().(string) + case "poktroll.application.PendingApplicationTransfer.session_end_height": + x.SessionEndHeight = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.PendingApplicationTransfer is not mutable")) + case "poktroll.application.PendingApplicationTransfer.session_end_height": + panic(fmt.Errorf("field session_end_height of message poktroll.application.PendingApplicationTransfer is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.PendingApplicationTransfer.destination_address": + return protoreflect.ValueOfString("") + case "poktroll.application.PendingApplicationTransfer.session_end_height": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.PendingApplicationTransfer")) + } + panic(fmt.Errorf("message poktroll.application.PendingApplicationTransfer 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_PendingApplicationTransfer) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.PendingApplicationTransfer", 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_PendingApplicationTransfer) 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_PendingApplicationTransfer) 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_PendingApplicationTransfer) 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_PendingApplicationTransfer) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PendingApplicationTransfer) + 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.DestinationAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.SessionEndHeight != 0 { + n += 1 + runtime.Sov(uint64(x.SessionEndHeight)) + } + 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().(*PendingApplicationTransfer) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.SessionEndHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SessionEndHeight)) + i-- + dAtA[i] = 0x10 + } + if len(x.DestinationAddress) > 0 { + i -= len(x.DestinationAddress) + copy(dAtA[i:], x.DestinationAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestinationAddress))) + 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().(*PendingApplicationTransfer) + 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: PendingApplicationTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PendingApplicationTransfer: 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 DestinationAddress", 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.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) + } + x.SessionEndHeight = 0 + 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++ + x.SessionEndHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + // TODO_AUTOMATE: Add a CI workflow which detects .proto files with incompatible names (i.e. same as the package). // NB: This file CANNOT be named "application.proto" due to an as of yet unidentified // issue in how cosmos-proto generates the pulsar plugin output go source code. @@ -1661,7 +2208,8 @@ type Application struct { PendingUndelegations map[uint64]*UndelegatingGatewayList `protobuf:"bytes,5,rep,name=pending_undelegations,json=pendingUndelegations,proto3" json:"pending_undelegations,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // The end height of the session at which an application initiated its unstaking process. // If the application did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + PendingTransfer *PendingApplicationTransfer `protobuf:"bytes,7,opt,name=pending_transfer,json=pendingTransfer,proto3" json:"pending_transfer,omitempty"` } func (x *Application) Reset() { @@ -1726,6 +2274,13 @@ func (x *Application) GetUnstakeSessionEndHeight() uint64 { return 0 } +func (x *Application) GetPendingTransfer() *PendingApplicationTransfer { + if x != nil { + return x.PendingTransfer + } + return nil +} + // UndelegatingGatewayList is used as the Value of `pending_undelegations`. // It is required to store a repeated list of strings as a map value. type UndelegatingGatewayList struct { @@ -1763,6 +2318,51 @@ func (x *UndelegatingGatewayList) GetGatewayAddresses() []string { return nil } +// PendingTransfer is used to store the details of a pending transfer. +// It is only intended to be used inside of an Application object. +type PendingApplicationTransfer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DestinationAddress string `protobuf:"bytes,1,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SessionEndHeight uint64 `protobuf:"varint,2,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height,omitempty"` +} + +func (x *PendingApplicationTransfer) Reset() { + *x = PendingApplicationTransfer{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingApplicationTransfer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingApplicationTransfer) ProtoMessage() {} + +// Deprecated: Use PendingApplicationTransfer.ProtoReflect.Descriptor instead. +func (*PendingApplicationTransfer) Descriptor() ([]byte, []int) { + return file_poktroll_application_types_proto_rawDescGZIP(), []int{2} +} + +func (x *PendingApplicationTransfer) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +func (x *PendingApplicationTransfer) GetSessionEndHeight() uint64 { + if x != nil { + return x.SessionEndHeight + } + return 0 +} + var File_poktroll_application_types_proto protoreflect.FileDescriptor var file_poktroll_application_types_proto_rawDesc = []byte{ @@ -1776,7 +2376,7 @@ var file_poktroll_application_types_proto_rawDesc = []byte{ 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x04, 0x0a, 0x0b, 0x41, 0x70, 0x70, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x05, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, @@ -1806,33 +2406,49 @@ var file_poktroll_application_types_proto_rawDesc = []byte{ 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x1a, 0x76, 0x0a, 0x19, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x55, - 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, 0x17, - 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x11, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x42, 0x1c, 0xc8, 0xde, 0x1f, 0x00, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x10, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x42, 0xc2, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, - 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x5b, 0x0a, 0x10, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, + 0x52, 0x0f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x1a, 0x76, 0x0a, 0x19, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x55, 0x6e, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6e, 0x67, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, 0x17, 0x55, 0x6e, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x11, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x1c, 0xc8, 0xde, 0x1f, 0x00, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, + 0x95, 0x01, 0x0a, 0x1a, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x49, + 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, + 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xc2, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1847,24 +2463,26 @@ func file_poktroll_application_types_proto_rawDescGZIP() []byte { return file_poktroll_application_types_proto_rawDescData } -var file_poktroll_application_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_poktroll_application_types_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_application_types_proto_goTypes = []interface{}{ (*Application)(nil), // 0: poktroll.application.Application (*UndelegatingGatewayList)(nil), // 1: poktroll.application.UndelegatingGatewayList - nil, // 2: poktroll.application.Application.PendingUndelegationsEntry - (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin - (*shared.ApplicationServiceConfig)(nil), // 4: poktroll.shared.ApplicationServiceConfig + (*PendingApplicationTransfer)(nil), // 2: poktroll.application.PendingApplicationTransfer + nil, // 3: poktroll.application.Application.PendingUndelegationsEntry + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*shared.ApplicationServiceConfig)(nil), // 5: poktroll.shared.ApplicationServiceConfig } var file_poktroll_application_types_proto_depIdxs = []int32{ - 3, // 0: poktroll.application.Application.stake:type_name -> cosmos.base.v1beta1.Coin - 4, // 1: poktroll.application.Application.service_configs:type_name -> poktroll.shared.ApplicationServiceConfig - 2, // 2: poktroll.application.Application.pending_undelegations:type_name -> poktroll.application.Application.PendingUndelegationsEntry - 1, // 3: poktroll.application.Application.PendingUndelegationsEntry.value:type_name -> poktroll.application.UndelegatingGatewayList - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 0: poktroll.application.Application.stake:type_name -> cosmos.base.v1beta1.Coin + 5, // 1: poktroll.application.Application.service_configs:type_name -> poktroll.shared.ApplicationServiceConfig + 3, // 2: poktroll.application.Application.pending_undelegations:type_name -> poktroll.application.Application.PendingUndelegationsEntry + 2, // 3: poktroll.application.Application.pending_transfer:type_name -> poktroll.application.PendingApplicationTransfer + 1, // 4: poktroll.application.Application.PendingUndelegationsEntry.value:type_name -> poktroll.application.UndelegatingGatewayList + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_poktroll_application_types_proto_init() } @@ -1897,6 +2515,18 @@ func file_poktroll_application_types_proto_init() { return nil } } + file_poktroll_application_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingApplicationTransfer); 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{ @@ -1904,7 +2534,7 @@ func file_poktroll_application_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_application_types_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poktroll/gateway/tx.pulsar.go b/api/poktroll/gateway/tx.pulsar.go index 4625908b1..b1e7190da 100644 --- a/api/poktroll/gateway/tx.pulsar.go +++ b/api/poktroll/gateway/tx.pulsar.go @@ -1372,12 +1372,14 @@ func (x *fastReflection_MsgStakeGateway) ProtoMethods() *protoiface.Methods { } var ( - md_MsgStakeGatewayResponse protoreflect.MessageDescriptor + md_MsgStakeGatewayResponse protoreflect.MessageDescriptor + fd_MsgStakeGatewayResponse_gateway protoreflect.FieldDescriptor ) func init() { file_poktroll_gateway_tx_proto_init() md_MsgStakeGatewayResponse = File_poktroll_gateway_tx_proto.Messages().ByName("MsgStakeGatewayResponse") + fd_MsgStakeGatewayResponse_gateway = md_MsgStakeGatewayResponse.Fields().ByName("gateway") } var _ protoreflect.Message = (*fastReflection_MsgStakeGatewayResponse)(nil) @@ -1445,6 +1447,12 @@ func (x *fastReflection_MsgStakeGatewayResponse) Interface() protoreflect.ProtoM // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgStakeGatewayResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Gateway != nil { + value := protoreflect.ValueOfMessage(x.Gateway.ProtoReflect()) + if !f(fd_MsgStakeGatewayResponse_gateway, value) { + return + } + } } // Has reports whether a field is populated. @@ -1460,6 +1468,8 @@ func (x *fastReflection_MsgStakeGatewayResponse) Range(f func(protoreflect.Field // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgStakeGatewayResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + return x.Gateway != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1476,6 +1486,8 @@ func (x *fastReflection_MsgStakeGatewayResponse) Has(fd protoreflect.FieldDescri // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeGatewayResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + x.Gateway = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1492,6 +1504,9 @@ func (x *fastReflection_MsgStakeGatewayResponse) Clear(fd protoreflect.FieldDesc // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgStakeGatewayResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + value := x.Gateway + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1512,6 +1527,8 @@ func (x *fastReflection_MsgStakeGatewayResponse) Get(descriptor protoreflect.Fie // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeGatewayResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + x.Gateway = value.Message().Interface().(*Gateway) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1532,6 +1549,11 @@ func (x *fastReflection_MsgStakeGatewayResponse) Set(fd protoreflect.FieldDescri // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeGatewayResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + if x.Gateway == nil { + x.Gateway = new(Gateway) + } + return protoreflect.ValueOfMessage(x.Gateway.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1545,6 +1567,9 @@ func (x *fastReflection_MsgStakeGatewayResponse) Mutable(fd protoreflect.FieldDe // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgStakeGatewayResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.gateway.MsgStakeGatewayResponse.gateway": + m := new(Gateway) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgStakeGatewayResponse")) @@ -1614,6 +1639,10 @@ func (x *fastReflection_MsgStakeGatewayResponse) ProtoMethods() *protoiface.Meth var n int var l int _ = l + if x.Gateway != nil { + l = options.Size(x.Gateway) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1643,6 +1672,20 @@ func (x *fastReflection_MsgStakeGatewayResponse) ProtoMethods() *protoiface.Meth i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Gateway != nil { + encoded, err := options.Marshal(x.Gateway) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1692,6 +1735,42 @@ func (x *fastReflection_MsgStakeGatewayResponse) ProtoMethods() *protoiface.Meth return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgStakeGatewayResponse: 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 Gateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Gateway == nil { + x.Gateway = &Gateway{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Gateway); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3621,6 +3700,8 @@ type MsgStakeGatewayResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Gateway *Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway,omitempty"` } func (x *MsgStakeGatewayResponse) Reset() { @@ -3643,6 +3724,13 @@ func (*MsgStakeGatewayResponse) Descriptor() ([]byte, []int) { return file_poktroll_gateway_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgStakeGatewayResponse) GetGateway() *Gateway { + if x != nil { + return x.Gateway + } + return nil +} + type MsgUnstakeGateway struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3807,87 +3895,92 @@ var file_poktroll_gateway_tx_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x0f, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x78, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x0c, 0x82, - 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, - 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, - 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1b, 0x0a, - 0x19, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x73, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x73, 0x54, 0x79, - 0x70, 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x22, 0x4a, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x87, - 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, + 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4e, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x52, 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x22, 0x55, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x32, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x01, + 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, + 0x73, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x4a, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x32, 0x87, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, - 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0xa2, 0x02, 0x03, 0x50, 0x47, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xca, 0x02, 0x10, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xe2, - 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x2b, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xa2, 0x02, 0x03, 0x50, 0x47, 0x58, 0xaa, 0x02, 0x10, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xca, + 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3914,24 +4007,26 @@ var file_poktroll_gateway_tx_proto_goTypes = []interface{}{ (*MsgUpdateParamResponse)(nil), // 7: poktroll.gateway.MsgUpdateParamResponse (*Params)(nil), // 8: poktroll.gateway.Params (*v1beta1.Coin)(nil), // 9: cosmos.base.v1beta1.Coin + (*Gateway)(nil), // 10: poktroll.gateway.Gateway } var file_poktroll_gateway_tx_proto_depIdxs = []int32{ - 8, // 0: poktroll.gateway.MsgUpdateParams.params:type_name -> poktroll.gateway.Params - 9, // 1: poktroll.gateway.MsgStakeGateway.stake:type_name -> cosmos.base.v1beta1.Coin - 8, // 2: poktroll.gateway.MsgUpdateParamResponse.params:type_name -> poktroll.gateway.Params - 0, // 3: poktroll.gateway.Msg.UpdateParams:input_type -> poktroll.gateway.MsgUpdateParams - 2, // 4: poktroll.gateway.Msg.StakeGateway:input_type -> poktroll.gateway.MsgStakeGateway - 4, // 5: poktroll.gateway.Msg.UnstakeGateway:input_type -> poktroll.gateway.MsgUnstakeGateway - 6, // 6: poktroll.gateway.Msg.UpdateParam:input_type -> poktroll.gateway.MsgUpdateParam - 1, // 7: poktroll.gateway.Msg.UpdateParams:output_type -> poktroll.gateway.MsgUpdateParamsResponse - 3, // 8: poktroll.gateway.Msg.StakeGateway:output_type -> poktroll.gateway.MsgStakeGatewayResponse - 5, // 9: poktroll.gateway.Msg.UnstakeGateway:output_type -> poktroll.gateway.MsgUnstakeGatewayResponse - 7, // 10: poktroll.gateway.Msg.UpdateParam:output_type -> poktroll.gateway.MsgUpdateParamResponse - 7, // [7:11] is the sub-list for method output_type - 3, // [3:7] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 8, // 0: poktroll.gateway.MsgUpdateParams.params:type_name -> poktroll.gateway.Params + 9, // 1: poktroll.gateway.MsgStakeGateway.stake:type_name -> cosmos.base.v1beta1.Coin + 10, // 2: poktroll.gateway.MsgStakeGatewayResponse.gateway:type_name -> poktroll.gateway.Gateway + 8, // 3: poktroll.gateway.MsgUpdateParamResponse.params:type_name -> poktroll.gateway.Params + 0, // 4: poktroll.gateway.Msg.UpdateParams:input_type -> poktroll.gateway.MsgUpdateParams + 2, // 5: poktroll.gateway.Msg.StakeGateway:input_type -> poktroll.gateway.MsgStakeGateway + 4, // 6: poktroll.gateway.Msg.UnstakeGateway:input_type -> poktroll.gateway.MsgUnstakeGateway + 6, // 7: poktroll.gateway.Msg.UpdateParam:input_type -> poktroll.gateway.MsgUpdateParam + 1, // 8: poktroll.gateway.Msg.UpdateParams:output_type -> poktroll.gateway.MsgUpdateParamsResponse + 3, // 9: poktroll.gateway.Msg.StakeGateway:output_type -> poktroll.gateway.MsgStakeGatewayResponse + 5, // 10: poktroll.gateway.Msg.UnstakeGateway:output_type -> poktroll.gateway.MsgUnstakeGatewayResponse + 7, // 11: poktroll.gateway.Msg.UpdateParam:output_type -> poktroll.gateway.MsgUpdateParamResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_poktroll_gateway_tx_proto_init() } @@ -3940,6 +4035,7 @@ func file_poktroll_gateway_tx_proto_init() { return } file_poktroll_gateway_params_proto_init() + file_poktroll_gateway_types_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_gateway_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { diff --git a/docusaurus/docs/operate/user_guide/transfer-application.md b/docusaurus/docs/operate/user_guide/transfer-application.md new file mode 100644 index 000000000..88792c490 --- /dev/null +++ b/docusaurus/docs/operate/user_guide/transfer-application.md @@ -0,0 +1,18 @@ +--- +title: Transfer Application +sidebar_position: 6 +--- + +# Transferring an Application + +// TODO_DOCUMENT(@bryanchriswhite): + +... why would you want to do this? + +... what does it mean? + +... include diagrams from #789 comments ... + +... how do you do it? + +... gotchas & troubleshooting diff --git a/e2e/tests/init_test.go b/e2e/tests/init_test.go index 8aee69e2e..7ea4359ea 100644 --- a/e2e/tests/init_test.go +++ b/e2e/tests/init_test.go @@ -45,6 +45,8 @@ import ( const ( numQueryRetries = uint8(3) + unbondingPeriod = "unbonding" + transferPeriod = "transfer" ) var ( @@ -174,7 +176,7 @@ func (s *suite) TheUserRunsTheCommand(cmd string) { } func (s *suite) TheUserShouldBeAbleToSeeStandardOutputContaining(arg1 string) { - require.Contains(s, s.pocketd.result.Stdout, arg1) + require.Containsf(s, s.pocketd.result.Stdout, arg1, s.pocketd.result.Stderr) } func (s *suite) TheUserSendsUpoktFromAccountToAccount(amount int64, accName1, accName2 string) { @@ -317,13 +319,13 @@ func (s *suite) getConfigFileContent( ) string { var configContent string switch actorType { - case "application": + case apptypes.ModuleName: configContent = fmt.Sprintf(` stake_amount: %dupokt service_ids: - %s`, amount, serviceId) - case "supplier": + case suppliertypes.ModuleName: configContent = fmt.Sprintf(` owner_address: %s operator_address: %s @@ -344,7 +346,7 @@ func (s *suite) TheUserUnstakesAFromTheAccount(actorType string, accName string) var args []string switch actorType { - case "supplier": + case suppliertypes.ModuleName: args = []string{ "tx", actorType, @@ -372,6 +374,13 @@ func (s *suite) TheUserUnstakesAFromTheAccount(actorType string, accName string) res, err := s.pocketd.RunCommandOnHost("", args...) require.NoError(s, err, "error unstaking %s", actorType) + // Get current balance + balanceKey := accBalanceKey(accName) + currBalance := s.getAccBalance(accName) + s.scenarioState[balanceKey] = currBalance // save the balance for later + + // NB: s.pocketd.result MUST be set AFTER the balance is queried because the + // balance query sets the result first while getting the account balance. s.pocketd.result = res } @@ -409,7 +418,7 @@ func (s *suite) TheUserVerifiesTheForAccountIsNotStaked(actorType, accName strin func (s *suite) TheForAccountIsStakedWithUpokt(actorType, accName string, amount int64) { stakeAmount, ok := s.getStakedAmount(actorType, accName) require.Truef(s, ok, "account %s of type %s SHOULD be staked", accName, actorType) - require.Equalf(s, int64(stakeAmount), amount, "account %s stake amount is not %d", accName, amount) + require.Equalf(s, amount, int64(stakeAmount), "account %s stake amount is not %d", accName, amount) s.scenarioState[accStakeKey(actorType, accName)] = stakeAmount // save the stakeAmount for later } @@ -511,22 +520,53 @@ func (s *suite) TheUserWaitsForTheSupplierForAccountUnbondingPeriodToFinish(accN s.waitForBlockHeight(unbondingHeight + 1) // Add 1 to ensure the unbonding block has been committed } -func (s *suite) TheApplicationForAccountIsUnbonding(appName string) { +func (s *suite) TheApplicationForAccountIsInThePeriod(appName, periodName string) { _, ok := accNameToAppMap[appName] require.True(s, ok, "application %s not found", appName) - s.waitForTxResultEvent(newEventMsgTypeMatchFn("application", "UnstakeApplication")) + var ( + msgType string + isAppInState func(*apptypes.Application) bool + ) + switch periodName { + case unbondingPeriod: + msgType = "UnstakeApplication" + isAppInState = func(app *apptypes.Application) bool { + return app.IsUnbonding() + } + case transferPeriod: + msgType = "TransferApplication" + isAppInState = func(application *apptypes.Application) bool { + return application.HasPendingTransfer() + } + default: + s.Fatalf("unsupported period type: %q", periodName) + } + + s.waitForTxResultEvent(newEventMsgTypeMatchFn("application", msgType)) - supplier := s.getApplicationInfo(appName) - require.True(s, supplier.IsUnbonding()) + application := s.getApplicationInfo(appName) + require.True(s, isAppInState(application)) } -func (s *suite) TheUserWaitsForTheApplicationForAccountUnbondingPeriodToFinish(accName string) { +func (s *suite) TheUserWaitsForTheApplicationForAccountPeriodToFinish(accName, periodType string) { _, ok := accNameToAppMap[accName] require.True(s, ok, "application %s not found", accName) - unbondingHeight := s.getApplicationUnbondingHeight(accName) - s.waitForBlockHeight(unbondingHeight + 1) // Add 1 to ensure the unbonding block has been committed + // TODO_IMPROVE: Add an event to listen for instead. This will require + // refactoring and/or splitting of this method for each event type. + + switch periodType { + case unbondingPeriod: + unbondingHeight := s.getApplicationUnbondingHeight(accName) + s.waitForBlockHeight(unbondingHeight + 1) // Add 1 to ensure the unbonding block has been committed + case transferPeriod: + transferEndHeight := s.getApplicationTransferEndHeight(accName) + s.waitForBlockHeight(transferEndHeight + 1) // Add 1 to ensure the transfer end block has been committed + } + + // Rebuild app map after the relevant period has elapsed. + s.buildAppMap() } func (s *suite) getStakedAmount(actorType, accName string) (int, bool) { @@ -786,6 +826,28 @@ func (s *suite) getApplicationUnbondingHeight(accName string) int64 { return unbondingHeight } +// getApplicationTransferEndHeight returns the height at which the application will be transferred to the destination. +func (s *suite) getApplicationTransferEndHeight(accName string) int64 { + application := s.getApplicationInfo(accName) + require.NotNil(s, application.GetPendingTransfer()) + + args := []string{ + "query", + "shared", + "params", + "--output=json", + } + + res, err := s.pocketd.RunCommandOnHostWithRetry("", numQueryRetries, args...) + require.NoError(s, err, "error getting shared module params") + + var resp sharedtypes.QueryParamsResponse + responseBz := []byte(strings.TrimSpace(res.Stdout)) + s.cdc.MustUnmarshalJSON(responseBz, &resp) + + return apptypes.GetApplicationTransferHeight(&resp.Params, application) +} + // getServiceComputeUnitsPerRelay returns the compute units per relay for a given service ID func (s *suite) getServiceComputeUnitsPerRelay(serviceId string) uint64 { args := []string{ diff --git a/e2e/tests/session_steps_test.go b/e2e/tests/session_steps_test.go index 1d52e0d65..54b732958 100644 --- a/e2e/tests/session_steps_test.go +++ b/e2e/tests/session_steps_test.go @@ -17,7 +17,9 @@ import ( "github.com/pokt-network/poktroll/pkg/client/block" "github.com/pokt-network/poktroll/pkg/observable/channel" testutilevents "github.com/pokt-network/poktroll/testutil/events" + apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) @@ -49,7 +51,8 @@ func (s *suite) TheUserShouldWaitForTheModuleMessageToBeSubmitted(module, msgTyp // If the message type is "SubmitProof", save the supplier balance // so that next steps that assert on supplier rewards can do it without having // the proof submission fee skewing the results. - if msgType == "SubmitProof" { + switch msgType { + case "SubmitProof": supplierOperatorAddress := getMsgSubmitProofSenderAddress(event) require.NotEmpty(s, supplierOperatorAddress) @@ -59,11 +62,33 @@ func (s *suite) TheUserShouldWaitForTheModuleMessageToBeSubmitted(module, msgTyp balanceKey := accBalanceKey(supplierAccName) currBalance := s.getAccBalance(supplierAccName) s.scenarioState[balanceKey] = currBalance // save the balance for later + default: + s.Log("no test suite state to update for message type %s", msgType) + } + + // Rebuild actor maps after the relevant messages have been committed. + switch module { + case apptypes.ModuleName: + s.buildAppMap() + case suppliertypes.ModuleName: + s.buildSupplierMap() + default: + s.Log("no test suite state to update for module %s", module) } } func (s *suite) TheUserShouldWaitForTheModuleTxEventToBeBroadcast(module, eventType string) { s.waitForTxResultEvent(newEventTypeMatchFn(module, eventType)) + + // Rebuild actor maps after the relevant messages have been committed. + switch module { + case apptypes.ModuleName: + s.buildAppMap() + case suppliertypes.ModuleName: + s.buildSupplierMap() + default: + s.Log("no test suite state to update for module %s", module) + } } func (s *suite) TheUserShouldWaitForTheClaimsettledEventWithProofRequirementToBeBroadcast(proofRequirement string) { @@ -74,6 +99,10 @@ func (s *suite) TheUserShouldWaitForTheClaimsettledEventWithProofRequirementToBe newEventAttributeMatchFn("proof_requirement", fmt.Sprintf("%q", proofRequirement)), ), ) + + // Update the actor maps after end block events have been emitted. + s.buildAppMap() + s.buildSupplierMap() } // TODO_FLAKY: See how 'TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccessfullySettled' diff --git a/e2e/tests/stake_app.feature b/e2e/tests/stake_app.feature index 0ea08d7b5..eef0ee69f 100644 --- a/e2e/tests/stake_app.feature +++ b/e2e/tests/stake_app.feature @@ -20,7 +20,7 @@ Feature: Stake App Namespaces Then the user should be able to see standard output containing "txhash:" And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error - And the application for account "app2" is unbonding - When the user waits for the application for account "app2" unbonding period to finish + And the application for account "app2" is in the "unbonding" period + When the user waits for the application for account "app2" "unbonding" period to finish And the user verifies the "application" for account "app2" is not staked And the account balance of "app2" should be "1000070" uPOKT "more" than before \ No newline at end of file diff --git a/e2e/tests/stake_app_transfer.feature b/e2e/tests/stake_app_transfer.feature deleted file mode 100644 index 7f3b6de22..000000000 --- a/e2e/tests/stake_app_transfer.feature +++ /dev/null @@ -1,21 +0,0 @@ -Feature: App Stake Transfer Namespace - - Scenario: User can transfer Application stake to non-existing application address - Given the user has the pocketd binary installed - # Unstake the applications in case they're already staked. - And this test ensures the "application" for account "app2" is not staked - And this test ensures the "application" for account "app3" is not staked - # Stake with 1 uPOKT more than the current stake used in genesis to make - # the transaction succeed. - And the account "app2" has a balance greater than "1000070" uPOKT - And an account exists for "app3" - And the user successfully stakes a "application" with "1000070" uPOKT for "anvil" service from the account "app2" - When the user transfers the "application" stake from account "app2" to account "app3" - Then the user should be able to see standard output containing "txhash:" - And the user should be able to see standard output containing "code: 0" - And the pocketd binary should exit without error - And the user should wait for the "application" module "TransferApplication" message to be submitted - And the "application" for account "app3" is staked with "1000070" uPOKT - And the account balance of "app3" should be "0" uPOKT "less" than before - And the user verifies the "application" for account "app2" is not staked - And the account balance of "app2" should be "0" uPOKT "more" than before diff --git a/e2e/tests/stake_app_transfer_steps_test.go b/e2e/tests/stake_app_transfer_steps_test.go deleted file mode 100644 index 56f2281c9..000000000 --- a/e2e/tests/stake_app_transfer_steps_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build e2e - -package e2e - -import ( - "github.com/stretchr/testify/require" -) - -func (s *suite) TheUserSuccessfullyStakesAWithUpoktForServiceFromTheAccount(actorType string, amount int64, serviceId, accName string) { - s.TheUserStakesAWithUpoktForServiceFromTheAccount(actorType, amount, serviceId, accName) - s.TheUserShouldBeAbleToSeeStandardOutputContaining("txhash:") - s.TheUserShouldBeAbleToSeeStandardOutputContaining("code: 0") - s.ThePocketdBinaryShouldExitWithoutError() - s.TheUserShouldWaitForTheModuleMessageToBeSubmitted("application", "StakeApplication") - s.TheForAccountIsStakedWithUpokt(actorType, accName, amount) - s.TheAccountBalanceOfShouldBeUpoktThanBefore(accName, amount, "less") -} - -func (s *suite) TheUserTransfersTheStakeFromAccountToAccount(actorType, fromAccName, toAccName string) { - fromAddr, fromAddrIsFound := accNameToAddrMap[fromAccName] - require.Truef(s, fromAddrIsFound, "account name %s not found in accNameToAddrMap", fromAccName) - - toAddr, toAddrIsFound := accNameToAddrMap[toAccName] - require.Truef(s, toAddrIsFound, "account name %s not found in accNameToAddrMap", toAccName) - - args := []string{ - "tx", - actorType, - "transfer", - fromAddr, - toAddr, - "--from", - fromAccName, - keyRingFlag, - chainIdFlag, - "-y", - } - res, err := s.pocketd.RunCommandOnHost("", args...) - require.NoError(s, err) - - s.pocketd.result = res -} - -// This helper ensures that the actor is unstaked if it was staked when this step ran. -func (s *suite) ThisTestEnsuresTheForAccountIsNotStaked(actorType, accName string) { - if _, ok := s.getStakedAmount(actorType, accName); ok { - s.TheUserUnstakesAFromTheAccount(actorType, accName) - s.TheUserShouldBeAbleToSeeStandardOutputContaining("txhash:") - s.TheUserShouldBeAbleToSeeStandardOutputContaining("code: 0") - } -} diff --git a/makefiles/params.mk b/makefiles/params.mk index 58aeeba8f..559e0ae4d 100644 --- a/makefiles/params.mk +++ b/makefiles/params.mk @@ -93,6 +93,14 @@ params_update_shared_proof_window_open_offset_blocks: ## Update the shared modul params_update_shared_proof_window_close_offset_blocks: ## Update the shared module proof_window_close_offset_blocks param poktrolld tx authz exec ./tools/scripts/params/shared_proof_window_close_offset_blocks.json $(PARAM_FLAGS) +.PHONY: params_update_shared_supplier_unbonding_period_sessions +params_update_shared_supplier_unbonding_period_sessions: ## Update the shared module supplier_unbonding_period_sessions param + poktrolld tx authz exec ./tools/scripts/params/shared_supplier_unbonding_period_sessions.json $(PARAM_FLAGS) + +.PHONY: params_update_shared_application_unbonding_period_sessions +params_update_shared_application_unbonding_period_sessions: ## Update the shared module application_unbonding_period_sessions param + poktrolld tx authz exec ./tools/scripts/params/shared_application_unbonding_period_sessions.json $(PARAM_FLAGS) + .PHONY: params_update_shared_compute_units_to_tokens_multiplier params_update_shared_compute_units_to_tokens_multiplier: ## Update the shared module compute_units_to_tokens_multiplier param poktrolld tx authz exec ./tools/scripts/params/shared_compute_units_to_tokens_multiplier.json $(PARAM_FLAGS) diff --git a/proto/poktroll/application/event.proto b/proto/poktroll/application/event.proto index 40b2aa801..3afe76a19 100644 --- a/proto/poktroll/application/event.proto +++ b/proto/poktroll/application/event.proto @@ -7,6 +7,8 @@ option (gogoproto.stable_marshaler_all) = true; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; +import "poktroll/application/types.proto"; + // EventRedelegation is an event emitted whenever an application changes its // delegatee gateways on chain. This is in response to both a DelegateToGateway // and UndelegateFromGateway message. @@ -14,3 +16,33 @@ message EventRedelegation { string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application has changed their delegation of. } + +// EventTransferBegin is emitted whenever an application begins a transfer. It +// includes the source application state immediately after the transfer began. +message EventTransferBegin { + string source_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string destination_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + poktroll.application.Application source_application = 3; +} + +// EventTransferEnd is emitted whenever an application transfer is completed. It +// includes the destination application state at the time the transfer completed. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +message EventTransferEnd { + string source_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string destination_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + poktroll.application.Application destination_application = 3; +} + +// EventTransferError is emitted whenever an application transfer fails. It +// includes the source application state at the time the transfer failed and +// the error message. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +message EventTransferError { + string source_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string destination_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + poktroll.application.Application source_application = 3; + string error = 4; +} diff --git a/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index 73ce11d30..f28399a0c 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -58,7 +58,9 @@ message MsgStakeApplication { // repeated string gateway_addresss } -message MsgStakeApplicationResponse {} +message MsgStakeApplicationResponse { + poktroll.application.Application application = 1; +} message MsgUnstakeApplication { option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries @@ -73,7 +75,9 @@ message MsgDelegateToGateway { string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to delegate to. } -message MsgDelegateToGatewayResponse {} +message MsgDelegateToGatewayResponse { + poktroll.application.Application application = 1; +} message MsgUndelegateFromGateway { option (cosmos.msg.v1.signer) = "app_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries diff --git a/proto/poktroll/application/types.proto b/proto/poktroll/application/types.proto index 187e6610a..5752c5d19 100644 --- a/proto/poktroll/application/types.proto +++ b/proto/poktroll/application/types.proto @@ -36,6 +36,7 @@ message Application { // The end height of the session at which an application initiated its unstaking process. // If the application did not unstake, this value will be 0. uint64 unstake_session_end_height = 6; + PendingApplicationTransfer pending_transfer = 7; } // UndelegatingGatewayList is used as the Value of `pending_undelegations`. @@ -43,3 +44,10 @@ message Application { message UndelegatingGatewayList { repeated string gateway_addresses = 2 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.nullable) = false]; } + +// PendingTransfer is used to store the details of a pending transfer. +// It is only intended to be used inside of an Application object. +message PendingApplicationTransfer { + string destination_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint64 session_end_height = 2; +} diff --git a/proto/poktroll/gateway/tx.proto b/proto/poktroll/gateway/tx.proto index caf37f199..5f494c1f3 100644 --- a/proto/poktroll/gateway/tx.proto +++ b/proto/poktroll/gateway/tx.proto @@ -11,6 +11,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "poktroll/gateway/params.proto"; +import "poktroll/gateway/types.proto"; // Msg defines the Msg service. service Msg { @@ -50,7 +51,9 @@ message MsgStakeGateway { cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the gateway is staking. Must be ≥ to the current amount that the gateway has staked (if any) } -message MsgStakeGatewayResponse {} +message MsgStakeGatewayResponse { + poktroll.gateway.Gateway gateway = 1; +} message MsgUnstakeGateway { option (cosmos.msg.v1.signer) = "address"; diff --git a/tests/integration/application/application_transfer_test.go b/tests/integration/application/application_transfer_test.go new file mode 100644 index 000000000..1e3ef2b09 --- /dev/null +++ b/tests/integration/application/application_transfer_test.go @@ -0,0 +1,504 @@ +//go:build integration + +package application + +import ( + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/events" + "github.com/pokt-network/poktroll/testutil/integration/suites" + "github.com/pokt-network/poktroll/testutil/testkeyring" + apptypes "github.com/pokt-network/poktroll/x/application/types" + "github.com/pokt-network/poktroll/x/shared" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +var ( + appFundAmount = int64(100000000) + stakeAmount = int64(100) + + service1Id = "svc1" + service2Id = "svc2" + service3Id = "svc3" +) + +type appTransferTestSuite struct { + suites.ApplicationModuleSuite + gatewaySuite suites.GatewayModuleSuite + paramsSuite suites.ParamsSuite + + gateway1 string + gateway2 string + gateway3 string + gateway4 string + gateway5 string + + app1 string + app2 string + app3 string +} + +// TestAppTransferSuite runs the application transfer test suite. +func TestAppTransferSuite(t *testing.T) { + suite.Run(t, new(appTransferTestSuite)) +} + +func (s *appTransferTestSuite) SetupTest() { + // Construct a new integration app for each test. + s.NewApp(s.T()) + s.gatewaySuite.SetApp(s.GetApp()) + s.paramsSuite.SetApp(s.GetApp()) + + // Setup authz accounts and grants to enable updating params. + s.paramsSuite.SetupTestAuthzAccounts(s.T()) + s.paramsSuite.SetupTestAuthzGrants(s.T()) + + // Ensure gateways and apps have bank balances. + s.setupTestAddresses() + + // Stake gateways for applications to delegate to. + s.setupStakeGateways() + + // Stake app1 and app2. + s.setupStakeApps(map[string][]string{ + s.app1: {service1Id, service3Id}, + s.app2: {service1Id, service2Id}, + }) + + // Delegate app 1 to gateway 1 and 3 and app 2 to gateways 1 and 2. + s.setupDelegateAppsToGateway(map[string][]string{ + s.app1: {s.gateway1, s.gateway3, s.gateway4}, + s.app2: {s.gateway1, s.gateway2, s.gateway5}, + }) + + // Undelegate app 1 from gateways 3 & 4 and app 2 from gateways 3 & 5 + // in order to populate their pending undelegations. + s.setupUndelegateAppsFromGateway(map[string][]string{ + s.app1: {s.gateway1, s.gateway4}, + s.app2: {s.gateway1, s.gateway5}, + }) + + // Assert the on-chain state shows the application 3 as NOT staked. + _, queryErr := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + require.ErrorContains(s.T(), queryErr, "application not found") + require.ErrorContains(s.T(), queryErr, s.app3) +} + +func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds() { + sharedParamsAny, err := s.paramsSuite.QueryModuleParams(s.T(), sharedtypes.ModuleName) + require.NoError(s.T(), err) + + sharedParams := sharedParamsAny.(sharedtypes.Params) + sessionEndHeight := shared.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight()) + + transferBeginHeight := s.SdkCtx().BlockHeight() + + // Transfer app1 to app3 + transferRes := s.Transfer(s.T(), s.app1, s.app3) + srcApp := transferRes.GetApplication() + + // Assert application pending transfer field updated in the msg response. + pendingTransfer := srcApp.GetPendingTransfer() + require.NotNil(s.T(), pendingTransfer) + + expectedPendingTransfer := &apptypes.PendingApplicationTransfer{ + DestinationAddress: s.app3, + SessionEndHeight: uint64(sessionEndHeight), + } + require.EqualValues(s.T(), expectedPendingTransfer, pendingTransfer) + + // Query and assert application pending transfer field updated in the store. + foundApp1, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + require.NoError(s.T(), err) + require.EqualValues(s.T(), expectedPendingTransfer, foundApp1.GetPendingTransfer()) + + // Assert that the "message" type event (tx result event) is observed which + // corresponds to the MsgTransferApplication message. + msgTypeURL := cosmostypes.MsgTypeURL(&apptypes.MsgTransferApplication{}) + msgEvent := s.LatestMatchingEvent(events.NewMsgEventMatchFn(msgTypeURL)) + require.NotNil(s.T(), msgEvent, "expected transfer application message event") + + // Assert that the transfer begin event (tx result event) is observed. + s.shouldObserveTransferBeginEvent(&foundApp1, s.app3) + + // Continue until transfer end commit height - 1. + transferEndHeight := apptypes.GetApplicationTransferHeight(&sharedParams, &foundApp1) + blocksUntilTransferEndHeight := transferEndHeight - transferBeginHeight + s.GetApp().NextBlocks(s.T(), int(blocksUntilTransferEndHeight)-1) + + // Assert that app1 is in transfer period. + foundApp1, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + require.NoError(s.T(), err) + + require.Equal(s.T(), s.app1, foundApp1.GetAddress()) + require.Equal(s.T(), expectedPendingTransfer, foundApp1.GetPendingTransfer()) + + // Continue to transfer end height. + s.GetApp().NextBlock(s.T()) + + // Query for and assert that the destination application was created. + foundApp3, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + require.NoError(s.T(), err) + + // Assert that the destination application was created with the correct state. + require.Equal(s.T(), s.app3, foundApp3.GetAddress()) + require.Equal(s.T(), stakeAmount, foundApp3.GetStake().Amount.Int64()) + + // Assert that remaining delegation is transferred. + require.ElementsMatch(s.T(), []string{s.gateway3}, foundApp3.DelegateeGatewayAddresses) + + expectedApp3Undelegations := map[uint64][]string{ + uint64(sessionEndHeight): {s.gateway1, s.gateway4}, + } + for height, expectedUndelegatingGatewayList := range expectedApp3Undelegations { + undelegatingGatewayList, ok := foundApp3.GetPendingUndelegations()[height] + require.Truef(s.T(), ok, "unexpected undelegation height: %d", height) + require.Equal(s.T(), uint64(sessionEndHeight), height) + require.ElementsMatch(s.T(), expectedUndelegatingGatewayList, undelegatingGatewayList.GatewayAddresses) + } + require.Equal(s.T(), len(expectedApp3Undelegations), len(foundApp3.GetPendingUndelegations())) + + // Assert that the transfer end event (end block event) is observed. + s.shouldObserveTransferEndEvent(&foundApp3, s.app1) + + // Assert that app1 is unstaked. + _, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + require.ErrorContains(s.T(), err, "application not found") + require.ErrorContains(s.T(), err, s.app1) + + // Assert that app1's bank balance has not changed. + balanceRes, err := s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ + Address: s.app1, + Denom: volatile.DenomuPOKT, + }) + require.NoError(s.T(), err) + require.NotNil(s.T(), balanceRes) + + require.EqualValues(s.T(), + cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appFundAmount-stakeAmount), + *balanceRes.GetBalance(), + ) +} + +func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMergesSources() { + sharedParamsAny, err := s.paramsSuite.QueryModuleParams(s.T(), sharedtypes.ModuleName) + require.NoError(s.T(), err) + + sharedParams := sharedParamsAny.(sharedtypes.Params) + msgTransferAppTypeURL := cosmostypes.MsgTypeURL(&apptypes.MsgTransferApplication{}) + sessionEndHeight := shared.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight()) + + transferBeginHeight := s.SdkCtx().BlockHeight() + + // Transfer app1 & app2 to app3 in the same session (and tx). + srcToDstTransferMap := map[string]string{ + s.app1: s.app3, + s.app2: s.app3, + } + transferResps := s.MultiTransfer(s.T(), srcToDstTransferMap) + + transferResSrcIndices := []string{ + s.app1, + s.app2, + } + var ( + transferEndHeight int64 + expectedPendingTransfer *apptypes.PendingApplicationTransfer + ) + for transferResIdx, transferRes := range transferResps { + expectedSrcBech32 := transferResSrcIndices[transferResIdx] + expectedDstBech32 := srcToDstTransferMap[expectedSrcBech32] + + srcApp := transferRes.GetApplication() + + // Assert application pending transfer field updated in the msg response. + pendingTransfer := srcApp.GetPendingTransfer() + require.NotNil(s.T(), pendingTransfer) + + // Assert that the PendingApplicationTransfer fields in both transfer + // responses match the expected PendingApplicationTransfer. + if expectedPendingTransfer == nil { + expectedPendingTransfer = &apptypes.PendingApplicationTransfer{ + DestinationAddress: expectedDstBech32, + SessionEndHeight: uint64(sessionEndHeight), + } + } + require.EqualValues(s.T(), expectedPendingTransfer, pendingTransfer) + + // Query and assert application pending transfer field updated in the store. + foundSrcApp, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), expectedSrcBech32) + require.NoError(s.T(), err) + require.EqualValues(s.T(), expectedPendingTransfer, foundSrcApp.GetPendingTransfer()) + + // Assert that the "message" type event (tx result event) is observed which + // corresponds to the MsgTransferApplication message. + msgEvent := s.LatestMatchingEvent(events.NewMsgEventMatchFn(msgTransferAppTypeURL)) + require.NotNil(s.T(), msgEvent, "expected transfer application message event") + + // Assert that the transfer begin event (tx result event) is observed. + s.shouldObserveTransferBeginEvent(&foundSrcApp, expectedDstBech32) + + nextTransferEndHeight := apptypes.GetApplicationTransferHeight(&sharedParams, &foundSrcApp) + if transferEndHeight != 0 { + require.Equal(s.T(), transferEndHeight, nextTransferEndHeight) + } + transferEndHeight = nextTransferEndHeight + } + + // Assert that the "message" type event (tx result event) is observed which + // corresponds to the MsgTransferApplication message. + msgEvents := s.FilterEvents(events.NewMsgEventMatchFn(msgTransferAppTypeURL)) + require.Equal(s.T(), 2, len(msgEvents), "expected 2 application transfer message events") + + // Continue until transfer end commit height - 1. + blocksUntilTransferEndHeight := transferEndHeight - transferBeginHeight + s.GetApp().NextBlocks(s.T(), int(blocksUntilTransferEndHeight)-1) + + // Assert that app1 is in transfer period. + foundApp1, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + require.NoError(s.T(), err) + + require.Equal(s.T(), s.app1, foundApp1.GetAddress()) + require.Equal(s.T(), expectedPendingTransfer, foundApp1.GetPendingTransfer()) + + // Continue to transfer end height. + s.GetApp().NextBlock(s.T()) + + // Assert that app3 is staked with the sum amount: app1 + app2. + foundApp3, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + require.NoError(s.T(), err) + + require.Equal(s.T(), s.app3, foundApp3.GetAddress()) + require.Equal(s.T(), stakeAmount*2, foundApp3.GetStake().Amount.Int64()) + + // Assert that remaining delegations were merged. + expectedApp3Delegations := []string{ + s.gateway2, + s.gateway3, + } + require.ElementsMatch(s.T(), expectedApp3Delegations, foundApp3.GetDelegateeGatewayAddresses()) + + // Assert that pending undelegetions were merged. + expectedApp3Undelegations := map[uint64][]string{ + uint64(sessionEndHeight): {s.gateway1, s.gateway4, s.gateway5}, + } + for height, expectedUndelegatingGatewayList := range expectedApp3Undelegations { + undelegatingGatewayList, ok := foundApp3.GetPendingUndelegations()[height] + require.Truef(s.T(), ok, "missing undelegation height: %d; expected gateways: %v", height, expectedUndelegatingGatewayList) + require.Equal(s.T(), uint64(sessionEndHeight), height) + require.ElementsMatch(s.T(), expectedUndelegatingGatewayList, undelegatingGatewayList.GatewayAddresses) + } + require.Equal(s.T(), len(expectedApp3Undelegations), len(foundApp3.GetPendingUndelegations())) + + // Assert that services were merged. + expectedApp3ServiceIds := []string{ + service1Id, + service2Id, + service3Id, + } + for _, serviceId := range expectedApp3ServiceIds { + require.Contains(s.T(), + foundApp3.GetServiceConfigs(), + &sharedtypes.ApplicationServiceConfig{ + ServiceId: serviceId, + }, + ) + } + require.Equal(s.T(), len(expectedApp3ServiceIds), len(foundApp3.GetServiceConfigs())) + + // Assert that app1 is unstaked. + foundApp1, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + require.ErrorContains(s.T(), err, "application not found") + require.ErrorContains(s.T(), err, s.app1) + + // Assert that app2 is unstaked. + _, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app2) + require.ErrorContains(s.T(), err, "application not found") + require.ErrorContains(s.T(), err, s.app2) + + // Assert that app1's bank balance has not changed + balRes, err := s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ + Address: s.app1, + Denom: volatile.DenomuPOKT, + }) + require.NoError(s.T(), err) + require.Equal(s.T(), appFundAmount-stakeAmount, balRes.GetBalance().Amount.Int64()) + + // Assert that app2's bank balance has not changed + balRes, err = s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ + Address: s.app2, + Denom: volatile.DenomuPOKT, + }) + require.NoError(s.T(), err) + require.Equal(s.T(), appFundAmount-stakeAmount, balRes.GetBalance().Amount.Int64()) +} + +// TODO_TEST: +//func (s *appTransferTestSuite) TestSequentialTransfersSucceed() {} + +// TODO_TEST: Scenario: User cannot start an Application stake transfer from Application which has a pending transfer +// TODO_TEST: Scenario: The user cannot unstake an Application which has a pending transfer +// TODO_TEST: Scenario: The user can (un/re-)delegate an Application which has a pending transfer + +// setupTestAddresses sets up the required addresses for the test suite using +// pre-generated accounts. +func (s *appTransferTestSuite) setupTestAddresses() { + s.gateway1 = s.setupTestAccount().Address.String() + s.gateway2 = s.setupTestAccount().Address.String() + s.gateway3 = s.setupTestAccount().Address.String() + s.gateway4 = s.setupTestAccount().Address.String() + s.gateway5 = s.setupTestAccount().Address.String() + + s.app1 = s.setupTestAccount().Address.String() + s.app2 = s.setupTestAccount().Address.String() + s.app3 = s.setupTestAccount().Address.String() +} + +func (s *appTransferTestSuite) setupTestAccount() *testkeyring.PreGeneratedAccount { + appAccount, ok := s.GetApp().GetPreGeneratedAccounts().Next() + require.Truef(s.T(), ok, "insufficient pre-generated accounts available") + + s.FundAddress(s.T(), appAccount.Address, appFundAmount) + + return appAccount +} + +// setupStakeGateways stakes the gateways required for the test suite. +func (s *appTransferTestSuite) setupStakeGateways() { + gatewayBech32s := []string{ + s.gateway1, + s.gateway2, + s.gateway3, + s.gateway4, + s.gateway5, + } + + for _, gatewayBech32 := range gatewayBech32s { + gwStakeRes := s.gatewaySuite.StakeGateway(s.T(), gatewayBech32, stakeAmount) + require.Equal(s.T(), gatewayBech32, gwStakeRes.GetGateway().GetAddress()) + require.Equal(s.T(), stakeAmount, gwStakeRes.GetGateway().GetStake().Amount.Int64()) + } +} + +// setupStakeApps stakes the applications required for the test suite +// according to appBech32ToServiceIdsMap. +func (s *appTransferTestSuite) setupStakeApps(appBech32ToServiceIdsMap map[string][]string) { + // Stake application. + for appBech32, serviceIds := range appBech32ToServiceIdsMap { + stakeAppRes := s.StakeApp(s.T(), appBech32, stakeAmount, serviceIds) + require.Equal(s.T(), appBech32, stakeAppRes.GetApplication().GetAddress()) + require.Equal(s.T(), stakeAmount, stakeAppRes.GetApplication().GetStake().Amount.Int64()) + + // Assert the on-chain state shows the application as staked. + foundApp, queryErr := s.GetAppQueryClient().GetApplication(s.SdkCtx(), appBech32) + require.NoError(s.T(), queryErr) + require.Equal(s.T(), appBech32, foundApp.GetAddress()) + require.Equal(s.T(), stakeAmount, foundApp.GetStake().Amount.Int64()) + } +} + +// setupDelegateAppsToGateway delegates the applications (keys) to the gateways +// (values) specified in appBech32ToServiceIdsMap. +func (s *appTransferTestSuite) setupDelegateAppsToGateway(appBech32ToGatewayBech32sMap map[string][]string) { + delegateResps := s.DelegateAppsToGateways(s.T(), appBech32ToGatewayBech32sMap) + for _, delegateRes := range delegateResps { + require.NotNil(s.T(), delegateRes) + require.NotNil(s.T(), delegateRes.GetApplication()) + require.NotEmpty(s.T(), delegateRes.GetApplication().GetDelegateeGatewayAddresses()) + } +} + +// setupUndelegateAppsFromGateway undelegates the applications (keys) from the +// gateways (values) specified in appBech32ToServiceIdsMap. +func (s *appTransferTestSuite) setupUndelegateAppsFromGateway(appBech32ToGetwayBech32sMap map[string][]string) { + undelegateResps := s.UndelegateAppsFromGateways(s.T(), appBech32ToGetwayBech32sMap) + for _, undelegateRes := range undelegateResps { + require.NotNil(s.T(), undelegateRes) + // TODO_TECHDEBT(#663): Uncomment the following lines once + // MsgUndelegateToGatewayResponse has contents: + // require.NotNil(s.T(), undelegateRes.GetApplication()) + // require.Empty(s.T(), undelegateRes.GetApplication().GetDelegateeGatewayAddresses()) + } +} + +// shouldObserveTransferBeginEvent asserts that the transfer begin event from +// expectedSrcApp to expectedDstAppBech32 is observed. +func (s *appTransferTestSuite) shouldObserveTransferBeginEvent( + expectedSrcApp *apptypes.Application, + expectedDstAppBech32 string, +) { + eventTypeURL := cosmostypes.MsgTypeURL(&apptypes.EventTransferBegin{}) + isTransferBeginEventFn := events.NewEventTypeMatchFn(eventTypeURL) + targetTransferBeginEvent := s.LatestMatchingEvent(func(event *cosmostypes.Event) bool { + if !isTransferBeginEventFn(event) { + return false + } + + eventSrcAddr, hasSrcAddr := events.GetAttributeValue(event, "source_address") + require.True(s.T(), hasSrcAddr) + + return eventSrcAddr == expectedSrcApp.GetAddress() + }) + require.NotEmpty(s.T(), targetTransferBeginEvent) + + evtSrcAddr, hasSrcAddr := events.GetAttributeValue(targetTransferBeginEvent, "source_address") + require.True(s.T(), hasSrcAddr) + require.Equal(s.T(), expectedSrcApp.GetAddress(), evtSrcAddr) + + evtDstAddr, hasDstAddr := events.GetAttributeValue(targetTransferBeginEvent, "destination_address") + require.True(s.T(), hasDstAddr) + require.Equal(s.T(), expectedDstAppBech32, evtDstAddr) + + evtSrcApp := new(apptypes.Application) + evtSrcAppStr, hasSrcApp := events.GetAttributeValue(targetTransferBeginEvent, "source_application") + require.True(s.T(), hasSrcApp) + + evtSrcAppBz := []byte(evtSrcAppStr) + err := s.GetApp().GetCodec().UnmarshalJSON(evtSrcAppBz, evtSrcApp) + require.NoError(s.T(), err) + require.EqualValues(s.T(), expectedSrcApp.GetPendingTransfer(), evtSrcApp.GetPendingTransfer()) +} + +// shouldObserveTransferEndEvent asserts that the transfer end event from +// expectedSrcAppBech32 to expectedDstApp is observed. +func (s *appTransferTestSuite) shouldObserveTransferEndEvent( + expectedDstApp *apptypes.Application, + expectedSrcAppBech32 string, +) { + eventTypeURL := cosmostypes.MsgTypeURL(&apptypes.EventTransferEnd{}) + isTransferEndEventFn := events.NewEventTypeMatchFn(eventTypeURL) + targetTransferEndEvent := s.LatestMatchingEvent(func(event *cosmostypes.Event) bool { + if !isTransferEndEventFn(event) { + return false + } + + eventSrcAddr, hasSrcAddr := events.GetAttributeValue(event, "source_address") + require.True(s.T(), hasSrcAddr) + + return eventSrcAddr == expectedDstApp.GetAddress() + }) + require.NotNil(s.T(), targetTransferEndEvent) + + evtSrcAddr, hasSrcAddrAttr := events.GetAttributeValue(targetTransferEndEvent, "source_address") + require.True(s.T(), hasSrcAddrAttr) + require.Equal(s.T(), expectedSrcAppBech32, evtSrcAddr) + + evtDstAddr, hasDstAddrAttr := events.GetAttributeValue(targetTransferEndEvent, "destination_address") + require.True(s.T(), hasDstAddrAttr) + require.Equal(s.T(), expectedDstApp.GetAddress(), evtDstAddr) + + evtDstApp := new(apptypes.Application) + evtDstAppStr, hasDstAppAttr := events.GetAttributeValue(targetTransferEndEvent, "destination_application") + require.True(s.T(), hasDstAppAttr) + + evtDstAppBz := []byte(evtDstAppStr) + err := s.GetApp().GetCodec().UnmarshalJSON(evtDstAppBz, evtDstApp) + require.NoError(s.T(), err) + require.EqualValues(s.T(), expectedDstApp.GetPendingTransfer(), evtDstApp.GetPendingTransfer()) +} diff --git a/tests/integration/params/update_param_test.go b/tests/integration/params/update_param_test.go index 0f1ffccfd..3110ddcf2 100644 --- a/tests/integration/params/update_param_test.go +++ b/tests/integration/params/update_param_test.go @@ -13,28 +13,28 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) -// msgUpdateParamSuite is a test suite which exercises the MsgUpdateParam message +// msgUpdateParamTestSuite is a test suite which exercises the MsgUpdateParam message // for each poktroll module via authz, as would be done in a live network in order // to update **individual** parameter values for a given module. // NB: Not to be confused with MsgUpdateParams (plural), which updates all parameter // values for a module. -type msgUpdateParamSuite struct { +type msgUpdateParamTestSuite struct { suites.ParamsSuite unauthorizedAddr cosmostypes.AccAddress } func TestUpdateParamSuite(t *testing.T) { - suite.Run(t, new(msgUpdateParamSuite)) + suite.Run(t, new(msgUpdateParamTestSuite)) } -func (s *msgUpdateParamSuite) SetupSubTest() { +func (s *msgUpdateParamTestSuite) SetupSubTest() { // Create a fresh integration app for each test. s.NewApp(s.T()) // Initialize the test accounts and create authz grants. - s.SetupTestAuthzAccounts() - s.SetupTestAuthzGrants() + s.SetupTestAuthzAccounts(s.T()) + s.SetupTestAuthzGrants(s.T()) // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() @@ -42,7 +42,7 @@ func (s *msgUpdateParamSuite) SetupSubTest() { s.unauthorizedAddr = nextAcct.Address } -func (s *msgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { +func (s *msgUpdateParamTestSuite) TestUnauthorizedMsgUpdateParamFails() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { moduleCfg := suites.ModuleParamConfigMap[moduleName] @@ -76,7 +76,7 @@ func (s *msgUpdateParamSuite) TestUnauthorizedMsgUpdateParamFails() { } } -func (s *msgUpdateParamSuite) TestAuthorizedMsgUpdateParamSucceeds() { +func (s *msgUpdateParamTestSuite) TestAuthorizedMsgUpdateParamSucceeds() { for _, moduleName := range suites.MsgUpdateParamEnabledModuleNames { moduleCfg := suites.ModuleParamConfigMap[moduleName] diff --git a/tests/integration/params/update_params_test.go b/tests/integration/params/update_params_test.go index f8d803b50..26508eceb 100644 --- a/tests/integration/params/update_params_test.go +++ b/tests/integration/params/update_params_test.go @@ -12,12 +12,12 @@ import ( "github.com/pokt-network/poktroll/testutil/integration/suites" ) -// msgUpdateParamsSuite is a test suite which exercises the MsgUpdateParams message +// msgUpdateParamsTestSuite is a test suite which exercises the MsgUpdateParams message // for each poktroll module via authz, as would be done in a live network in order // to update **all** parameter values for a given module. // NB: Not to be confused with MsgUpdateParam (singular), which updates a single // parameter value for a module. -type msgUpdateParamsSuite struct { +type msgUpdateParamsTestSuite struct { suites.ParamsSuite unauthorizedAddr cosmostypes.AccAddress @@ -29,16 +29,16 @@ type msgUpdateParamsSuite struct { // reflection to construct the messages and make assertions about the results to // improve maintainability and reduce boilerplate. func TestUpdateParamsSuite(t *testing.T) { - suite.Run(t, &msgUpdateParamsSuite{}) + suite.Run(t, &msgUpdateParamsTestSuite{}) } -func (s *msgUpdateParamsSuite) SetupTest() { +func (s *msgUpdateParamsTestSuite) SetupTest() { // Create a fresh integration app for each test. s.NewApp(s.T()) // Initialize the test accounts and create authz grants. - s.SetupTestAuthzAccounts() - s.SetupTestAuthzGrants() + s.SetupTestAuthzAccounts(s.T()) + s.SetupTestAuthzGrants(s.T()) // Allocate an address for unauthorized user. nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() @@ -46,7 +46,7 @@ func (s *msgUpdateParamsSuite) SetupTest() { s.unauthorizedAddr = nextAcct.Address } -func (s *msgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { +func (s *msgUpdateParamsTestSuite) TestUnauthorizedMsgUpdateParamsFails() { for _, moduleName := range s.GetPoktrollModuleNames() { moduleCfg := suites.ModuleParamConfigMap[moduleName] @@ -69,7 +69,7 @@ func (s *msgUpdateParamsSuite) TestUnauthorizedMsgUpdateParamsFails() { } } -func (s *msgUpdateParamsSuite) TestAuthorizedMsgUpdateParamsSucceeds() { +func (s *msgUpdateParamsTestSuite) TestAuthorizedMsgUpdateParamsSucceeds() { for _, moduleName := range s.GetPoktrollModuleNames() { moduleCfg := suites.ModuleParamConfigMap[moduleName] diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index b37ef1e17..9cf1d21a6 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -34,8 +34,8 @@ type RelayMiningIntegrationTestSuite struct { func (s *RelayMiningIntegrationTestSuite) SetupTest() { // Construct a fresh integration app for each test. s.NewApp(s.T()) - s.SetupTestAuthzAccounts() - s.SetupTestAuthzGrants() + s.SetupTestAuthzAccounts(s.T()) + s.SetupTestAuthzGrants(s.T()) } func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { diff --git a/testutil/events/filter.go b/testutil/events/filter.go index e2e4561bd..6c464c79e 100644 --- a/testutil/events/filter.go +++ b/testutil/events/filter.go @@ -20,7 +20,7 @@ func FilterEvents[T proto.Message]( t.Helper() for _, event := range allEvents.ToABCIEvents() { - if event.Type != protoType { + if event.Type != strings.Trim(protoType, "/") { continue } QuoteEventMode(&event) diff --git a/testutil/integration/suites/application.go b/testutil/integration/suites/application.go new file mode 100644 index 000000000..aa2537196 --- /dev/null +++ b/testutil/integration/suites/application.go @@ -0,0 +1,202 @@ +//go:build integration + +package suites + +import ( + "testing" + + "cosmossdk.io/depinject" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/pkg/client/query" + apptypes "github.com/pokt-network/poktroll/x/application/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +var _ IntegrationSuite = (*ApplicationModuleSuite)(nil) + +// ApplicationModuleSuite is a test suite which abstracts common application module +// functionality. It is intended to be embedded in dependent integration test suites. +type ApplicationModuleSuite struct { + BaseIntegrationSuite +} + +// GetAppQueryClient constructs and returns a query client for the application +// module of the integration app. +func (s *ApplicationModuleSuite) GetAppQueryClient() client.ApplicationQueryClient { + deps := depinject.Supply(s.GetApp().QueryHelper()) + appQueryClient, err := query.NewApplicationQuerier(deps) + require.NoError(s.T(), err) + + return appQueryClient +} + +// StakeApp sends a MsgStakeApplication with the given bech32 address, +// stake amount, and service IDs. +func (s *ApplicationModuleSuite) StakeApp( + t *testing.T, + bech32 string, + stakeAmtUpokt int64, + serviceIds []string, +) *apptypes.MsgStakeApplicationResponse { + t.Helper() + + serviceConfigs := make([]*sharedtypes.ApplicationServiceConfig, len(serviceIds)) + for serviceIdx, serviceId := range serviceIds { + serviceConfigs[serviceIdx] = &sharedtypes.ApplicationServiceConfig{ServiceId: serviceId} + } + + stakeAppMsg := apptypes.NewMsgStakeApplication( + bech32, + cosmostypes.NewInt64Coin(volatile.DenomuPOKT, stakeAmtUpokt), + serviceConfigs, + ) + + txMsgRes, err := s.GetApp().RunMsg(t, stakeAppMsg) + require.NoError(t, err) + + return txMsgRes.(*apptypes.MsgStakeApplicationResponse) +} + +// Transfer sends a MsgApplicationTransfer to begin an application transfer +// from srcBech32 to dstBech32. +func (s *ApplicationModuleSuite) Transfer( + t *testing.T, + srcBech32, dstBech32 string, +) *apptypes.MsgTransferApplicationResponse { + t.Helper() + + msgTransferApp := &apptypes.MsgTransferApplication{ + SourceAddress: srcBech32, + DestinationAddress: dstBech32, + } + + txMsgRes, err := s.GetApp().RunMsg(t, msgTransferApp) + require.NoError(t, err) + + return txMsgRes.(*apptypes.MsgTransferApplicationResponse) +} + +// MultiTransfer sends multiple MsgTransferApplication messages to transfer +// applications from the source to the destination addresses specified in the +// srcToDstBech32Map. All transfer messages are included in a single transaction. +func (s *ApplicationModuleSuite) MultiTransfer( + t *testing.T, + srcToDstBech32Map map[string]string, +) (transferResps []*apptypes.MsgTransferApplicationResponse) { + t.Helper() + + var msgs []cosmostypes.Msg + for srcBech32, dstBech32 := range srcToDstBech32Map { + msgs = append(msgs, &apptypes.MsgTransferApplication{ + SourceAddress: srcBech32, + DestinationAddress: dstBech32, + }) + } + + txMsgResps, err := s.GetApp().RunMsgs(t, msgs...) + require.NoError(t, err) + + for _, txMsgRes := range txMsgResps { + transferRes, ok := txMsgRes.(*apptypes.MsgTransferApplicationResponse) + require.Truef(t, ok, "unexpected txMsgRes type: %T", txMsgRes) + transferResps = append(transferResps, transferRes) + } + + return transferResps +} + +// DelegateAppToGateway sends a MsgDelegateToGateway to delegate the application +// with the given bech32 address to the gateway with the given bech32 address. +func (s *ApplicationModuleSuite) DelegateAppToGateway( + t *testing.T, + appBech32, gatewayBech32 string, +) *apptypes.MsgDelegateToGatewayResponse { + t.Helper() + + delegateAppToGatewayMsg := apptypes.NewMsgDelegateToGateway(appBech32, gatewayBech32) + txMsgRes, err := s.GetApp().RunMsg(t, delegateAppToGatewayMsg) + require.NoError(t, err) + + return txMsgRes.(*apptypes.MsgDelegateToGatewayResponse) +} + +// DelegateAppsToGateways sends multiple MsgDelegateToGateway messages to delegate +// applications to gateways. The applications and gateways are specified in the +// appToGatewayBech32Map. All delegate messages are included in a single transaction. +func (s *ApplicationModuleSuite) DelegateAppsToGateways( + t *testing.T, + appToGatewayBech32Map map[string][]string, +) (delegateResps []*apptypes.MsgDelegateToGatewayResponse) { + t.Helper() + + var delegateAppToGatewayMsgs []cosmostypes.Msg + for appBech32, gatewayBech32s := range appToGatewayBech32Map { + for _, gatewayBech32 := range gatewayBech32s { + delegateAppToGatewayMsgs = append( + delegateAppToGatewayMsgs, + apptypes.NewMsgDelegateToGateway(appBech32, gatewayBech32), + ) + } + } + + txMsgResps, err := s.GetApp().RunMsgs(t, delegateAppToGatewayMsgs...) + require.NoError(t, err) + + for _, txMsgRes := range txMsgResps { + delegateRes, ok := txMsgRes.(*apptypes.MsgDelegateToGatewayResponse) + require.Truef(t, ok, "unexpected txMsgRes type: %T", txMsgRes) + delegateResps = append(delegateResps, delegateRes) + } + + return delegateResps +} + +// UndelegateAppFromGateway sends a MsgUndelegateFromGateway to undelegate the +// application with address appBech32 from the gateway with address gatewayBech32. +func (s *ApplicationModuleSuite) UndelegateAppFromGateway( + t *testing.T, + appBech32, gatewayBech32 string, +) *apptypes.MsgUndelegateFromGatewayResponse { + t.Helper() + + undelegateAppFromGatewayMsg := apptypes.NewMsgUndelegateFromGateway(appBech32, gatewayBech32) + txMsgRes, err := s.GetApp().RunMsg(t, undelegateAppFromGatewayMsg) + require.NoError(t, err) + + return txMsgRes.(*apptypes.MsgUndelegateFromGatewayResponse) +} + +// UndelegateAppsFromGateways sends multiple MsgUndelegateFromGateway messages to +// undelegate applications from gateways. The applications and gateways are specified +// in the appToGatewayBech32Map. All undelegate messages are included in a single transaction. +func (s *ApplicationModuleSuite) UndelegateAppsFromGateways( + t *testing.T, + appToGatewayBech32Map map[string][]string, +) (undelegateResps []*apptypes.MsgUndelegateFromGatewayResponse) { + t.Helper() + + var undelegateAppFromGatewayMsgs []cosmostypes.Msg + for appBech32, gatewayBech32s := range appToGatewayBech32Map { + for _, gatewayBech32 := range gatewayBech32s { + undelegateAppFromGatewayMsgs = append( + undelegateAppFromGatewayMsgs, + apptypes.NewMsgUndelegateFromGateway(appBech32, gatewayBech32), + ) + } + } + + txMsgResps, err := s.GetApp().RunMsgs(t, undelegateAppFromGatewayMsgs...) + require.NoError(t, err) + + for _, txMsgRes := range txMsgResps { + undelegateRes, ok := txMsgRes.(*apptypes.MsgUndelegateFromGatewayResponse) + require.Truef(t, ok, "unexpected txMsgRes type: %T", txMsgRes) + undelegateResps = append(undelegateResps, undelegateRes) + } + + return undelegateResps +} diff --git a/testutil/integration/suites/authz.go b/testutil/integration/suites/authz.go index a3363219e..62b44c89a 100644 --- a/testutil/integration/suites/authz.go +++ b/testutil/integration/suites/authz.go @@ -78,7 +78,7 @@ func (s *AuthzIntegrationSuite) RunAuthzGrantMsg( grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &defaultAuthzGrantExpiration) require.NoError(t, err) - grantResAny, err := s.app.RunMsg(s.T(), grantMsg) + grantResAny, err := s.app.RunMsg(t, grantMsg) require.NoError(t, err) require.NotNil(t, grantResAny) } @@ -93,7 +93,7 @@ func (s *AuthzIntegrationSuite) RunAuthzExecMsg( t.Helper() execMsg := authz.NewMsgExec(signerAddr, msgs) - execResAny, err := s.GetApp().RunMsg(s.T(), &execMsg) + execResAny, err := s.GetApp().RunMsg(t, &execMsg) if err != nil { return nil, err } diff --git a/testutil/integration/suites/gateway.go b/testutil/integration/suites/gateway.go new file mode 100644 index 000000000..22845a44f --- /dev/null +++ b/testutil/integration/suites/gateway.go @@ -0,0 +1,37 @@ +//go:build integration + +package suites + +import ( + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" +) + +var _ IntegrationSuite = (*GatewayModuleSuite)(nil) + +type GatewayModuleSuite struct { + BaseIntegrationSuite +} + +func (s *GatewayModuleSuite) StakeGateway( + t *testing.T, + bech32 string, + stakeAmtUpokt int64, +) *gatewaytypes.MsgStakeGatewayResponse { + t.Helper() + + stakeGatewayMsg := gatewaytypes.NewMsgStakeGateway( + bech32, + cosmostypes.NewInt64Coin(volatile.DenomuPOKT, stakeAmtUpokt), + ) + + txMsgRes, err := s.GetApp().RunMsg(t, stakeGatewayMsg) + require.NoError(t, err) + + return txMsgRes.(*gatewaytypes.MsgStakeGatewayResponse) +} diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index 243c3f3a2..8841a7e6f 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -141,21 +141,25 @@ func NewMsgUpdateParams( // from the integration app. It also assigns a new pre-generated identity to be used // as the AuthorizedAddr for the suite. It is expected to be called after s.NewApp() // as it depends on the integration app and its pre-generated account iterator. -func (s *ParamsSuite) SetupTestAuthzAccounts() { +func (s *ParamsSuite) SetupTestAuthzAccounts(t *testing.T) { + t.Helper() + // Set the authority, authorized, and unauthorized addresses. s.AuthorityAddr = cosmostypes.MustAccAddressFromBech32(s.GetApp().GetAuthority()) nextAcct, ok := s.GetApp().GetPreGeneratedAccounts().Next() - require.True(s.T(), ok, "insufficient pre-generated accounts available") + require.True(t, ok, "insufficient pre-generated accounts available") s.AuthorizedAddr = nextAcct.Address } // SetupTestAuthzGrants creates on-chain authz grants for the MsgUpdateUpdateParam and // MsgUpdateParams message for each module. It is expected to be called after s.NewApp() // as it depends on the authority and authorized addresses having been set. -func (s *ParamsSuite) SetupTestAuthzGrants() { +func (s *ParamsSuite) SetupTestAuthzGrants(t *testing.T) { + t.Helper() + // Create authz grants for all poktroll modules' MsgUpdateParams messages. - s.RunAuthzGrantMsgForPoktrollModules(s.T(), + s.RunAuthzGrantMsgForPoktrollModules(t, s.AuthorityAddr, s.AuthorizedAddr, MsgUpdateParamsName, @@ -163,7 +167,7 @@ func (s *ParamsSuite) SetupTestAuthzGrants() { ) // Create authz grants for all poktroll modules' MsgUpdateParam messages. - s.RunAuthzGrantMsgForPoktrollModules(s.T(), + s.RunAuthzGrantMsgForPoktrollModules(t, s.AuthorityAddr, s.AuthorizedAddr, MsgUpdateParamName, diff --git a/testutil/testkeyring/accounts.go b/testutil/testkeyring/accounts.go index 9769f3469..af0db469e 100644 --- a/testutil/testkeyring/accounts.go +++ b/testutil/testkeyring/accounts.go @@ -117,6 +117,14 @@ func (iter *PreGeneratedAccountIterator) Next() (_ *PreGeneratedAccount, ok bool return iter.accounts[currentIndex], true } +func (iter *PreGeneratedAccountIterator) MustNext() *PreGeneratedAccount { + account, ok := iter.Next() + if !ok { + panic("insufficient number of pre-generated accounts") + } + return account +} + // Clone returns a new PreGeneratedAccountIterator with the same accounts as the // receiver but with its nextIndex reset to 0. func (iter *PreGeneratedAccountIterator) Clone() *PreGeneratedAccountIterator { diff --git a/tools/scripts/params/shared_application_unbonding_period_sessions.json b/tools/scripts/params/shared_application_unbonding_period_sessions.json new file mode 100644 index 000000000..cd62a759c --- /dev/null +++ b/tools/scripts/params/shared_application_unbonding_period_sessions.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.shared.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "application_unbonding_period_sessions", + "as_int64": "4" + } + ] + } +} diff --git a/tools/scripts/params/shared_supplier_unbonding_period_sessions.json b/tools/scripts/params/shared_supplier_unbonding_period_sessions.json new file mode 100644 index 000000000..99c5a4d3f --- /dev/null +++ b/tools/scripts/params/shared_supplier_unbonding_period_sessions.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.shared.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "supplier_unbonding_period_sessions", + "as_int64": "4" + } + ] + } +} diff --git a/x/application/keeper/msg_server_delegate_to_gateway.go b/x/application/keeper/msg_server_delegate_to_gateway.go index fd72854b5..7c4a668fc 100644 --- a/x/application/keeper/msg_server_delegate_to_gateway.go +++ b/x/application/keeper/msg_server_delegate_to_gateway.go @@ -74,5 +74,7 @@ func (k msgServer) DelegateToGateway(ctx context.Context, msg *types.MsgDelegate } isSuccessful = true - return &types.MsgDelegateToGatewayResponse{}, nil + return &types.MsgDelegateToGatewayResponse{ + Application: &app, + }, nil } diff --git a/x/application/keeper/msg_server_stake_application.go b/x/application/keeper/msg_server_stake_application.go index a5a778da7..769f0aa42 100644 --- a/x/application/keeper/msg_server_stake_application.go +++ b/x/application/keeper/msg_server_stake_application.go @@ -78,7 +78,10 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl logger.Info(fmt.Sprintf("Successfully updated application stake for app: %+v", foundApp)) isSuccessful = true - return &types.MsgStakeApplicationResponse{}, nil + + return &types.MsgStakeApplicationResponse{ + Application: &foundApp, + }, nil } func (k msgServer) createApplication( diff --git a/x/application/keeper/msg_server_transfer_application.go b/x/application/keeper/msg_server_transfer_application.go new file mode 100644 index 000000000..664ff86c2 --- /dev/null +++ b/x/application/keeper/msg_server_transfer_application.go @@ -0,0 +1,85 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/telemetry" + "github.com/pokt-network/poktroll/x/application/types" +) + +// TransferApplication transfers the stake (held in escrow in the application +// module account) from a source to a (new) destination application account . +func (k msgServer) TransferApplication(ctx context.Context, msg *types.MsgTransferApplication) (*types.MsgTransferApplicationResponse, error) { + isSuccessful := false + defer telemetry.EventSuccessCounter( + "transfer_application_begin", + telemetry.DefaultCounterFn, + func() bool { return isSuccessful }, + ) + + logger := k.Logger().With("method", "TransferApplication") + + if err := msg.ValidateBasic(); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + // Ensure destination application does not already exist. + _, isDstFound := k.GetApplication(ctx, msg.GetDestinationAddress()) + if isDstFound { + return nil, status.Error( + codes.FailedPrecondition, + types.ErrAppDuplicateAddress.Wrapf("destination application (%s) exists", msg.GetDestinationAddress()).Error(), + ) + } + + // Ensure source application exists. + srcApp, isAppFound := k.GetApplication(ctx, msg.GetSourceAddress()) + if !isAppFound { + return nil, status.Error( + codes.InvalidArgument, + types.ErrAppNotFound.Wrapf("source application (%s) not found", msg.GetSourceAddress()).Error(), + ) + } + + // Ensure source application is not already unbonding. + if srcApp.IsUnbonding() { + return nil, status.Error( + codes.FailedPrecondition, + types.ErrAppIsUnstaking.Wrapf("cannot transfer stake of unbonding source application %q", msg.GetSourceAddress()).Error(), + ) + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + sessionEndHeight := k.sharedKeeper.GetSessionEndHeight(ctx, sdkCtx.BlockHeight()) + + srcApp.PendingTransfer = &types.PendingApplicationTransfer{ + DestinationAddress: msg.GetDestinationAddress(), + SessionEndHeight: uint64(sessionEndHeight), + } + + // Update the srcApp in the store + k.SetApplication(ctx, srcApp) + logger.Info(fmt.Sprintf( + "Successfully began transfer of application stake from (%s) to (%s)", + srcApp.Address, msg.GetDestinationAddress(), + )) + + if err := sdkCtx.EventManager().EmitTypedEvent(&types.EventTransferBegin{ + SourceAddress: srcApp.GetAddress(), + DestinationAddress: srcApp.GetPendingTransfer().GetDestinationAddress(), + SourceApplication: &srcApp, + }); err != nil { + logger.Error(fmt.Sprintf("could not emit transfer begin event: %v", err)) + } + + isSuccessful = true + + return &types.MsgTransferApplicationResponse{ + Application: &srcApp, + }, nil +} diff --git a/x/application/keeper/msg_server_transfer_application_stake.go b/x/application/keeper/msg_server_transfer_application_stake.go deleted file mode 100644 index b7292f786..000000000 --- a/x/application/keeper/msg_server_transfer_application_stake.go +++ /dev/null @@ -1,68 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - "github.com/pokt-network/poktroll/telemetry" - "github.com/pokt-network/poktroll/x/application/types" -) - -// TransferApplication transfers the stake (held in escrow in the application -// module account) from a source to a (new) destination application account . -func (k msgServer) TransferApplication(ctx context.Context, msg *types.MsgTransferApplication) (*types.MsgTransferApplicationResponse, error) { - isSuccessful := false - defer telemetry.EventSuccessCounter( - "transfer_application_stake", - telemetry.DefaultCounterFn, - func() bool { return isSuccessful }, - ) - - logger := k.Logger().With("method", "TransferApplication") - - if err := msg.ValidateBasic(); err != nil { - return nil, err - } - - // Ensure destination application does not already exist. - _, isDstFound := k.GetApplication(ctx, msg.GetDestinationAddress()) - if isDstFound { - return nil, types.ErrAppDuplicateAddress.Wrapf("destination application (%q) exists", msg.GetDestinationAddress()) - } - - // Ensure source application exists. - srcApp, isAppFound := k.GetApplication(ctx, msg.GetSourceAddress()) - if !isAppFound { - return nil, types.ErrAppNotFound.Wrapf("source application %q not found", msg.GetSourceAddress()) - } - - // Ensure source application is not already unbonding. - // TODO_TEST: Add E2E coverage to assert that an unbonding app cannot be transferred. - if srcApp.IsUnbonding() { - return nil, types.ErrAppIsUnstaking.Wrapf("cannot transfer stake of unbonding source application %q", msg.GetSourceAddress()) - } - - // Create a new application derived from the source application. - dstApp := srcApp - dstApp.Address = msg.GetDestinationAddress() - - // TODO_NEXT(#789): Reconcile app unbonding logic with the new transfer stake logic. - // I.e., the source should not immediately be transferred. - - // TODO_TEST: add E2E coverage to assert #DelegateeGatewayAddresses and #PendingUndelegations - // are present and correct on the dstApp application. - - // Update the dstApp in the store - k.SetApplication(ctx, dstApp) - logger.Info(fmt.Sprintf("Successfully transferred application stake from (%s) to (%s)", srcApp.Address, dstApp.Address)) - - // Remove the transferred app from the store - k.RemoveApplication(ctx, srcApp.GetAddress()) - logger.Info(fmt.Sprintf("Successfully removed the application: %+v", srcApp)) - - isSuccessful = true - - return &types.MsgTransferApplicationResponse{ - Application: &srcApp, - }, nil -} diff --git a/x/application/keeper/msg_server_transfer_application_stake_test.go b/x/application/keeper/msg_server_transfer_application_stake_test.go deleted file mode 100644 index b3b47bf3b..000000000 --- a/x/application/keeper/msg_server_transfer_application_stake_test.go +++ /dev/null @@ -1,136 +0,0 @@ -package keeper_test - -import ( - "testing" - - "cosmossdk.io/math" - cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/testutil/sample" - appkeeper "github.com/pokt-network/poktroll/x/application/keeper" - apptypes "github.com/pokt-network/poktroll/x/application/types" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" -) - -func TestMsgServer_TransferApplication_Success(t *testing.T) { - k, ctx := keepertest.ApplicationKeeper(t) - srv := appkeeper.NewMsgServerImpl(k) - - // Generate an address for the source and destination applications. - srcAddr := sample.AccAddress() - dstAddr := sample.AccAddress() - - // Verify that the app does not exist yet. - _, isSrcFound := k.GetApplication(ctx, srcAddr) - require.False(t, isSrcFound) - - expectedAppStake := &cosmostypes.Coin{Denom: "upokt", Amount: math.NewInt(100)} - - // Prepare the application. - stakeMsg := &apptypes.MsgStakeApplication{ - Address: srcAddr, - Stake: expectedAppStake, - Services: []*sharedtypes.ApplicationServiceConfig{ - { - ServiceId: "svc1", - }, - }, - } - - // Stake the application. - _, err := srv.StakeApplication(ctx, stakeMsg) - require.NoError(t, err) - - // Verify that the application exists. - srcApp, isSrcFound := k.GetApplication(ctx, srcAddr) - require.True(t, isSrcFound) - require.Equal(t, srcAddr, srcApp.Address) - require.Equal(t, expectedAppStake, srcApp.Stake) - require.Len(t, srcApp.ServiceConfigs, 1) - require.Equal(t, "svc1", srcApp.ServiceConfigs[0].ServiceId) - - // Transfer the application stake from the source to the destination application address. - transferStakeMsg := apptypes.NewMsgTransferApplication(srcAddr, dstAddr) - - transferAppStakeRes, stakeTransferErr := srv.TransferApplication(ctx, transferStakeMsg) - require.NoError(t, stakeTransferErr) - - // Verify that the destination app was created with the correct state. - dstApp, isDstFound := k.GetApplication(ctx, dstAddr) - require.True(t, isDstFound) - require.Equal(t, dstAddr, dstApp.Address) - require.Equal(t, expectedAppStake, dstApp.Stake) - require.Len(t, dstApp.ServiceConfigs, 1) - require.EqualValues(t, &srcApp, transferAppStakeRes.Application) - - srcApp.Address = "" - dstApp.Address = "" - require.EqualValues(t, srcApp, dstApp) - - // Verify that the source app was unstaked. - srcApp, isSrcFound = k.GetApplication(ctx, srcAddr) - require.False(t, isSrcFound) -} - -func TestMsgServer_TransferApplication_Error_DestinationExists(t *testing.T) { - k, ctx := keepertest.ApplicationKeeper(t) - srv := appkeeper.NewMsgServerImpl(k) - - // Generate an address for the source and destination applications. - srcAddr := sample.AccAddress() - dstAddr := sample.AccAddress() - - // Verify that neither the source nor the destination application exists yet. - _, isSrcFound := k.GetApplication(ctx, srcAddr) - require.False(t, isSrcFound) - - _, isDstFound := k.GetApplication(ctx, dstAddr) - require.False(t, isDstFound) - - expectedAppStake := &cosmostypes.Coin{Denom: "upokt", Amount: math.NewInt(100)} - - // Prepare and stake the source application. - appStakeMsg := &apptypes.MsgStakeApplication{ - Address: srcAddr, - Stake: expectedAppStake, - Services: []*sharedtypes.ApplicationServiceConfig{ - { - ServiceId: "svc1", - }, - }, - } - - _, err := srv.StakeApplication(ctx, appStakeMsg) - require.NoError(t, err) - - // Prepare and stake the destination application. - dstAppStakeMsg := &apptypes.MsgStakeApplication{ - Address: dstAddr, - Stake: expectedAppStake, - Services: []*sharedtypes.ApplicationServiceConfig{ - { - ServiceId: "svc1", - }, - }, - } - - _, err = srv.StakeApplication(ctx, dstAppStakeMsg) - require.NoError(t, err) - - // Attempt to transfer the source application stake to the destination. - transferStakeMsg := apptypes.NewMsgTransferApplication(srcAddr, dstAddr) - - _, err = srv.TransferApplication(ctx, transferStakeMsg) - require.ErrorContains(t, err, apptypes.ErrAppDuplicateAddress.Wrapf("destination application (%q) exists", dstAddr).Error()) - - // Verify that the original application still exists. - var foundApp apptypes.Application - foundApp, isSrcFound = k.GetApplication(ctx, srcAddr) - require.True(t, isSrcFound) - require.Equal(t, srcAddr, foundApp.Address) - require.Equal(t, int64(100), foundApp.Stake.Amount.Int64()) - require.Len(t, foundApp.ServiceConfigs, 1) - require.Equal(t, "svc1", foundApp.ServiceConfigs[0].ServiceId) -} diff --git a/x/application/keeper/msg_server_transfer_application_test.go b/x/application/keeper/msg_server_transfer_application_test.go new file mode 100644 index 000000000..ab323de62 --- /dev/null +++ b/x/application/keeper/msg_server_transfer_application_test.go @@ -0,0 +1,136 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + events2 "github.com/pokt-network/poktroll/testutil/events" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" + appkeeper "github.com/pokt-network/poktroll/x/application/keeper" + apptypes "github.com/pokt-network/poktroll/x/application/types" + "github.com/pokt-network/poktroll/x/shared" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +func TestMsgServer_TransferApplication_Success(t *testing.T) { + k, ctx := keepertest.ApplicationKeeper(t) + srv := appkeeper.NewMsgServerImpl(k) + sharedParams := sharedtypes.DefaultParams() + + // Generate an address for the source and destination applications. + srcBech32 := sample.AccAddress() + dstBech32 := sample.AccAddress() + + // Verify that the app does not exist yet. + _, isSrcFound := k.GetApplication(ctx, srcBech32) + require.False(t, isSrcFound) + + expectedAppStake := &cosmostypes.Coin{Denom: "upokt", Amount: math.NewInt(100)} + + // Prepare the application. + stakeMsg := &apptypes.MsgStakeApplication{ + Address: srcBech32, + Stake: expectedAppStake, + Services: []*sharedtypes.ApplicationServiceConfig{ + { + ServiceId: "svc1", + }, + }, + } + + // Stake the application. + _, err := srv.StakeApplication(ctx, stakeMsg) + require.NoError(t, err) + + // Verify that the application exists. + srcApp, isSrcFound := k.GetApplication(ctx, srcBech32) + require.True(t, isSrcFound) + require.Equal(t, srcBech32, srcApp.GetAddress()) + require.Equal(t, expectedAppStake, srcApp.GetStake()) + require.Len(t, srcApp.GetServiceConfigs(), 1) + require.Equal(t, "svc1", srcApp.GetServiceConfigs()[0].GetServiceId()) + + transferBeginHeight := cosmostypes.UnwrapSDKContext(ctx).BlockHeight() + transferSessionEndHeight := shared.GetSessionEndHeight(&sharedParams, transferBeginHeight) + expectedPendingTransfer := &apptypes.PendingApplicationTransfer{ + DestinationAddress: dstBech32, + SessionEndHeight: uint64(transferSessionEndHeight), + } + + // Transfer the application stake from the source to the destination application address. + transferStakeMsg := apptypes.NewMsgTransferApplication(srcBech32, dstBech32) + transferAppStakeRes, stakeTransferErr := srv.TransferApplication(ctx, transferStakeMsg) + require.NoError(t, stakeTransferErr) + transferResApp := transferAppStakeRes.GetApplication() + require.NotNil(t, transferResApp.GetPendingTransfer()) + + // Assert that the source app and the transfer response app are the same except for the #PendingTransfer. + transferResAppCopy := *transferResApp + transferResAppCopy.PendingTransfer = nil + require.EqualValues(t, srcApp, transferResAppCopy) + + // Assert that the transfer end event was emitted. + events := cosmostypes.UnwrapSDKContext(ctx).EventManager().Events() + transferBeginEventTypeURL := types.MsgTypeURL(&apptypes.EventTransferBegin{}) + transferBeginEvents := events2.FilterEvents[*apptypes.EventTransferBegin](t, events, transferBeginEventTypeURL) + require.Equal(t, 1, len(transferBeginEvents), "expected 1 transfer begin event") + require.Equal(t, srcBech32, transferBeginEvents[0].GetSourceAddress()) + require.Equal(t, dstBech32, transferBeginEvents[0].GetDestinationAddress()) + require.Equal(t, srcBech32, transferBeginEvents[0].GetSourceApplication().GetAddress()) + + // Set the height to the transfer end height - 1 for the session. + transferEndHeight := apptypes.GetApplicationTransferHeight(&sharedParams, transferResApp) + sdkCtx := cosmostypes.UnwrapSDKContext(ctx) + ctx = sdkCtx.WithBlockHeight(transferEndHeight - 1) + + // Run application module end-blockers to assert that the transfer is not completed yet. + err = k.EndBlockerTransferApplication(ctx) + require.NoError(t, err) + + // Assert that the source app is still pending transfer. + pendingSrcApp, isSrcFound := k.GetApplication(ctx, srcBech32) + require.True(t, isSrcFound) + require.EqualValues(t, expectedPendingTransfer, pendingSrcApp.GetPendingTransfer()) + + // Assert that the destination app was not created yet. + _, isDstFound := k.GetApplication(ctx, dstBech32) + require.False(t, isDstFound) + + // Set the height to the transfer end height for the session. + sdkCtx = cosmostypes.UnwrapSDKContext(ctx) + ctx = sdkCtx.WithBlockHeight(transferEndHeight) + + // Run application module end-blockers to complete the transfer. + err = k.EndBlockerTransferApplication(ctx) + require.NoError(t, err) + + // Verify that the destination app was created with the correct state. + dstApp, isDstFound := k.GetApplication(ctx, dstBech32) + require.True(t, isDstFound) + require.Equal(t, dstBech32, dstApp.GetAddress()) + require.Equal(t, expectedAppStake, dstApp.GetStake()) + require.Len(t, dstApp.GetServiceConfigs(), 1) + require.Equal(t, "svc1", dstApp.GetServiceConfigs()[0].GetServiceId()) + + // Assert that the transfer end event was emitted. + events = cosmostypes.UnwrapSDKContext(ctx).EventManager().Events() + transferEndEventTypeURL := types.MsgTypeURL(&apptypes.EventTransferEnd{}) + transferEndEvents := events2.FilterEvents[*apptypes.EventTransferEnd](t, events, transferEndEventTypeURL) + require.Equal(t, 1, len(transferEndEvents), "expected 1 transfer end event") + require.Equal(t, srcBech32, transferEndEvents[0].GetSourceAddress()) + require.Equal(t, dstBech32, transferEndEvents[0].GetDestinationAddress()) + require.Equal(t, dstBech32, transferEndEvents[0].GetDestinationApplication().GetAddress()) + + srcApp.Address = "" + dstApp.Address = "" + require.EqualValues(t, srcApp, dstApp) + + // Verify that the source app was unstaked. + srcApp, isSrcFound = k.GetApplication(ctx, srcBech32) + require.False(t, isSrcFound) +} diff --git a/x/application/keeper/msg_server_unstake_application.go b/x/application/keeper/msg_server_unstake_application.go index 7fbdc9f58..ac122c68b 100644 --- a/x/application/keeper/msg_server_unstake_application.go +++ b/x/application/keeper/msg_server_unstake_application.go @@ -27,17 +27,27 @@ func (k msgServer) UnstakeApplication( logger.Info(fmt.Sprintf("About to unstake application with msg: %v", msg)) // Check if the application already exists or not. - foundApp, isAppFound := k.GetApplication(ctx, msg.Address) + foundApp, isAppFound := k.GetApplication(ctx, msg.GetAddress()) if !isAppFound { - logger.Info(fmt.Sprintf("Application not found. Cannot unstake address %s", msg.Address)) - return nil, types.ErrAppNotFound + logger.Info(fmt.Sprintf("Application not found. Cannot unstake address (%s)", msg.GetAddress())) + return nil, types.ErrAppNotFound.Wrapf("application (%s)", msg.GetAddress()) } - logger.Info(fmt.Sprintf("Application found. Unstaking application for address %s", msg.Address)) + logger.Info(fmt.Sprintf("Application found. Unstaking application for address (%s)", msg.GetAddress())) // Check if the application has already initiated the unstaking process. if foundApp.IsUnbonding() { - logger.Warn(fmt.Sprintf("Application %s is still unbonding from previous unstaking", msg.Address)) - return nil, types.ErrAppIsUnstaking + logger.Warn(fmt.Sprintf("Application (%s) is still unbonding from previous unstaking", msg.GetAddress())) + return nil, types.ErrAppIsUnstaking.Wrapf("application (%s)", msg.GetAddress()) + } + + // Check if the application has already initiated a transfer process. + // Transferring applications CANNOT unstake. + if foundApp.HasPendingTransfer() { + logger.Warn(fmt.Sprintf( + "Application (%s) has a pending transfer to (%s)", + msg.Address, foundApp.GetPendingTransfer().GetDestinationAddress()), + ) + return nil, types.ErrAppHasPendingTransfer.Wrapf("application (%s)", msg.GetAddress()) } sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/application/keeper/transfer_application_test.go b/x/application/keeper/transfer_application_test.go new file mode 100644 index 000000000..9519d5cd2 --- /dev/null +++ b/x/application/keeper/transfer_application_test.go @@ -0,0 +1,190 @@ +package keeper + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/pokt-network/poktroll/testutil/sample" + apptypes "github.com/pokt-network/poktroll/x/application/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +type MergeAppDelegateesSuite struct { + suite.Suite + + gateway1, + gateway2, + gateway3, + gateway4, + gateway5 string +} + +func TestMergeAppSuite(t *testing.T) { + suite.Run(t, new(MergeAppDelegateesSuite)) +} + +func (s *MergeAppDelegateesSuite) SetupTest() { + s.gateway1 = sample.AccAddress() + s.gateway2 = sample.AccAddress() + s.gateway3 = sample.AccAddress() + s.gateway4 = sample.AccAddress() + s.gateway5 = sample.AccAddress() + + s.T().Logf(` +gateway1: %s +gateway2: %s +gateway3: %s +gateway4: %s +gateway5: %s`, + s.gateway1, + s.gateway2, + s.gateway3, + s.gateway4, + s.gateway5, + ) +} + +func (s *MergeAppDelegateesSuite) TestMergeAppDelegatees() { + srcApp := &apptypes.Application{ + DelegateeGatewayAddresses: []string{ + s.gateway1, s.gateway2, + }, + } + + dstApp := &apptypes.Application{ + DelegateeGatewayAddresses: []string{ + s.gateway2, s.gateway3, + }, + } + + mergeAppDelegatees(srcApp, dstApp) + + expectedDelegatees := []string{ + s.gateway1, s.gateway2, s.gateway3, + } + require.ElementsMatch(s.T(), expectedDelegatees, dstApp.DelegateeGatewayAddresses) +} + +func (s *MergeAppDelegateesSuite) TestMergePendingUndelegations() { + tests := []struct { + desc string + srcPendingUndelegations map[uint64]apptypes.UndelegatingGatewayList + dstPendingUndelegations map[uint64]apptypes.UndelegatingGatewayList + expectedPendingUndelegations map[uint64]apptypes.UndelegatingGatewayList + }{ + { + desc: "source and destination app have common undelegation heights", + srcPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + dstPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway4, s.gateway5}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + expectedPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2, s.gateway4, s.gateway5}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + }, + { + desc: "destination app has distinct undelegation heights", + srcPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + }, + dstPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway4, s.gateway5}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + expectedPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2, s.gateway4, s.gateway5}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + }, + { + desc: "source app has distinct undelegation heights", + srcPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + dstPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway4, s.gateway5}}, + }, + expectedPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2, s.gateway4, s.gateway5}}, + 1: {GatewayAddresses: []string{s.gateway3}}, + }, + }, + { + desc: "source and destination apps have mutually exclusive undelegation heights", + srcPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + }, + dstPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 1: {GatewayAddresses: []string{s.gateway4, s.gateway5}}, + }, + expectedPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + 1: {GatewayAddresses: []string{s.gateway4, s.gateway5}}, + }, + }, + { + desc: "source and destination apps have common undelegations at different heights", + srcPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway1, s.gateway2}}, + }, + dstPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 1: {GatewayAddresses: []string{s.gateway1, s.gateway3}}, + }, + expectedPendingUndelegations: map[uint64]apptypes.UndelegatingGatewayList{ + 0: {GatewayAddresses: []string{s.gateway2}}, + 1: {GatewayAddresses: []string{s.gateway1, s.gateway3}}, + }, + }, + } + + for _, test := range tests { + s.T().Run(test.desc, func(t *testing.T) { + srcApp := &apptypes.Application{PendingUndelegations: test.srcPendingUndelegations} + dstApp := &apptypes.Application{PendingUndelegations: test.dstPendingUndelegations} + mergeAppPendingUndelegations(srcApp, dstApp) + + for height, expectedUndelegatingGatewayList := range test.expectedPendingUndelegations { + t.Run(fmt.Sprintf("height_%d", height), func(t *testing.T) { + expectedAddrs := expectedUndelegatingGatewayList.GatewayAddresses + dstUndelegatingGatewayList := dstApp.PendingUndelegations[height] + require.ElementsMatch(t, expectedAddrs, dstUndelegatingGatewayList.GatewayAddresses) + }) + } + }) + } +} + +func (s *MergeAppDelegateesSuite) TestMergeServiceConfigs() { + svc1Cfg := &sharedtypes.ApplicationServiceConfig{ServiceId: "svc1"} + svc2Cfg := &sharedtypes.ApplicationServiceConfig{ServiceId: "svc2"} + svc3Cfg := &sharedtypes.ApplicationServiceConfig{ServiceId: "svc3"} + + srcApp := &apptypes.Application{ + ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ + svc1Cfg, svc2Cfg, + }, + } + + dstApp := &apptypes.Application{ + ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ + // Ensure overlapping AND exclusive service configs (service ID). + svc2Cfg, svc3Cfg, + }, + } + + mergeAppServiceConfigs(srcApp, dstApp) + + expectedSvcCfgs := []*sharedtypes.ApplicationServiceConfig{ + svc1Cfg, svc2Cfg, svc3Cfg, + } + require.ElementsMatch(s.T(), expectedSvcCfgs, dstApp.ServiceConfigs) +} diff --git a/x/application/keeper/transfer_applications.go b/x/application/keeper/transfer_applications.go new file mode 100644 index 000000000..95184c47c --- /dev/null +++ b/x/application/keeper/transfer_applications.go @@ -0,0 +1,243 @@ +package keeper + +import ( + "context" + "fmt" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/telemetry" + "github.com/pokt-network/poktroll/x/application/types" + "github.com/pokt-network/poktroll/x/shared" +) + +// EndBlockerTransferApplication completes pending application transfers. +// This always happens on the last block of a session during which the transfer started. +// It is accomplished by: +// 1. Copying the current state of the source app onto a new destination app +// 2. Unstaking (removing) the source app +// 3. Staking (storing) the destination app +func (k Keeper) EndBlockerTransferApplication(ctx context.Context) error { + isSuccessful := false + defer telemetry.EventSuccessCounter( + "transfer_application_end", + telemetry.DefaultCounterFn, + func() bool { return isSuccessful }, + ) + + sdkCtx := cosmostypes.UnwrapSDKContext(ctx) + currentHeight := sdkCtx.BlockHeight() + sharedParams := k.sharedKeeper.GetParams(ctx) + sessionEndHeight := shared.GetSessionEndHeight(&sharedParams, currentHeight) + logger := k.Logger(). + With("method", "EndBlockerTransferApplication"). + With("current_height", currentHeight). + With("session_end_height", sessionEndHeight) + + // Only process application transfers at the end of the session in + // order to avoid inconsistent/unpredictable mid-session behavior. + if !shared.IsSessionEndHeight(&sharedParams, currentHeight) { + return nil + } + + // Iterate over all applications and transfer the ones that have finished the transfer period. + // TODO_MAINNET(@bryanchriswhite, #854): Use an index to iterate over the applications that have initiated + // the transfer action instead of iterating over all of them. + for _, srcApp := range k.GetAllApplications(ctx) { + // Ignore applications that have not initiated the transfer action. + if !srcApp.HasPendingTransfer() { + continue + } + + // Ignore applications that have initiated a transfer but still active. + // This spans the period from the end of the session in which the transfer + // began to the end of settlement for that session. + transferEndHeight := types.GetApplicationTransferHeight(&sharedParams, &srcApp) + if sdkCtx.BlockHeight() < transferEndHeight { + continue + } + + // Transfer the stake of the source application to the destination application and + // merge their gateway delegations and service configs. + if transferErr := k.transferApplication(ctx, srcApp); transferErr != nil { + logger.Warn(transferErr.Error()) + + // Application transfer failed, removing the pending transfer from the source application. + dstBech32 := srcApp.GetPendingTransfer().GetDestinationAddress() + srcApp.PendingTransfer = nil + k.SetApplication(ctx, srcApp) + + if err := sdkCtx.EventManager().EmitTypedEvent(&types.EventTransferError{ + SourceAddress: srcApp.GetAddress(), + DestinationAddress: dstBech32, + SourceApplication: &srcApp, + Error: transferErr.Error(), + }); err != nil { + return err + } + } + } + + isSuccessful = true + return nil +} + +// transferApplication transfers the fields of srcApp, except for address and pending_transfer, +// to an application whose address is the destination address of the pending transfer of srcApp. +// If the destination application does not exist, it is created. If it does exist, the stake of +// the destination application stake is incremented by the stake of the source application, and the +// delegatees and service configs of the destination application are set to the union of the +// source and destination applications' delegatees and service configs. It is intended +// to be called during the EndBlock ABCI method. + +// transferApplication transfers srcApp to srcApp.PendingTransfer.destination. +// If the destination application does not exist, it is created. +// If it does exist, then destination app is updated as follows: +// - The application stake is incremented by the stake of the source application +// - The delegatees and service configs of the destination application are set to the union of the src and dest +// - The pending undelegations of the source are merged into the destination. +// Duplicate pending undelegations resolve to the destination application's. +// +// It is intended to be called during the EndBlock ABCI method. +func (k Keeper) transferApplication(ctx context.Context, srcApp types.Application) error { + logger := k.Logger().With("method", "transferApplication") + + // Double-check that the source application is not unbonding. + // NB: This SHOULD NOT be possible because applications SHOULD NOT be able + // to unstake when they have a pending transfer. + if srcApp.IsUnbonding() { + return types.ErrAppIsUnstaking.Wrapf("cannot transfer stake of unbonding source application (%s)", srcApp.GetAddress()) + } + + // Check if the destination application already exists: + // If it does not: derive it from the source application. + // If it does: "merge" the src app into the dst app by: + // - summing stake amounts + // - taking the union of delegations and service configs + dstApp, isDstFound := k.GetApplication(ctx, srcApp.GetPendingTransfer().GetDestinationAddress()) + if !isDstFound { + dstApp = srcApp //intentional copy + dstApp.Address = srcApp.GetPendingTransfer().GetDestinationAddress() + dstApp.PendingTransfer = nil + + logger.Info(fmt.Sprintf( + "transferring application from %q to new application %q", + srcApp.GetAddress(), dstApp.GetAddress(), + )) + } else { + srcStakeSumCoin := dstApp.GetStake().Add(*dstApp.GetStake()) + dstApp.Stake = &srcStakeSumCoin + + mergeAppDelegatees(&srcApp, &dstApp) + mergeAppPendingUndelegations(&srcApp, &dstApp) + mergeAppServiceConfigs(&srcApp, &dstApp) + + logger.Info(fmt.Sprintf( + "transferring application from %q to existing application %q", + srcApp.GetAddress(), dstApp.GetAddress(), + )) + } + + // Remove srcApp from the store + k.RemoveApplication(ctx, srcApp.GetAddress()) + + // Add or update the dstApp in the store + k.SetApplication(ctx, dstApp) + + logger.Info(fmt.Sprintf("Successfully transferred application stake from (%s) to (%s)", srcApp.GetAddress(), dstApp.GetAddress())) + + sdkCtx := cosmostypes.UnwrapSDKContext(ctx) + if err := sdkCtx.EventManager().EmitTypedEvent(&types.EventTransferEnd{ + SourceAddress: srcApp.GetAddress(), + DestinationAddress: dstApp.GetAddress(), + DestinationApplication: &dstApp, + }); err != nil { + logger.Error(fmt.Sprintf("could not emit transfer end event: %v", err)) + } + + return nil +} + +// mergeAppDelegatees takes the union of the srcApp and dstApp's delegatees and +// sets the result in dstApp. +func mergeAppDelegatees(srcApp, dstApp *types.Application) { + // Build a set of the destination application's delegatees. + delagateeBech32Set := make(map[string]struct{}) + for _, dstDelegateeBech32 := range dstApp.DelegateeGatewayAddresses { + delagateeBech32Set[dstDelegateeBech32] = struct{}{} + } + + // Build the union of the source and destination applications' delagatees by + // appending source application delegatees which are not already in the set. + for _, srcDelegateeBech32 := range srcApp.DelegateeGatewayAddresses { + if _, ok := delagateeBech32Set[srcDelegateeBech32]; !ok { + dstApp.DelegateeGatewayAddresses = append(dstApp.DelegateeGatewayAddresses, srcDelegateeBech32) + } + } +} + +// mergeAppPendingUndelegations takes the union of the srcApp and dstApp's pending undelegations +// and sets the result in dstApp. Pending undelegations are merged according to the following algorithm: +// - At each pending undelegation height in the destination application: +// - Take the union of the gateway addresses in source and destination applications' +// pending undelegations at that height. +// - If a gateway address is present in both source and destination application's pending undelegations +// **at different heights**, the destination application's undelegation height is used +// (i.e. this undelegation is unchanged) and that gateway address is excluded from the +// gateway address union at the height which it is present in the source application's +// pending undelegations. +func mergeAppPendingUndelegations(srcApp, dstApp *types.Application) { + // Build a map from all gateway addresses which have pending undelegations to + // their respective undelegation session end heights. If the source and destination + // applications both contain pending undelegations from the same gateway address, the + // source pending undelegation is ignored. E.g., srcApp has a pending undelegation at + // height 10 from gateway1 and dstApp has pending undelegation from gateway1 atheight + // 20; only one pending undelegation from gateway1 should be present in the merged + // result, at height 20. + undelegationsUnionAddrToHeightMap := make(map[string]uint64) + + for srcHeight, srcUndelegetingGatewaysList := range srcApp.PendingUndelegations { + for _, srcGateway := range srcUndelegetingGatewaysList.GatewayAddresses { + undelegationsUnionAddrToHeightMap[srcGateway] = srcHeight + } + } + + for dstHeight, dstUndelegatingGatewaysList := range dstApp.PendingUndelegations { + for _, dstGateway := range dstUndelegatingGatewaysList.GatewayAddresses { + undelegationsUnionAddrToHeightMap[dstGateway] = dstHeight + } + } + + // Reset the destination application's pending undelegations and rebuild it + // from the undelegations union map. + dstApp.PendingUndelegations = make(map[uint64]types.UndelegatingGatewayList) + for gatewayAddr, height := range undelegationsUnionAddrToHeightMap { + dstPendingUndelegationsAtHeight, ok := dstApp.PendingUndelegations[height] + if !ok { + dstApp.PendingUndelegations[height] = types.UndelegatingGatewayList{ + GatewayAddresses: []string{gatewayAddr}, + } + } else { + dstPendingUndelegationsAtHeight.GatewayAddresses = append(dstApp.PendingUndelegations[height].GatewayAddresses, gatewayAddr) + dstApp.PendingUndelegations[height] = dstPendingUndelegationsAtHeight + } + } +} + +// mergeAppServiceConfigs takes the union of the srcApp and dstApp's service configs +// and sets the result in dstApp. +func mergeAppServiceConfigs(srcApp, dstApp *types.Application) { + // Build a set of the destination application's service configs. + serviceIDSet := make(map[string]struct{}) + for _, dstServiceConfig := range dstApp.ServiceConfigs { + serviceIDSet[dstServiceConfig.GetServiceId()] = struct{}{} + } + + // Build the union of the source and destination applications' service configs by + // appending source application service configs which are not already in the set. + for _, srcServiceConfig := range srcApp.ServiceConfigs { + if _, ok := serviceIDSet[srcServiceConfig.GetServiceId()]; !ok { + dstApp.ServiceConfigs = append(dstApp.ServiceConfigs, srcServiceConfig) + } + } +} diff --git a/x/application/keeper/unbond_applications.go b/x/application/keeper/unbond_applications.go index 38bbe2ef9..f0d98b0e6 100644 --- a/x/application/keeper/unbond_applications.go +++ b/x/application/keeper/unbond_applications.go @@ -6,7 +6,9 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/application/types" + "github.com/pokt-network/poktroll/x/shared" ) // EndBlockerUnbondApplications unbonds applications whose unbonding period has elapsed. @@ -16,7 +18,7 @@ func (k Keeper) EndBlockerUnbondApplications(ctx context.Context) error { currentHeight := sdkCtx.BlockHeight() // Only process unbonding applications at the end of the session. - if currentHeight != k.sharedKeeper.GetSessionEndHeight(ctx, currentHeight) { + if shared.IsSessionEndHeight(&sharedParams, currentHeight) { return nil } diff --git a/x/application/module/abci.go b/x/application/module/abci.go index 3f0b16f4d..4890fa062 100644 --- a/x/application/module/abci.go +++ b/x/application/module/abci.go @@ -20,5 +20,9 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) error { return err } + if err := k.EndBlockerTransferApplication(ctx); err != nil { + return err + } + return nil } diff --git a/x/application/simulation/transfer_application_stake.go b/x/application/simulation/transfer_application.go similarity index 100% rename from x/application/simulation/transfer_application_stake.go rename to x/application/simulation/transfer_application.go diff --git a/x/application/types/application.go b/x/application/types/application.go index b838df69a..b4a33cd5b 100644 --- a/x/application/types/application.go +++ b/x/application/types/application.go @@ -13,13 +13,24 @@ func (s *Application) IsUnbonding() bool { return s.UnstakeSessionEndHeight != ApplicationNotUnstaking } +// HasPendingTransfer returns true if the application has begun but not completed +// an application transfer. It determines if the application has submitted a transfer +// message, in which case the application has its PendingTransfer field set. +func (s *Application) HasPendingTransfer() bool { + return s.PendingTransfer != nil +} + // IsActive returns whether the application is allowed to request services at the // given query height. // An application that has not submitted an unstake message is always active. // An application that has submitted an unstake message is active until the end of // the session containing the height at which unstake message was submitted. +// An application that has a pending transfer is active until the end of the session +// containing the height at which the transfer was initiated. func (s *Application) IsActive(queryHeight int64) bool { - return !s.IsUnbonding() || uint64(queryHeight) <= s.UnstakeSessionEndHeight + return !s.IsUnbonding() || !s.HasPendingTransfer() || + uint64(queryHeight) <= s.GetUnstakeSessionEndHeight() || + uint64(queryHeight) <= s.GetPendingTransfer().GetSessionEndHeight() } // GetApplicationUnbondingHeight returns the session end height at which the given @@ -28,7 +39,18 @@ func GetApplicationUnbondingHeight( sharedParams *sharedtypes.Params, application *Application, ) int64 { - applicationUnbondingPeriodSessions := sharedParams.ApplicationUnbondingPeriodSessions * sharedParams.NumBlocksPerSession + applicationUnbondingPeriodBlocks := sharedParams.ApplicationUnbondingPeriodSessions * sharedParams.NumBlocksPerSession + + return int64(application.UnstakeSessionEndHeight + applicationUnbondingPeriodBlocks) +} + +// GetApplicationTransferHeight returns the session end height at which the given +// application transfer completes. +func GetApplicationTransferHeight( + sharedParams *sharedtypes.Params, + application *Application, +) int64 { + sessionEndToProofWindowCloseBlocks := sharedtypes.GetSessionEndToProofWindowCloseBlocks(sharedParams) - return int64(application.UnstakeSessionEndHeight + applicationUnbondingPeriodSessions) + return int64(application.GetPendingTransfer().GetSessionEndHeight() + sessionEndToProofWindowCloseBlocks) } diff --git a/x/application/types/errors.go b/x/application/types/errors.go index b20120506..f2f383440 100644 --- a/x/application/types/errors.go +++ b/x/application/types/errors.go @@ -20,4 +20,5 @@ var ( ErrAppNotDelegated = sdkerrors.Register(ModuleName, 1112, "application not delegated to gateway") ErrAppIsUnstaking = sdkerrors.Register(ModuleName, 1113, "application is in unbonding period") ErrAppDuplicateAddress = sdkerrors.Register(ModuleName, 1114, "duplicate application address") + ErrAppHasPendingTransfer = sdkerrors.Register(ModuleName, 1115, "application is in transfer period") ) diff --git a/x/application/types/event.pb.go b/x/application/types/event.pb.go index 7d331adec..975a565dd 100644 --- a/x/application/types/event.pb.go +++ b/x/application/types/event.pb.go @@ -75,30 +75,229 @@ func (m *EventRedelegation) GetGatewayAddress() string { return "" } +// EventTransferBegin is emitted whenever an application begins a transfer. It +// includes the source application state immediately after the transfer began. +type EventTransferBegin struct { + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SourceApplication *Application `protobuf:"bytes,3,opt,name=source_application,json=sourceApplication,proto3" json:"source_application,omitempty"` +} + +func (m *EventTransferBegin) Reset() { *m = EventTransferBegin{} } +func (m *EventTransferBegin) String() string { return proto.CompactTextString(m) } +func (*EventTransferBegin) ProtoMessage() {} +func (*EventTransferBegin) Descriptor() ([]byte, []int) { + return fileDescriptor_d0d229437c622598, []int{1} +} +func (m *EventTransferBegin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTransferBegin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventTransferBegin) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTransferBegin.Merge(m, src) +} +func (m *EventTransferBegin) XXX_Size() int { + return m.Size() +} +func (m *EventTransferBegin) XXX_DiscardUnknown() { + xxx_messageInfo_EventTransferBegin.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTransferBegin proto.InternalMessageInfo + +func (m *EventTransferBegin) GetSourceAddress() string { + if m != nil { + return m.SourceAddress + } + return "" +} + +func (m *EventTransferBegin) GetDestinationAddress() string { + if m != nil { + return m.DestinationAddress + } + return "" +} + +func (m *EventTransferBegin) GetSourceApplication() *Application { + if m != nil { + return m.SourceApplication + } + return nil +} + +// EventTransferEnd is emitted whenever an application transfer is completed. It +// includes the destination application state at the time the transfer completed. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +type EventTransferEnd struct { + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + DestinationApplication *Application `protobuf:"bytes,3,opt,name=destination_application,json=destinationApplication,proto3" json:"destination_application,omitempty"` +} + +func (m *EventTransferEnd) Reset() { *m = EventTransferEnd{} } +func (m *EventTransferEnd) String() string { return proto.CompactTextString(m) } +func (*EventTransferEnd) ProtoMessage() {} +func (*EventTransferEnd) Descriptor() ([]byte, []int) { + return fileDescriptor_d0d229437c622598, []int{2} +} +func (m *EventTransferEnd) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTransferEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventTransferEnd) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTransferEnd.Merge(m, src) +} +func (m *EventTransferEnd) XXX_Size() int { + return m.Size() +} +func (m *EventTransferEnd) XXX_DiscardUnknown() { + xxx_messageInfo_EventTransferEnd.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTransferEnd proto.InternalMessageInfo + +func (m *EventTransferEnd) GetSourceAddress() string { + if m != nil { + return m.SourceAddress + } + return "" +} + +func (m *EventTransferEnd) GetDestinationAddress() string { + if m != nil { + return m.DestinationAddress + } + return "" +} + +func (m *EventTransferEnd) GetDestinationApplication() *Application { + if m != nil { + return m.DestinationApplication + } + return nil +} + +// EventTransferError is emitted whenever an application transfer fails. It +// includes the source application state at the time the transfer failed and +// the error message. +// Either EventTransferEnd or EventTransferError will be emitted corresponding to +// any given EventTransferBegin event. +type EventTransferError struct { + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SourceApplication *Application `protobuf:"bytes,3,opt,name=source_application,json=sourceApplication,proto3" json:"source_application,omitempty"` + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` +} + +func (m *EventTransferError) Reset() { *m = EventTransferError{} } +func (m *EventTransferError) String() string { return proto.CompactTextString(m) } +func (*EventTransferError) ProtoMessage() {} +func (*EventTransferError) Descriptor() ([]byte, []int) { + return fileDescriptor_d0d229437c622598, []int{3} +} +func (m *EventTransferError) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTransferError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventTransferError) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTransferError.Merge(m, src) +} +func (m *EventTransferError) XXX_Size() int { + return m.Size() +} +func (m *EventTransferError) XXX_DiscardUnknown() { + xxx_messageInfo_EventTransferError.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTransferError proto.InternalMessageInfo + +func (m *EventTransferError) GetSourceAddress() string { + if m != nil { + return m.SourceAddress + } + return "" +} + +func (m *EventTransferError) GetDestinationAddress() string { + if m != nil { + return m.DestinationAddress + } + return "" +} + +func (m *EventTransferError) GetSourceApplication() *Application { + if m != nil { + return m.SourceApplication + } + return nil +} + +func (m *EventTransferError) GetError() string { + if m != nil { + return m.Error + } + return "" +} + func init() { proto.RegisterType((*EventRedelegation)(nil), "poktroll.application.EventRedelegation") + proto.RegisterType((*EventTransferBegin)(nil), "poktroll.application.EventTransferBegin") + proto.RegisterType((*EventTransferEnd)(nil), "poktroll.application.EventTransferEnd") + proto.RegisterType((*EventTransferError)(nil), "poktroll.application.EventTransferError") } func init() { proto.RegisterFile("poktroll/application/event.proto", fileDescriptor_d0d229437c622598) } var fileDescriptor_d0d229437c622598 = []byte{ - // 248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, - 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa9, - 0xd0, 0x43, 0x52, 0x21, 0x25, 0x99, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x1c, 0x0f, 0x56, 0xa3, 0x0f, - 0xe1, 0x40, 0x34, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x43, 0xc4, 0x41, 0x2c, 0x88, 0xa8, 0xd2, - 0x44, 0x46, 0x2e, 0x41, 0x57, 0x90, 0xb1, 0x41, 0xa9, 0x29, 0xa9, 0x39, 0xa9, 0xe9, 0x60, 0x63, - 0x84, 0x2c, 0xb9, 0xb8, 0x13, 0x0b, 0x0a, 0xe2, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, - 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x1a, 0xe9, 0x08, 0x91, - 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0xe2, 0x4a, 0x2c, 0x28, 0x80, 0x8a, 0x08, 0x39, 0x72, - 0xf1, 0xa7, 0x27, 0x96, 0xa4, 0x96, 0x27, 0x56, 0xc2, 0xb5, 0x33, 0x11, 0xd0, 0xce, 0x07, 0xd5, - 0x00, 0x15, 0x75, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, - 0x61, 0xa0, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0f, 0xb2, 0x0a, 0x94, 0x40, - 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x7b, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0xca, 0xe7, 0xe9, 0xb0, 0x59, 0x01, 0x00, 0x00, + // 388 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x53, 0x3d, 0x4f, 0xc2, 0x40, + 0x18, 0xe6, 0xf0, 0x23, 0xf1, 0x88, 0x28, 0x67, 0xa3, 0x95, 0xa1, 0x41, 0x26, 0x16, 0xda, 0x44, + 0x5d, 0x9c, 0x0c, 0x24, 0x0c, 0x6e, 0xa6, 0x3a, 0xb1, 0x90, 0xa3, 0x3d, 0x6b, 0x43, 0xb9, 0xbb, + 0x5c, 0x0f, 0x91, 0x7f, 0xe0, 0xa8, 0xff, 0xc5, 0x1f, 0xe1, 0x48, 0x9c, 0x18, 0x4d, 0xf9, 0x07, + 0x8e, 0x4e, 0xa6, 0x5f, 0x50, 0x94, 0x44, 0xe2, 0x64, 0xdc, 0xee, 0x7d, 0xfa, 0x3c, 0xef, 0xfb, + 0x3c, 0x7d, 0xf3, 0xc2, 0x0a, 0x67, 0x3d, 0x29, 0x98, 0xe7, 0x19, 0x98, 0x73, 0xcf, 0xb5, 0xb0, + 0x74, 0x19, 0x35, 0xc8, 0x1d, 0xa1, 0x52, 0xe7, 0x82, 0x49, 0x86, 0x94, 0x94, 0xa1, 0x67, 0x18, + 0xe5, 0x43, 0x8b, 0xf9, 0x7d, 0xe6, 0x77, 0x22, 0x8e, 0x11, 0x17, 0xb1, 0xa0, 0xac, 0x38, 0xcc, + 0x61, 0x31, 0x1e, 0xbe, 0x12, 0x74, 0xf9, 0x20, 0x39, 0xe2, 0x24, 0xd1, 0x55, 0x9f, 0x00, 0x2c, + 0xb5, 0xc2, 0xc1, 0x26, 0xb1, 0x89, 0x47, 0x9c, 0x88, 0x81, 0xce, 0x60, 0x01, 0x73, 0xde, 0xc1, + 0xb6, 0x2d, 0x88, 0xef, 0xab, 0xa0, 0x02, 0x6a, 0x5b, 0x4d, 0xf5, 0xf5, 0xb9, 0xae, 0x24, 0x43, + 0x1b, 0xf1, 0x97, 0x2b, 0x29, 0x5c, 0xea, 0x98, 0x10, 0x73, 0x9e, 0x20, 0xa8, 0x01, 0x77, 0x1c, + 0x2c, 0xc9, 0x10, 0x8f, 0x66, 0xf2, 0xfc, 0x0f, 0xf2, 0x62, 0x22, 0x48, 0xd0, 0xea, 0x3b, 0x80, + 0x28, 0xf2, 0x74, 0x2d, 0x30, 0xf5, 0x6f, 0x88, 0x68, 0x12, 0xc7, 0xa5, 0xe8, 0x1c, 0x16, 0x7d, + 0x36, 0x10, 0x16, 0x59, 0xd9, 0xd7, 0x76, 0xcc, 0x4f, 0xad, 0x5d, 0xc0, 0x3d, 0x9b, 0xf8, 0xd2, + 0xa5, 0x51, 0xc8, 0x95, 0xed, 0xa1, 0x8c, 0x28, 0x6d, 0x75, 0x09, 0x51, 0xea, 0x65, 0xfe, 0x63, + 0xd5, 0xb5, 0x0a, 0xa8, 0x15, 0x8e, 0x8f, 0xf4, 0x65, 0xcb, 0xd3, 0x1b, 0xf3, 0xb7, 0x59, 0x4a, + 0x8c, 0xcd, 0xa1, 0xea, 0x07, 0x80, 0xbb, 0x0b, 0xa1, 0x5b, 0xd4, 0xfe, 0x53, 0x91, 0xdb, 0xf0, + 0x60, 0xa1, 0xd5, 0x6f, 0x72, 0xef, 0x67, 0xfb, 0x66, 0xc2, 0x3f, 0xe4, 0xbf, 0x6c, 0xbc, 0x25, + 0x04, 0x13, 0xff, 0x7b, 0xe3, 0x48, 0x81, 0x1b, 0x24, 0x8c, 0xa9, 0xae, 0x87, 0x76, 0xcc, 0xb8, + 0x68, 0x9a, 0x2f, 0x81, 0x06, 0xc6, 0x81, 0x06, 0x26, 0x81, 0x06, 0xde, 0x02, 0x0d, 0x3c, 0x4e, + 0xb5, 0xdc, 0x78, 0xaa, 0xe5, 0x26, 0x53, 0x2d, 0xd7, 0x3e, 0x75, 0x5c, 0x79, 0x3b, 0xe8, 0xea, + 0x16, 0xeb, 0x1b, 0xe1, 0xcc, 0x3a, 0x25, 0x72, 0xc8, 0x44, 0xcf, 0x98, 0x1d, 0xfa, 0xfd, 0xf7, + 0x53, 0xef, 0x6e, 0x46, 0xb7, 0x7e, 0xf2, 0x19, 0x00, 0x00, 0xff, 0xff, 0x92, 0x6e, 0x3f, 0xf3, + 0x78, 0x04, 0x00, 0x00, } func (m *EventRedelegation) Marshal() (dAtA []byte, err error) { @@ -138,6 +337,160 @@ func (m *EventRedelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventTransferBegin) 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 *EventTransferBegin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTransferBegin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SourceApplication != nil { + { + size, err := m.SourceApplication.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SourceAddress) > 0 { + i -= len(m.SourceAddress) + copy(dAtA[i:], m.SourceAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventTransferEnd) 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 *EventTransferEnd) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTransferEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DestinationApplication != nil { + { + size, err := m.DestinationApplication.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SourceAddress) > 0 { + i -= len(m.SourceAddress) + copy(dAtA[i:], m.SourceAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventTransferError) 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 *EventTransferError) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTransferError) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if m.SourceApplication != nil { + { + size, err := m.SourceApplication.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SourceAddress) > 0 { + i -= len(m.SourceAddress) + copy(dAtA[i:], m.SourceAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { offset -= sovEvent(v) base := offset @@ -166,6 +519,73 @@ func (m *EventRedelegation) Size() (n int) { return n } +func (m *EventTransferBegin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourceAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.SourceApplication != nil { + l = m.SourceApplication.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventTransferEnd) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourceAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.DestinationApplication != nil { + l = m.DestinationApplication.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventTransferError) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourceAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.SourceApplication != nil { + l = m.SourceApplication.Size() + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + func sovEvent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -286,6 +706,488 @@ func (m *EventRedelegation) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventTransferBegin) 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 ErrIntOverflowEvent + } + 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: EventTransferBegin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTransferBegin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceApplication == nil { + m.SourceApplication = &Application{} + } + if err := m.SourceApplication.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventTransferEnd) 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 ErrIntOverflowEvent + } + 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: EventTransferEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTransferEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DestinationApplication == nil { + m.DestinationApplication = &Application{} + } + if err := m.DestinationApplication.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventTransferError) 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 ErrIntOverflowEvent + } + 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: EventTransferError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTransferError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceApplication", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceApplication == nil { + m.SourceApplication = &Application{} + } + if err := m.SourceApplication.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/application/types/message_transfer_application_stake.go b/x/application/types/message_transfer_application.go similarity index 100% rename from x/application/types/message_transfer_application_stake.go rename to x/application/types/message_transfer_application.go diff --git a/x/application/types/message_transfer_application_stake_test.go b/x/application/types/message_transfer_application_test.go similarity index 100% rename from x/application/types/message_transfer_application_stake_test.go rename to x/application/types/message_transfer_application_test.go diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go index 7a9b0cefa..554888dc7 100644 --- a/x/application/types/tx.pb.go +++ b/x/application/types/tx.pb.go @@ -176,6 +176,7 @@ func (m *MsgStakeApplication) GetServices() []*types1.ApplicationServiceConfig { } type MsgStakeApplicationResponse struct { + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (m *MsgStakeApplicationResponse) Reset() { *m = MsgStakeApplicationResponse{} } @@ -207,6 +208,13 @@ func (m *MsgStakeApplicationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeApplicationResponse proto.InternalMessageInfo +func (m *MsgStakeApplicationResponse) GetApplication() *Application { + if m != nil { + return m.Application + } + return nil +} + type MsgUnstakeApplication struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } @@ -328,6 +336,7 @@ func (m *MsgDelegateToGateway) GetGatewayAddress() string { } type MsgDelegateToGatewayResponse struct { + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (m *MsgDelegateToGatewayResponse) Reset() { *m = MsgDelegateToGatewayResponse{} } @@ -359,6 +368,13 @@ func (m *MsgDelegateToGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDelegateToGatewayResponse proto.InternalMessageInfo +func (m *MsgDelegateToGatewayResponse) GetApplication() *Application { + if m != nil { + return m.Application + } + return nil +} + type MsgUndelegateFromGateway struct { AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` @@ -545,56 +561,56 @@ func init() { func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 772 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0xcd, 0x4e, 0xdb, 0x4a, - 0x14, 0xc7, 0x63, 0x10, 0xdc, 0xcb, 0x09, 0x97, 0x0f, 0x27, 0x5c, 0x82, 0x0b, 0x26, 0x44, 0x6a, - 0x05, 0x69, 0xb1, 0x95, 0x80, 0x90, 0x60, 0x83, 0x80, 0x7e, 0xa8, 0x8b, 0x48, 0x55, 0xa0, 0x9b, - 0x6e, 0xd0, 0x24, 0x19, 0x8c, 0x45, 0xe2, 0xb1, 0x3c, 0x43, 0x20, 0xab, 0x56, 0x5d, 0x76, 0xd5, - 0xa7, 0xa8, 0xaa, 0xae, 0x58, 0x74, 0xd3, 0x07, 0xa8, 0xc4, 0xa6, 0x2a, 0xea, 0x8a, 0x55, 0x55, - 0x85, 0x05, 0xaf, 0x51, 0xd9, 0x1e, 0x3b, 0xc6, 0x99, 0x94, 0xb0, 0xeb, 0x06, 0xe2, 0x39, 0xff, - 0x73, 0xce, 0xff, 0x77, 0x46, 0x33, 0x36, 0xcc, 0xd9, 0xe4, 0x88, 0x39, 0xa4, 0x5e, 0xd7, 0x91, - 0x6d, 0xd7, 0xcd, 0x2a, 0x62, 0x26, 0xb1, 0x74, 0x76, 0xaa, 0xd9, 0x0e, 0x61, 0x44, 0x4e, 0x07, - 0x61, 0x2d, 0x12, 0x56, 0x26, 0x51, 0xc3, 0xb4, 0x88, 0xee, 0xfd, 0xf5, 0x85, 0xca, 0x4c, 0x95, - 0xd0, 0x06, 0xa1, 0xfb, 0xde, 0x93, 0xee, 0x3f, 0xf0, 0x90, 0xea, 0x3f, 0xe9, 0x15, 0x44, 0xb1, - 0xde, 0x2c, 0x54, 0x30, 0x43, 0x05, 0xbd, 0x4a, 0x4c, 0x8b, 0xc7, 0xa7, 0x79, 0xbc, 0x41, 0x0d, - 0xbd, 0x59, 0x70, 0xff, 0xf1, 0x40, 0xda, 0x20, 0x06, 0xf1, 0x0b, 0xba, 0xbf, 0xf8, 0x6a, 0x56, - 0xec, 0xb8, 0x65, 0xe3, 0xa0, 0xe1, 0x82, 0x50, 0x61, 0x23, 0x07, 0x35, 0x02, 0x49, 0x07, 0x9b, - 0x1e, 0x22, 0x07, 0xd7, 0x74, 0x8a, 0x9d, 0xa6, 0x59, 0xc5, 0x7e, 0x38, 0xf7, 0x55, 0x82, 0xf1, - 0x12, 0x35, 0x5e, 0xda, 0x35, 0xc4, 0xf0, 0x0b, 0x2f, 0x51, 0x5e, 0x83, 0x11, 0x74, 0xcc, 0x0e, - 0x89, 0x63, 0xb2, 0x56, 0x46, 0xca, 0x4a, 0x8b, 0x23, 0xdb, 0x99, 0x1f, 0x9f, 0x97, 0xd3, 0x9c, - 0x75, 0xab, 0x56, 0x73, 0x30, 0xa5, 0xbb, 0xcc, 0x31, 0x2d, 0xa3, 0xdc, 0x91, 0xca, 0x9b, 0x30, - 0xec, 0xb7, 0xce, 0x0c, 0x64, 0xa5, 0xc5, 0x64, 0x71, 0x56, 0x13, 0xcd, 0x54, 0xf3, 0xbb, 0x6c, - 0x8f, 0x9c, 0xff, 0x9c, 0x4f, 0x7c, 0xbc, 0x3e, 0xcb, 0x4b, 0x65, 0x9e, 0xb6, 0xb1, 0xfe, 0xf6, - 0xfa, 0x2c, 0xdf, 0x29, 0xf8, 0xee, 0xfa, 0x2c, 0xff, 0x20, 0xb4, 0x7f, 0x7a, 0x83, 0x31, 0xe6, - 0x39, 0x37, 0x03, 0xd3, 0xb1, 0xa5, 0x32, 0xa6, 0x36, 0xb1, 0x28, 0xce, 0x7d, 0x97, 0x20, 0x55, - 0xa2, 0xc6, 0x2e, 0x43, 0x47, 0x78, 0xab, 0x53, 0x42, 0x2e, 0xc2, 0x3f, 0xc8, 0x47, 0xb9, 0x15, - 0x32, 0x10, 0xca, 0x3a, 0x0c, 0x51, 0xb7, 0x0e, 0x27, 0x9c, 0xd1, 0xb8, 0xdc, 0xdd, 0x71, 0x8d, - 0xef, 0xb8, 0xb6, 0x43, 0x4c, 0xab, 0xec, 0xeb, 0xe4, 0x27, 0xf0, 0x2f, 0x1f, 0x38, 0xcd, 0x0c, - 0x66, 0x07, 0x17, 0x93, 0xc5, 0xa5, 0xce, 0x54, 0xfc, 0x1d, 0xd1, 0x22, 0xa6, 0x76, 0x7d, 0xed, - 0x0e, 0xb1, 0x0e, 0x4c, 0xa3, 0x1c, 0xa6, 0x6e, 0x8c, 0xba, 0x93, 0x09, 0x5c, 0xe4, 0xe6, 0xe0, - 0x9e, 0x00, 0x28, 0x04, 0xde, 0x84, 0x29, 0x77, 0x16, 0x16, 0x8d, 0x13, 0x67, 0x62, 0xc4, 0x21, - 0x57, 0xac, 0xfe, 0x3c, 0xcc, 0x09, 0x0b, 0x84, 0x1d, 0x3e, 0x48, 0x90, 0x2e, 0x51, 0xe3, 0x31, - 0xae, 0x63, 0x03, 0x31, 0xbc, 0x47, 0x9e, 0x21, 0x86, 0x4f, 0x50, 0x4b, 0x5e, 0x87, 0x24, 0xb2, - 0xed, 0xfd, 0x7e, 0xe7, 0x0a, 0xc8, 0xb6, 0xf9, 0x8a, 0xbc, 0x05, 0xe3, 0x86, 0x5f, 0x25, 0x4c, - 0x1f, 0xb8, 0x25, 0x7d, 0x8c, 0x27, 0xf0, 0xd5, 0x8d, 0x09, 0x97, 0x22, 0x6a, 0x20, 0xa7, 0xc2, - 0xac, 0xc8, 0x67, 0x08, 0xf2, 0x49, 0x82, 0x8c, 0x87, 0x5a, 0xe3, 0x92, 0xa7, 0x0e, 0x69, 0xfc, - 0xad, 0x30, 0x39, 0xc8, 0xf6, 0xf2, 0x1a, 0x02, 0x7d, 0x91, 0xe0, 0xff, 0x12, 0x35, 0xf6, 0x1c, - 0x64, 0xd1, 0x03, 0xec, 0x44, 0x77, 0x7f, 0x13, 0xc6, 0x28, 0x39, 0x76, 0xaa, 0xb8, 0x6f, 0xa2, - 0xff, 0x7c, 0x7d, 0x00, 0xf5, 0x1c, 0x52, 0x35, 0x4c, 0x99, 0x69, 0x79, 0xf5, 0xfa, 0x06, 0x93, - 0x23, 0x49, 0x01, 0x5c, 0xca, 0x85, 0x8b, 0xd9, 0xc9, 0x61, 0x50, 0xc5, 0xd6, 0x03, 0x3a, 0x79, - 0xc7, 0xdb, 0x91, 0x60, 0xd9, 0xf3, 0x9f, 0x2c, 0x2e, 0x88, 0xaf, 0x99, 0x68, 0x7e, 0x34, 0xab, - 0xf8, 0x6d, 0x08, 0x06, 0x4b, 0xd4, 0x90, 0x6b, 0x30, 0x7a, 0xe3, 0xda, 0xbb, 0x2f, 0xae, 0x13, - 0xbb, 0x56, 0x94, 0xe5, 0xbe, 0x64, 0xa1, 0x65, 0x1b, 0x26, 0xba, 0x6e, 0x9e, 0xa5, 0x9e, 0x25, - 0xe2, 0x52, 0xa5, 0xd0, 0xb7, 0x34, 0xec, 0xd8, 0x04, 0x59, 0x70, 0xf6, 0x1f, 0xf6, 0xb6, 0xdd, - 0x25, 0x56, 0x56, 0xee, 0x20, 0x0e, 0xfb, 0x52, 0x98, 0xec, 0xbe, 0x10, 0xf2, 0x3d, 0x2b, 0x75, - 0x69, 0x95, 0x62, 0xff, 0xda, 0xb0, 0xe9, 0x6b, 0x98, 0x12, 0x1f, 0x5e, 0xed, 0x0f, 0x08, 0x02, - 0xbd, 0xb2, 0x76, 0x37, 0x7d, 0x68, 0xa0, 0x05, 0x29, 0xd1, 0x61, 0x7b, 0xd4, 0xb3, 0x9c, 0x40, - 0xad, 0xac, 0xde, 0x45, 0x1d, 0xb4, 0x56, 0x86, 0xde, 0xb8, 0x6f, 0xcf, 0xed, 0xf2, 0x79, 0x5b, - 0x95, 0x2e, 0xda, 0xaa, 0x74, 0xd9, 0x56, 0xa5, 0x5f, 0x6d, 0x55, 0x7a, 0x7f, 0xa5, 0x26, 0x2e, - 0xae, 0xd4, 0xc4, 0xe5, 0x95, 0x9a, 0x78, 0xb5, 0x6a, 0x98, 0xec, 0xf0, 0xb8, 0xa2, 0x55, 0x49, - 0x43, 0x77, 0x9b, 0x2c, 0x5b, 0x98, 0x9d, 0x10, 0xe7, 0x48, 0xef, 0xf1, 0x62, 0xf5, 0x3e, 0x2f, - 0x2a, 0xc3, 0xde, 0xd7, 0xc1, 0xca, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xa2, 0x5c, 0x80, - 0x35, 0x09, 0x00, 0x00, + // 773 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3d, 0x4f, 0xdb, 0x50, + 0x14, 0x8d, 0x41, 0xd0, 0x72, 0x43, 0xf9, 0x70, 0x42, 0x09, 0x2e, 0x98, 0x60, 0xa9, 0x15, 0xa4, + 0xc5, 0x56, 0x02, 0x42, 0x82, 0x05, 0x01, 0xfd, 0x50, 0x87, 0x48, 0x55, 0xa0, 0x4b, 0x17, 0xf4, + 0x92, 0x3c, 0x8c, 0x45, 0xe2, 0x67, 0xf9, 0x3d, 0x02, 0x99, 0x5a, 0x75, 0xec, 0xd4, 0x5f, 0x51, + 0x55, 0x9d, 0x18, 0xba, 0xf4, 0x07, 0x54, 0x62, 0xa9, 0x8a, 0x3a, 0x31, 0x55, 0x55, 0x18, 0xf8, + 0x1b, 0x95, 0xed, 0x67, 0xc7, 0x38, 0x4e, 0x09, 0x12, 0x43, 0x97, 0x24, 0x7e, 0xf7, 0xdc, 0x7b, + 0xcf, 0x39, 0x37, 0xbe, 0x36, 0xcc, 0x58, 0xe4, 0x80, 0xd9, 0xa4, 0x56, 0xd3, 0x90, 0x65, 0xd5, + 0x8c, 0x0a, 0x62, 0x06, 0x31, 0x35, 0x76, 0xac, 0x5a, 0x36, 0x61, 0x44, 0x4c, 0xfb, 0x61, 0x35, + 0x14, 0x96, 0xc6, 0x51, 0xdd, 0x30, 0x89, 0xe6, 0x7e, 0x7a, 0x40, 0x69, 0xaa, 0x42, 0x68, 0x9d, + 0xd0, 0x5d, 0xf7, 0x4a, 0xf3, 0x2e, 0x78, 0x48, 0xf6, 0xae, 0xb4, 0x32, 0xa2, 0x58, 0x6b, 0xe4, + 0xcb, 0x98, 0xa1, 0xbc, 0x56, 0x21, 0x86, 0xc9, 0xe3, 0x93, 0x3c, 0x5e, 0xa7, 0xba, 0xd6, 0xc8, + 0x3b, 0x5f, 0x3c, 0x90, 0xd6, 0x89, 0x4e, 0xbc, 0x82, 0xce, 0x2f, 0x7e, 0x9a, 0x8d, 0x67, 0xdc, + 0xb4, 0xb0, 0xdf, 0x70, 0x2e, 0x16, 0x61, 0x21, 0x1b, 0xd5, 0x7d, 0x48, 0x5b, 0x36, 0xdd, 0x47, + 0x36, 0xae, 0x6a, 0x14, 0xdb, 0x0d, 0xa3, 0x82, 0xbd, 0xb0, 0xf2, 0x5d, 0x80, 0xd1, 0x22, 0xd5, + 0x5f, 0x5b, 0x55, 0xc4, 0xf0, 0x2b, 0x37, 0x51, 0x5c, 0x81, 0x21, 0x74, 0xc8, 0xf6, 0x89, 0x6d, + 0xb0, 0x66, 0x46, 0xc8, 0x0a, 0xf3, 0x43, 0x9b, 0x99, 0x5f, 0x5f, 0x17, 0xd3, 0x5c, 0xeb, 0x46, + 0xb5, 0x6a, 0x63, 0x4a, 0xb7, 0x99, 0x6d, 0x98, 0x7a, 0xa9, 0x0d, 0x15, 0xd7, 0x61, 0xd0, 0x6b, + 0x9d, 0xe9, 0xcb, 0x0a, 0xf3, 0xc9, 0xc2, 0xb4, 0x1a, 0xe7, 0xa9, 0xea, 0x75, 0xd9, 0x1c, 0x3a, + 0xfd, 0x3d, 0x9b, 0xf8, 0x7c, 0x79, 0x92, 0x13, 0x4a, 0x3c, 0x6d, 0x6d, 0xf5, 0xfd, 0xe5, 0x49, + 0xae, 0x5d, 0xf0, 0xc3, 0xe5, 0x49, 0xee, 0x51, 0x40, 0xff, 0xf8, 0x8a, 0xc6, 0x08, 0x67, 0x65, + 0x0a, 0x26, 0x23, 0x47, 0x25, 0x4c, 0x2d, 0x62, 0x52, 0xac, 0xfc, 0x14, 0x20, 0x55, 0xa4, 0xfa, + 0x36, 0x43, 0x07, 0x78, 0xa3, 0x5d, 0x42, 0x2c, 0xc0, 0x1d, 0xe4, 0x49, 0xb9, 0x56, 0xa4, 0x0f, + 0x14, 0x35, 0x18, 0xa0, 0x4e, 0x1d, 0xae, 0x70, 0x4a, 0xe5, 0x70, 0x67, 0xe2, 0x2a, 0x9f, 0xb8, + 0xba, 0x45, 0x0c, 0xb3, 0xe4, 0xe1, 0xc4, 0x67, 0x70, 0x97, 0x1b, 0x4e, 0x33, 0xfd, 0xd9, 0xfe, + 0xf9, 0x64, 0x61, 0xa1, 0xed, 0x8a, 0x37, 0x11, 0x35, 0x44, 0x6a, 0xdb, 0xc3, 0x6e, 0x11, 0x73, + 0xcf, 0xd0, 0x4b, 0x41, 0xea, 0xda, 0xb0, 0xe3, 0x8c, 0xcf, 0x42, 0x29, 0xc3, 0x83, 0x18, 0x41, + 0xbe, 0x60, 0x71, 0x0b, 0x92, 0x21, 0xab, 0x5c, 0x71, 0xc9, 0xc2, 0x5c, 0xfc, 0x30, 0xc2, 0xf9, + 0xe1, 0x2c, 0x65, 0x1d, 0x26, 0x1c, 0x43, 0x4d, 0x1a, 0xb5, 0x2d, 0x13, 0xb1, 0x2d, 0x30, 0x27, + 0x42, 0x72, 0x16, 0x66, 0x62, 0x0b, 0x04, 0x73, 0xf9, 0x24, 0x40, 0xba, 0x48, 0xf5, 0xa7, 0xb8, + 0x86, 0x75, 0xc4, 0xf0, 0x0e, 0x79, 0x81, 0x18, 0x3e, 0x42, 0x4d, 0x71, 0xd5, 0xe5, 0xbf, 0xdb, + 0xeb, 0x70, 0x00, 0x59, 0x16, 0x3f, 0x11, 0x37, 0x60, 0x54, 0xf7, 0xaa, 0x04, 0xe9, 0x7d, 0xd7, + 0xa4, 0x8f, 0xf0, 0x04, 0x7e, 0xba, 0x36, 0xe6, 0xa8, 0x08, 0x13, 0x50, 0x2a, 0x30, 0x1d, 0xc7, + 0xf3, 0x76, 0xfd, 0xfe, 0x22, 0x40, 0xc6, 0xf5, 0xab, 0xca, 0xfb, 0x3c, 0xb7, 0x49, 0xfd, 0x7f, + 0x75, 0x44, 0x81, 0x6c, 0x37, 0xae, 0xc1, 0x78, 0xbf, 0x09, 0x70, 0xbf, 0x48, 0xf5, 0x1d, 0x1b, + 0x99, 0x74, 0x0f, 0xdb, 0xe1, 0xbf, 0xd0, 0x3a, 0x8c, 0x50, 0x72, 0x68, 0x57, 0x70, 0xcf, 0x8a, + 0xee, 0x79, 0x78, 0x5f, 0xd4, 0x4b, 0x48, 0x55, 0x31, 0x65, 0x86, 0xe9, 0xd6, 0xeb, 0x59, 0x98, + 0x18, 0x4a, 0xf2, 0xc5, 0xa5, 0x1c, 0x71, 0x11, 0x3a, 0x0a, 0x06, 0x39, 0x9e, 0xfa, 0xad, 0xce, + 0xbc, 0xf0, 0x63, 0x00, 0xfa, 0x8b, 0x54, 0x17, 0xab, 0x30, 0x7c, 0x65, 0x01, 0x3f, 0x8c, 0xaf, + 0x13, 0x59, 0x70, 0xd2, 0x62, 0x4f, 0xb0, 0x80, 0xb2, 0x05, 0x63, 0x1d, 0x3b, 0x70, 0xa1, 0x6b, + 0x89, 0x28, 0x54, 0xca, 0xf7, 0x0c, 0x0d, 0x3a, 0x36, 0x40, 0x8c, 0x59, 0x20, 0x8f, 0xbb, 0xd3, + 0xee, 0x00, 0x4b, 0x4b, 0x37, 0x00, 0x07, 0x7d, 0x29, 0x8c, 0x77, 0x6e, 0x95, 0x5c, 0xd7, 0x4a, + 0x1d, 0x58, 0xa9, 0xd0, 0x3b, 0x36, 0x68, 0xfa, 0x16, 0x26, 0xe2, 0x6f, 0x5e, 0xf5, 0x1f, 0x12, + 0x62, 0xf0, 0xd2, 0xca, 0xcd, 0xf0, 0x01, 0x81, 0x26, 0xa4, 0xe2, 0x6e, 0xb6, 0x27, 0x5d, 0xcb, + 0xc5, 0xa0, 0xa5, 0xe5, 0x9b, 0xa0, 0xfd, 0xd6, 0xd2, 0xc0, 0x3b, 0xe7, 0x39, 0xbe, 0x59, 0x3a, + 0x6d, 0xc9, 0xc2, 0x59, 0x4b, 0x16, 0xce, 0x5b, 0xb2, 0xf0, 0xa7, 0x25, 0x0b, 0x1f, 0x2f, 0xe4, + 0xc4, 0xd9, 0x85, 0x9c, 0x38, 0xbf, 0x90, 0x13, 0x6f, 0x96, 0x75, 0x83, 0xed, 0x1f, 0x96, 0xd5, + 0x0a, 0xa9, 0x6b, 0x4e, 0x93, 0x45, 0x13, 0xb3, 0x23, 0x62, 0x1f, 0x68, 0x5d, 0x1e, 0xf1, 0xee, + 0x8b, 0x4e, 0x79, 0xd0, 0x7d, 0x4f, 0x59, 0xfa, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x27, 0x6c, 0xb6, + 0xef, 0xbf, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1000,6 +1016,18 @@ func (m *MsgStakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + if m.Application != nil { + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1113,6 +1141,18 @@ func (m *MsgDelegateToGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.Application != nil { + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1312,6 +1352,10 @@ func (m *MsgStakeApplicationResponse) Size() (n int) { } var l int _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1360,6 +1404,10 @@ func (m *MsgDelegateToGatewayResponse) Size() (n int) { } var l int _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1771,6 +1819,42 @@ func (m *MsgStakeApplicationResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgStakeApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Application == nil { + m.Application = &Application{} + } + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2067,6 +2151,42 @@ func (m *MsgDelegateToGatewayResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgDelegateToGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Application == nil { + m.Application = &Application{} + } + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/application/types/types.pb.go b/x/application/types/types.pb.go index 1b90dba76..47d91e6b5 100644 --- a/x/application/types/types.pb.go +++ b/x/application/types/types.pb.go @@ -48,7 +48,8 @@ type Application struct { PendingUndelegations map[uint64]UndelegatingGatewayList `protobuf:"bytes,5,rep,name=pending_undelegations,json=pendingUndelegations,proto3" json:"pending_undelegations" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // The end height of the session at which an application initiated its unstaking process. // If the application did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + UnstakeSessionEndHeight uint64 `protobuf:"varint,6,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + PendingTransfer *PendingApplicationTransfer `protobuf:"bytes,7,opt,name=pending_transfer,json=pendingTransfer,proto3" json:"pending_transfer,omitempty"` } func (m *Application) Reset() { *m = Application{} } @@ -122,6 +123,13 @@ func (m *Application) GetUnstakeSessionEndHeight() uint64 { return 0 } +func (m *Application) GetPendingTransfer() *PendingApplicationTransfer { + if m != nil { + return m.PendingTransfer + } + return nil +} + // UndelegatingGatewayList is used as the Value of `pending_undelegations`. // It is required to store a repeated list of strings as a map value. type UndelegatingGatewayList struct { @@ -164,48 +172,104 @@ func (m *UndelegatingGatewayList) GetGatewayAddresses() []string { return nil } +// PendingTransfer is used to store the details of a pending transfer. +// It is only intended to be used inside of an Application object. +type PendingApplicationTransfer struct { + DestinationAddress string `protobuf:"bytes,1,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + SessionEndHeight uint64 `protobuf:"varint,2,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height,omitempty"` +} + +func (m *PendingApplicationTransfer) Reset() { *m = PendingApplicationTransfer{} } +func (m *PendingApplicationTransfer) String() string { return proto.CompactTextString(m) } +func (*PendingApplicationTransfer) ProtoMessage() {} +func (*PendingApplicationTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_1899440439257283, []int{2} +} +func (m *PendingApplicationTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PendingApplicationTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PendingApplicationTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_PendingApplicationTransfer.Merge(m, src) +} +func (m *PendingApplicationTransfer) XXX_Size() int { + return m.Size() +} +func (m *PendingApplicationTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_PendingApplicationTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_PendingApplicationTransfer proto.InternalMessageInfo + +func (m *PendingApplicationTransfer) GetDestinationAddress() string { + if m != nil { + return m.DestinationAddress + } + return "" +} + +func (m *PendingApplicationTransfer) GetSessionEndHeight() uint64 { + if m != nil { + return m.SessionEndHeight + } + return 0 +} + func init() { proto.RegisterType((*Application)(nil), "poktroll.application.Application") proto.RegisterMapType((map[uint64]UndelegatingGatewayList)(nil), "poktroll.application.Application.PendingUndelegationsEntry") proto.RegisterType((*UndelegatingGatewayList)(nil), "poktroll.application.UndelegatingGatewayList") + proto.RegisterType((*PendingApplicationTransfer)(nil), "poktroll.application.PendingApplicationTransfer") } func init() { proto.RegisterFile("poktroll/application/types.proto", fileDescriptor_1899440439257283) } var fileDescriptor_1899440439257283 = []byte{ - // 511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4d, 0x6f, 0xd3, 0x30, - 0x1c, 0xc6, 0x9b, 0xbe, 0x0c, 0xcd, 0x95, 0x60, 0x58, 0x45, 0x4b, 0x0b, 0x84, 0x68, 0xa7, 0x72, - 0xa8, 0xad, 0x15, 0x0e, 0x88, 0x9d, 0xda, 0x6a, 0x02, 0x24, 0x0e, 0x28, 0x15, 0x17, 0x84, 0x14, - 0xb9, 0x89, 0x71, 0xad, 0x76, 0x76, 0x14, 0xbb, 0x19, 0xfd, 0x16, 0x7c, 0x18, 0x3e, 0xc4, 0x8e, - 0x83, 0xd3, 0x4e, 0x08, 0xb5, 0x5f, 0x04, 0x25, 0x76, 0xbb, 0x88, 0xb5, 0xd2, 0x2e, 0x51, 0xac, - 0xe7, 0xf7, 0xd8, 0x8f, 0xfd, 0xe8, 0x0f, 0xfc, 0x44, 0xce, 0x74, 0x2a, 0xe7, 0x73, 0x4c, 0x92, - 0x64, 0xce, 0x23, 0xa2, 0xb9, 0x14, 0x58, 0x2f, 0x13, 0xaa, 0x50, 0x92, 0x4a, 0x2d, 0x61, 0x6b, - 0x43, 0xa0, 0x12, 0xd1, 0x69, 0x31, 0xc9, 0x64, 0x01, 0xe0, 0xfc, 0xcf, 0xb0, 0x1d, 0x2f, 0x92, - 0xea, 0x42, 0x2a, 0x3c, 0x21, 0x8a, 0xe2, 0xec, 0x74, 0x42, 0x35, 0x39, 0xc5, 0x91, 0xe4, 0xc2, - 0xea, 0x6d, 0xa3, 0x87, 0xc6, 0x68, 0x16, 0x56, 0x7a, 0xbe, 0x0d, 0xa2, 0xa6, 0x24, 0xa5, 0x31, - 0x56, 0x34, 0xcd, 0x78, 0x44, 0x8d, 0x7c, 0xf2, 0xab, 0x0e, 0x9a, 0x83, 0xdb, 0xf3, 0x61, 0x1f, - 0x3c, 0x20, 0x71, 0x9c, 0x52, 0xa5, 0x5c, 0xc7, 0x77, 0xba, 0x87, 0x43, 0xf7, 0xf7, 0xcf, 0x5e, - 0xcb, 0xee, 0x38, 0x30, 0xca, 0x58, 0xa7, 0x5c, 0xb0, 0x60, 0x03, 0x42, 0x0c, 0x1a, 0x4a, 0x93, - 0x19, 0x75, 0xab, 0xbe, 0xd3, 0x6d, 0xf6, 0xdb, 0xc8, 0xe2, 0x79, 0x5a, 0x64, 0xd3, 0xa2, 0x91, - 0xe4, 0x22, 0x30, 0x1c, 0x0c, 0xc0, 0x23, 0x9b, 0x22, 0x8c, 0xa4, 0xf8, 0xc6, 0x99, 0x72, 0x6b, - 0x7e, 0xad, 0xdb, 0xec, 0xbf, 0x44, 0xdb, 0x47, 0x31, 0x69, 0x51, 0x29, 0xdb, 0xd8, 0x58, 0x46, - 0x85, 0x23, 0x78, 0xa8, 0xca, 0x4b, 0x05, 0xbf, 0x82, 0xa7, 0x31, 0x9d, 0x53, 0x46, 0x34, 0xa5, - 0x61, 0xfe, 0xbd, 0x24, 0xcb, 0xd0, 0x26, 0xa4, 0xca, 0xad, 0xfb, 0xb5, 0xee, 0xe1, 0xf0, 0xd9, - 0xd5, 0x9f, 0x17, 0x95, 0xbd, 0x17, 0x6a, 0x6f, 0x37, 0x78, 0x67, 0xfc, 0x83, 0x8d, 0x1d, 0x66, - 0xe0, 0x49, 0x42, 0x45, 0xcc, 0x05, 0x0b, 0x17, 0xc2, 0x62, 0x5c, 0x0a, 0xe5, 0x36, 0x8a, 0xdc, - 0x67, 0x68, 0x57, 0x99, 0xe5, 0xf0, 0xe8, 0x93, 0xb1, 0x7f, 0x2e, 0xbb, 0xcf, 0x85, 0x4e, 0x97, - 0xc3, 0x7a, 0x1e, 0x2a, 0x68, 0x25, 0x3b, 0x00, 0x78, 0x06, 0x3a, 0x0b, 0x51, 0x3c, 0x5a, 0xa8, - 0xa8, 0x52, 0x5c, 0x8a, 0x90, 0x8a, 0x38, 0x9c, 0x52, 0xce, 0xa6, 0xda, 0x3d, 0xf0, 0x9d, 0x6e, - 0x3d, 0x38, 0xb6, 0xc4, 0xd8, 0x00, 0xe7, 0x22, 0x7e, 0x5f, 0xc8, 0x9d, 0x0c, 0xb4, 0xf7, 0x9e, - 0x0a, 0x8f, 0x40, 0x6d, 0x46, 0x97, 0x45, 0xc9, 0xf5, 0x20, 0xff, 0x85, 0x23, 0xd0, 0xc8, 0xc8, - 0x7c, 0xb1, 0xa9, 0xb1, 0xb7, 0xfb, 0x4e, 0xb7, 0x5b, 0x09, 0x66, 0x9f, 0xe9, 0x23, 0x57, 0x3a, - 0x30, 0xde, 0xb7, 0xd5, 0x37, 0xce, 0x49, 0x0c, 0x8e, 0xf7, 0x50, 0xf0, 0x03, 0x78, 0x7c, 0xb7, - 0x9b, 0xea, 0x3d, 0xba, 0x39, 0x62, 0xff, 0x55, 0x32, 0x0c, 0xae, 0x56, 0x9e, 0x73, 0xbd, 0xf2, - 0x9c, 0x9b, 0x95, 0xe7, 0xfc, 0x5d, 0x79, 0xce, 0x8f, 0xb5, 0x57, 0xb9, 0x5e, 0x7b, 0x95, 0x9b, - 0xb5, 0x57, 0xf9, 0xf2, 0x9a, 0x71, 0x3d, 0x5d, 0x4c, 0x50, 0x24, 0x2f, 0x70, 0x7e, 0x8f, 0x9e, - 0xa0, 0xfa, 0x52, 0xa6, 0x33, 0xbc, 0x1d, 0x87, 0xef, 0x77, 0x27, 0x73, 0x72, 0x50, 0x0c, 0xc5, - 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, 0x59, 0x36, 0xdf, 0xbe, 0x03, 0x00, 0x00, + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0xfe, 0xd9, 0x34, 0x57, 0x62, 0xc5, 0x14, 0x2d, 0x2d, 0x10, 0xa2, 0x9e, 0x8a, + 0x44, 0x13, 0x56, 0x38, 0x20, 0x76, 0x6a, 0xab, 0x09, 0x26, 0x71, 0x40, 0x29, 0x5c, 0x00, 0x29, + 0x4a, 0x13, 0x2f, 0xb5, 0xda, 0xd9, 0x51, 0x5e, 0xb7, 0xa3, 0xdf, 0x82, 0x0b, 0x5f, 0x83, 0x13, + 0x1f, 0x62, 0xc7, 0x89, 0xd3, 0x4e, 0x08, 0xb5, 0x5f, 0x64, 0x4a, 0xec, 0x74, 0xd1, 0xd6, 0x4a, + 0xbb, 0x54, 0x89, 0xdf, 0xe7, 0x79, 0xfb, 0xf3, 0xfb, 0x38, 0x46, 0x66, 0xc4, 0x27, 0x22, 0xe6, + 0xd3, 0xa9, 0xed, 0x45, 0xd1, 0x94, 0xfa, 0x9e, 0xa0, 0x9c, 0xd9, 0x62, 0x11, 0x11, 0xb0, 0xa2, + 0x98, 0x0b, 0x8e, 0xeb, 0x99, 0xc2, 0xca, 0x29, 0x9a, 0xf5, 0x90, 0x87, 0x3c, 0x15, 0xd8, 0xc9, + 0x93, 0xd4, 0x36, 0x0d, 0x9f, 0xc3, 0x19, 0x07, 0x7b, 0xe4, 0x01, 0xb1, 0xe7, 0x87, 0x23, 0x22, + 0xbc, 0x43, 0xdb, 0xe7, 0x94, 0xa9, 0x7a, 0x43, 0xd6, 0x5d, 0x69, 0x94, 0x2f, 0xaa, 0xf4, 0x6c, + 0x0d, 0x02, 0x63, 0x2f, 0x26, 0x81, 0x0d, 0x24, 0x9e, 0x53, 0x9f, 0xc8, 0x72, 0xeb, 0x77, 0x05, + 0x55, 0x7b, 0x37, 0xff, 0x8f, 0xbb, 0x68, 0xd7, 0x0b, 0x82, 0x98, 0x00, 0xe8, 0x9a, 0xa9, 0xb5, + 0xf7, 0xfa, 0xfa, 0xdf, 0x3f, 0x9d, 0xba, 0xea, 0xd8, 0x93, 0x95, 0xa1, 0x88, 0x29, 0x0b, 0x9d, + 0x4c, 0x88, 0x6d, 0x54, 0x01, 0xe1, 0x4d, 0x88, 0x5e, 0x34, 0xb5, 0x76, 0xb5, 0xdb, 0xb0, 0x94, + 0x3c, 0xa1, 0xb5, 0x14, 0xad, 0x35, 0xe0, 0x94, 0x39, 0x52, 0x87, 0x1d, 0xb4, 0xaf, 0x28, 0x5c, + 0x9f, 0xb3, 0x53, 0x1a, 0x82, 0x5e, 0x32, 0x4b, 0xed, 0x6a, 0xf7, 0x85, 0xb5, 0x1e, 0x8a, 0xa4, + 0xb5, 0x72, 0x6c, 0x43, 0x69, 0x19, 0xa4, 0x0e, 0xe7, 0x01, 0xe4, 0x5f, 0x01, 0x7f, 0x47, 0x4f, + 0x02, 0x32, 0x25, 0xa1, 0x27, 0x08, 0x71, 0x93, 0xdf, 0x73, 0x6f, 0xe1, 0x2a, 0x42, 0x02, 0x7a, + 0xd9, 0x2c, 0xb5, 0xf7, 0xfa, 0x4f, 0x2f, 0xfe, 0x3d, 0x2f, 0x6c, 0xdd, 0x50, 0x63, 0xdd, 0xe0, + 0xbd, 0xf4, 0xf7, 0x32, 0x3b, 0x9e, 0xa3, 0xc7, 0x11, 0x61, 0x01, 0x65, 0xa1, 0x3b, 0x63, 0x4a, + 0x46, 0x39, 0x03, 0xbd, 0x92, 0x72, 0x1f, 0x59, 0x9b, 0xc2, 0xcc, 0xc3, 0x5b, 0x9f, 0xa4, 0xfd, + 0x4b, 0xde, 0x7d, 0xcc, 0x44, 0xbc, 0xe8, 0x97, 0x13, 0x28, 0xa7, 0x1e, 0x6d, 0x10, 0xe0, 0x23, + 0xd4, 0x9c, 0xb1, 0x74, 0x68, 0x2e, 0x10, 0x00, 0xca, 0x99, 0x4b, 0x58, 0xe0, 0x8e, 0x09, 0x0d, + 0xc7, 0x42, 0xdf, 0x31, 0xb5, 0x76, 0xd9, 0x39, 0x50, 0x8a, 0xa1, 0x14, 0x1c, 0xb3, 0xe0, 0x43, + 0x5a, 0xc6, 0xdf, 0x50, 0x2d, 0x83, 0x16, 0xb1, 0xc7, 0xe0, 0x94, 0xc4, 0xfa, 0x6e, 0x1a, 0xd1, + 0xab, 0xcd, 0xbc, 0x8a, 0x31, 0x87, 0xfd, 0x59, 0xf9, 0x9c, 0x7d, 0xd5, 0x29, 0x5b, 0x68, 0xce, + 0x51, 0x63, 0xeb, 0x96, 0x70, 0x0d, 0x95, 0x26, 0x64, 0x91, 0x9e, 0xa0, 0xb2, 0x93, 0x3c, 0xe2, + 0x01, 0xaa, 0xcc, 0xbd, 0xe9, 0x2c, 0x3b, 0x23, 0x9d, 0xcd, 0x00, 0x37, 0xad, 0x58, 0xa8, 0x32, + 0xf8, 0x48, 0x41, 0x38, 0xd2, 0xfb, 0xae, 0xf8, 0x56, 0x6b, 0x05, 0xe8, 0x60, 0x8b, 0x0a, 0x9f, + 0xa0, 0x87, 0x77, 0x83, 0x2f, 0xde, 0x23, 0xf8, 0x5a, 0x78, 0x2b, 0xef, 0xd6, 0x2f, 0x0d, 0x35, + 0xb7, 0x4f, 0x03, 0x9f, 0xa0, 0x47, 0x01, 0x01, 0x41, 0x59, 0xba, 0xec, 0xde, 0xf7, 0x8b, 0xc1, + 0x39, 0x93, 0xaa, 0xe0, 0x97, 0x08, 0x6f, 0x48, 0xb6, 0x98, 0x4e, 0xae, 0x06, 0xb7, 0x22, 0xed, + 0x3b, 0x17, 0x4b, 0x43, 0xbb, 0x5c, 0x1a, 0xda, 0xd5, 0xd2, 0xd0, 0xfe, 0x2f, 0x0d, 0xed, 0xe7, + 0xca, 0x28, 0x5c, 0xae, 0x8c, 0xc2, 0xd5, 0xca, 0x28, 0x7c, 0x7d, 0x13, 0x52, 0x31, 0x9e, 0x8d, + 0x2c, 0x9f, 0x9f, 0xd9, 0xc9, 0x7c, 0x3b, 0x8c, 0x88, 0x73, 0x1e, 0x4f, 0xec, 0xf5, 0x1d, 0xf0, + 0xe3, 0xee, 0x75, 0x34, 0xda, 0x49, 0x6f, 0x82, 0xd7, 0xd7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8c, + 0x2e, 0xfc, 0xb7, 0xb3, 0x04, 0x00, 0x00, } func (m *Application) Marshal() (dAtA []byte, err error) { @@ -228,6 +292,18 @@ func (m *Application) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.PendingTransfer != nil { + { + size, err := m.PendingTransfer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.UnstakeSessionEndHeight != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.UnstakeSessionEndHeight)) i-- @@ -337,6 +413,41 @@ func (m *UndelegatingGatewayList) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *PendingApplicationTransfer) 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 *PendingApplicationTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PendingApplicationTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SessionEndHeight != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SessionEndHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.DestinationAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -386,6 +497,10 @@ func (m *Application) Size() (n int) { if m.UnstakeSessionEndHeight != 0 { n += 1 + sovTypes(uint64(m.UnstakeSessionEndHeight)) } + if m.PendingTransfer != nil { + l = m.PendingTransfer.Size() + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -404,6 +519,22 @@ func (m *UndelegatingGatewayList) Size() (n int) { return n } +func (m *PendingApplicationTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DestinationAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SessionEndHeight != 0 { + n += 1 + sovTypes(uint64(m.SessionEndHeight)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -707,6 +838,42 @@ func (m *Application) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingTransfer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PendingTransfer == nil { + m.PendingTransfer = &PendingApplicationTransfer{} + } + if err := m.PendingTransfer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -810,6 +977,107 @@ func (m *UndelegatingGatewayList) Unmarshal(dAtA []byte) error { } return nil } +func (m *PendingApplicationTransfer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PendingApplicationTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PendingApplicationTransfer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) + } + m.SessionEndHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SessionEndHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gateway/keeper/msg_server_stake_gateway.go b/x/gateway/keeper/msg_server_stake_gateway.go index bba203661..7d500ce1a 100644 --- a/x/gateway/keeper/msg_server_stake_gateway.go +++ b/x/gateway/keeper/msg_server_stake_gateway.go @@ -79,7 +79,9 @@ func (k msgServer) StakeGateway( logger.Info(fmt.Sprintf("Successfully updated stake for gateway: %+v", gateway)) isSuccessful = true - return &types.MsgStakeGatewayResponse{}, nil + return &types.MsgStakeGatewayResponse{ + Gateway: &gateway, + }, nil } func (k msgServer) createGateway( diff --git a/x/gateway/types/tx.pb.go b/x/gateway/types/tx.pb.go index 425361733..63c23783d 100644 --- a/x/gateway/types/tx.pb.go +++ b/x/gateway/types/tx.pb.go @@ -167,6 +167,7 @@ func (m *MsgStakeGateway) GetStake() *types.Coin { } type MsgStakeGatewayResponse struct { + Gateway *Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway,omitempty"` } func (m *MsgStakeGatewayResponse) Reset() { *m = MsgStakeGatewayResponse{} } @@ -198,6 +199,13 @@ func (m *MsgStakeGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeGatewayResponse proto.InternalMessageInfo +func (m *MsgStakeGatewayResponse) GetGateway() *Gateway { + if m != nil { + return m.Gateway + } + return nil +} + type MsgUnstakeGateway struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } @@ -382,43 +390,44 @@ func init() { func init() { proto.RegisterFile("poktroll/gateway/tx.proto", fileDescriptor_7ad4b0c5e3b59f23) } var fileDescriptor_7ad4b0c5e3b59f23 = []byte{ - // 564 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xce, 0x11, 0x9a, 0x2a, 0xd7, 0x28, 0xd0, 0x53, 0x45, 0x12, 0x23, 0x4c, 0x08, 0x4b, 0x08, - 0xaa, 0xaf, 0x09, 0x82, 0x21, 0x4c, 0x84, 0x01, 0x09, 0xa9, 0x08, 0xa5, 0x74, 0x00, 0x55, 0xaa, - 0xce, 0xc9, 0xc9, 0xb5, 0x52, 0xfb, 0x2c, 0xdf, 0xf5, 0x47, 0x36, 0x84, 0x40, 0x48, 0x4c, 0xfc, - 0x19, 0x8c, 0x19, 0x58, 0xd9, 0x3b, 0x56, 0x4c, 0x9d, 0x10, 0x4a, 0x86, 0xfc, 0x1b, 0xc8, 0xbe, - 0xb3, 0x1b, 0x3b, 0x81, 0x20, 0x58, 0x12, 0xfb, 0xbd, 0xef, 0x7d, 0xef, 0x7b, 0xef, 0xbe, 0x33, - 0xac, 0x78, 0x6c, 0x20, 0x7c, 0x76, 0x78, 0x88, 0x2d, 0x22, 0xe8, 0x09, 0x19, 0x62, 0x71, 0x6a, - 0x78, 0x3e, 0x13, 0x0c, 0x5d, 0x8f, 0x52, 0x86, 0x4a, 0x69, 0xeb, 0xc4, 0xb1, 0x5d, 0x86, 0xc3, - 0x5f, 0x09, 0xd2, 0x4a, 0x3d, 0xc6, 0x1d, 0xc6, 0xb1, 0xc3, 0x2d, 0x7c, 0xdc, 0x0c, 0xfe, 0x54, - 0xa2, 0x22, 0x13, 0xfb, 0xe1, 0x1b, 0x96, 0x2f, 0x2a, 0xb5, 0x61, 0x31, 0x8b, 0xc9, 0x78, 0xf0, - 0xa4, 0xa2, 0xba, 0x62, 0x32, 0x09, 0xa7, 0xf8, 0xb8, 0x69, 0x52, 0x41, 0x9a, 0xb8, 0xc7, 0x6c, - 0x57, 0xe5, 0x6f, 0xcd, 0x29, 0xf5, 0x88, 0x4f, 0x1c, 0x45, 0x5a, 0xfb, 0x06, 0xe0, 0xb5, 0x6d, - 0x6e, 0xed, 0x7a, 0x7d, 0x22, 0xe8, 0xcb, 0x30, 0x83, 0x1e, 0xc1, 0x3c, 0x39, 0x12, 0x07, 0xcc, - 0xb7, 0xc5, 0xb0, 0x0c, 0xaa, 0xa0, 0x9e, 0xef, 0x94, 0xbf, 0x7f, 0xdd, 0xdc, 0x50, 0x6a, 0x9e, - 0xf4, 0xfb, 0x3e, 0xe5, 0x7c, 0x47, 0xf8, 0xb6, 0x6b, 0x75, 0x2f, 0xa1, 0xe8, 0x31, 0xcc, 0x49, - 0xee, 0xf2, 0x95, 0x2a, 0xa8, 0xaf, 0xb5, 0xca, 0x46, 0x7a, 0x15, 0x86, 0xec, 0xd0, 0xc9, 0x9f, - 0xfd, 0xb8, 0x9d, 0xf9, 0x32, 0x1d, 0x35, 0x40, 0x57, 0x95, 0xb4, 0x1f, 0xbe, 0x9b, 0x8e, 0x1a, - 0x97, 0x64, 0x9f, 0xa6, 0xa3, 0x46, 0x2d, 0x96, 0x7e, 0x1a, 0x8b, 0x4f, 0x69, 0xad, 0x55, 0x60, - 0x29, 0x15, 0xea, 0x52, 0xee, 0x31, 0x97, 0xd3, 0xda, 0x7b, 0x39, 0xda, 0x8e, 0x20, 0x03, 0xfa, - 0x4c, 0x96, 0xa3, 0x16, 0x5c, 0x25, 0x52, 0xfe, 0xd2, 0xc1, 0x22, 0x20, 0xc2, 0x70, 0x85, 0x07, - 0x1c, 0x6a, 0xaa, 0x8a, 0xa1, 0xe0, 0xc1, 0xc6, 0x0d, 0xb5, 0x71, 0xe3, 0x29, 0xb3, 0xdd, 0xae, - 0xc4, 0xb5, 0x0b, 0xc1, 0x28, 0x51, 0xb9, 0x52, 0x38, 0xab, 0x22, 0x56, 0xb8, 0x0b, 0xd7, 0x03, - 0xf1, 0x2e, 0xff, 0x4f, 0x89, 0xa9, 0x8e, 0x37, 0x61, 0x65, 0x8e, 0x36, 0xee, 0xf9, 0x01, 0xc0, - 0x62, 0x72, 0x63, 0xff, 0x7c, 0xde, 0x08, 0x5e, 0x75, 0x89, 0x23, 0xf7, 0x92, 0xef, 0x86, 0xcf, - 0xa8, 0x04, 0x57, 0x09, 0xdf, 0x17, 0x43, 0x8f, 0x96, 0xb3, 0x61, 0x38, 0x47, 0xf8, 0xab, 0xa1, - 0x47, 0xdb, 0xc5, 0xe4, 0xf9, 0xd6, 0x9e, 0xc3, 0x1b, 0x49, 0x19, 0x91, 0x42, 0xb4, 0x15, 0xdb, - 0x08, 0xfc, 0xd9, 0x46, 0x91, 0x77, 0x5a, 0x1f, 0xb3, 0x30, 0xbb, 0xcd, 0x2d, 0xb4, 0x07, 0x0b, - 0x09, 0x23, 0xdf, 0x99, 0xaf, 0x4c, 0x99, 0x45, 0xbb, 0xb7, 0x14, 0x12, 0xeb, 0xda, 0x83, 0x85, - 0x84, 0x97, 0x16, 0xb3, 0xcf, 0x42, 0x7e, 0xc3, 0xbe, 0xc8, 0x0b, 0xc8, 0x84, 0xc5, 0x94, 0x11, - 0xee, 0x2e, 0x96, 0x96, 0x00, 0x69, 0xf7, 0xff, 0x02, 0x14, 0xf7, 0x78, 0x0d, 0xd7, 0x66, 0xcf, - 0xbd, 0xba, 0x6c, 0x76, 0xad, 0xbe, 0x0c, 0x11, 0x51, 0x6b, 0x2b, 0x6f, 0x83, 0xdb, 0xdc, 0x79, - 0x71, 0x36, 0xd6, 0xc1, 0xf9, 0x58, 0x07, 0x17, 0x63, 0x1d, 0xfc, 0x1c, 0xeb, 0xe0, 0xf3, 0x44, - 0xcf, 0x9c, 0x4f, 0xf4, 0xcc, 0xc5, 0x44, 0xcf, 0xbc, 0xd9, 0xb2, 0x6c, 0x71, 0x70, 0x64, 0x1a, - 0x3d, 0xe6, 0xe0, 0x80, 0x78, 0xd3, 0xa5, 0xe2, 0x84, 0xf9, 0x03, 0xbc, 0xe0, 0xa2, 0x07, 0x16, - 0xe2, 0x66, 0x2e, 0xfc, 0x4a, 0x3d, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xf2, 0xee, 0xa1, - 0x70, 0x05, 0x00, 0x00, + // 589 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, + 0x1c, 0xcd, 0x7d, 0xf3, 0x6d, 0xa2, 0x5c, 0xa3, 0x40, 0xad, 0x8a, 0x24, 0x06, 0x4c, 0x30, 0x4b, + 0x08, 0xaa, 0xaf, 0x49, 0x05, 0x43, 0x98, 0x08, 0x03, 0x12, 0x52, 0x2b, 0x94, 0xd2, 0x01, 0x54, + 0xa9, 0xba, 0x24, 0x27, 0xd7, 0x4a, 0xed, 0xb3, 0x7c, 0xd7, 0x1f, 0xd9, 0x10, 0x02, 0x21, 0x31, + 0xf1, 0x67, 0x30, 0x66, 0x60, 0x65, 0xef, 0x58, 0x31, 0x75, 0x42, 0x28, 0x19, 0xf2, 0x6f, 0x20, + 0xfb, 0xce, 0x6e, 0x6c, 0x07, 0x82, 0x60, 0x49, 0x7c, 0xf7, 0x79, 0x9f, 0x77, 0xef, 0x7d, 0xee, + 0xe9, 0x60, 0xd5, 0xa5, 0x43, 0xee, 0xd1, 0xa3, 0x23, 0x64, 0x62, 0x4e, 0x4e, 0xf1, 0x08, 0xf1, + 0x33, 0xc3, 0xf5, 0x28, 0xa7, 0xca, 0xf5, 0xb0, 0x64, 0xc8, 0x92, 0xba, 0x86, 0x6d, 0xcb, 0xa1, + 0x28, 0xf8, 0x15, 0x20, 0xb5, 0xdc, 0xa7, 0xcc, 0xa6, 0x0c, 0xd9, 0xcc, 0x44, 0x27, 0x4d, 0xff, + 0x4f, 0x16, 0xaa, 0xa2, 0x70, 0x10, 0xac, 0x90, 0x58, 0xc8, 0xd2, 0xba, 0x49, 0x4d, 0x2a, 0xf6, + 0xfd, 0x2f, 0xb9, 0xab, 0x49, 0xa6, 0x1e, 0x66, 0x04, 0x9d, 0x34, 0x7b, 0x84, 0xe3, 0x26, 0xea, + 0x53, 0xcb, 0x91, 0xf5, 0xdb, 0x29, 0xa5, 0x2e, 0xf6, 0xb0, 0x1d, 0x92, 0xde, 0x4a, 0x1b, 0x19, + 0xb9, 0x44, 0x56, 0xf5, 0xaf, 0x00, 0x5e, 0xdb, 0x66, 0xe6, 0x9e, 0x3b, 0xc0, 0x9c, 0xbc, 0x08, + 0xfa, 0x94, 0x47, 0xb0, 0x80, 0x8f, 0xf9, 0x21, 0xf5, 0x2c, 0x3e, 0xaa, 0x80, 0x1a, 0xa8, 0x17, + 0x3a, 0x95, 0x6f, 0x5f, 0x36, 0xd6, 0xa5, 0xd6, 0x27, 0x83, 0x81, 0x47, 0x18, 0xdb, 0xe5, 0x9e, + 0xe5, 0x98, 0xdd, 0x2b, 0xa8, 0xf2, 0x18, 0xe6, 0xc4, 0xc9, 0x95, 0xff, 0x6a, 0xa0, 0xbe, 0xda, + 0xaa, 0x18, 0xc9, 0x41, 0x19, 0xe2, 0x84, 0x4e, 0xe1, 0xfc, 0xfb, 0x9d, 0xcc, 0xe7, 0xd9, 0xb8, + 0x01, 0xba, 0xb2, 0xa5, 0xfd, 0xf0, 0xed, 0x6c, 0xdc, 0xb8, 0x22, 0xfb, 0x38, 0x1b, 0x37, 0xf4, + 0x48, 0xf9, 0x59, 0xa4, 0x3d, 0xa1, 0x55, 0xaf, 0xc2, 0x72, 0x62, 0xab, 0x4b, 0x98, 0x4b, 0x1d, + 0x46, 0xf4, 0x77, 0xc2, 0xda, 0x2e, 0xc7, 0x43, 0xf2, 0x4c, 0xb4, 0x2b, 0x2d, 0x98, 0xc7, 0x42, + 0xfe, 0x52, 0x63, 0x21, 0x50, 0x41, 0x70, 0x85, 0xf9, 0x1c, 0xd2, 0x55, 0xd5, 0x90, 0x70, 0xff, + 0x3e, 0x0c, 0x79, 0x1f, 0xc6, 0x53, 0x6a, 0x39, 0x5d, 0x81, 0x6b, 0x17, 0x7d, 0x2b, 0x61, 0xbb, + 0xbe, 0x13, 0x28, 0x9c, 0x57, 0x11, 0x2a, 0x54, 0xb6, 0x60, 0x5e, 0xfa, 0x0a, 0xd4, 0xf8, 0xdc, + 0xa9, 0x89, 0x85, 0x3d, 0x21, 0x52, 0xdf, 0x83, 0x6b, 0xbe, 0x63, 0x87, 0xfd, 0xa3, 0xaf, 0x84, + 0xcc, 0x9b, 0xb0, 0x9a, 0xa2, 0x8d, 0x46, 0xf9, 0x1e, 0xc0, 0x52, 0x7c, 0xcc, 0x7f, 0x1d, 0x12, + 0x05, 0xfe, 0xef, 0x60, 0x5b, 0x0c, 0xb3, 0xd0, 0x0d, 0xbe, 0x95, 0x32, 0xcc, 0x63, 0x76, 0xe0, + 0xc7, 0xb2, 0x92, 0x0d, 0xb6, 0x73, 0x98, 0xbd, 0x1c, 0xb9, 0xa4, 0x5d, 0x8a, 0x87, 0x42, 0x7f, + 0x0e, 0x6f, 0xc4, 0x65, 0x44, 0xa3, 0xdc, 0x8c, 0xb2, 0x07, 0x7e, 0x9f, 0xbd, 0x30, 0x70, 0xad, + 0x0f, 0x59, 0x98, 0xdd, 0x66, 0xa6, 0xb2, 0x0f, 0x8b, 0xb1, 0xf4, 0xdf, 0x4d, 0x77, 0x26, 0x12, + 0xa6, 0xde, 0x5f, 0x0a, 0x89, 0x74, 0xed, 0xc3, 0x62, 0x2c, 0x80, 0x8b, 0xd9, 0xe7, 0x21, 0xbf, + 0x60, 0x5f, 0x18, 0xa0, 0x1e, 0x2c, 0x25, 0x82, 0x70, 0x6f, 0xb1, 0xb4, 0x18, 0x48, 0x7d, 0xf0, + 0x07, 0xa0, 0xe8, 0x8c, 0x57, 0x70, 0x75, 0xfe, 0xde, 0x6b, 0xcb, 0xbc, 0xab, 0xf5, 0x65, 0x88, + 0x90, 0x5a, 0x5d, 0x79, 0xe3, 0x3f, 0x01, 0x9d, 0x9d, 0xf3, 0x89, 0x06, 0x2e, 0x26, 0x1a, 0xb8, + 0x9c, 0x68, 0xe0, 0xc7, 0x44, 0x03, 0x9f, 0xa6, 0x5a, 0xe6, 0x62, 0xaa, 0x65, 0x2e, 0xa7, 0x5a, + 0xe6, 0xf5, 0xa6, 0x69, 0xf1, 0xc3, 0xe3, 0x9e, 0xd1, 0xa7, 0x36, 0xf2, 0x89, 0x37, 0x1c, 0xc2, + 0x4f, 0xa9, 0x37, 0x44, 0x0b, 0x5e, 0x87, 0xe0, 0x65, 0xeb, 0xe5, 0x82, 0xa7, 0x6d, 0xeb, 0x67, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x69, 0x30, 0xf8, 0xc3, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -738,6 +747,18 @@ func (m *MsgStakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.Gateway != nil { + { + size, err := m.Gateway.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -931,6 +952,10 @@ func (m *MsgStakeGatewayResponse) Size() (n int) { } var l int _ = l + if m.Gateway != nil { + l = m.Gateway.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1308,6 +1333,42 @@ func (m *MsgStakeGatewayResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgStakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gateway == nil { + m.Gateway = &Gateway{} + } + if err := m.Gateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/shared/session.go b/x/shared/session.go index b264df0e8..3b2f8a459 100644 --- a/x/shared/session.go +++ b/x/shared/session.go @@ -161,3 +161,8 @@ func GetEarliestSupplierProofCommitHeight( func GetNextSessionStartHeight(sharedParams *sharedtypes.Params, queryHeight int64) int64 { return GetSessionEndHeight(sharedParams, queryHeight) + 1 } + +// IsSessionEndHeight returns true if the queryHeight is the last block of the session. +func IsSessionEndHeight(sharedParams *sharedtypes.Params, queryHeight int64) bool { + return queryHeight != GetSessionEndHeight(sharedParams, queryHeight) +} diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index 1a3198ee7..a7dec76a7 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -17,7 +17,7 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { currentHeight := sdkCtx.BlockHeight() // Only process unbonding suppliers at the end of the session. - if currentHeight != k.sharedKeeper.GetSessionEndHeight(ctx, currentHeight) { + if shared.IsSessionEndHeight(&sharedParams, currentHeight) { return nil }