From e143167b6155f822b9810ba66f1d9a2404d42fe9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 20 Sep 2024 13:31:27 +0200 Subject: [PATCH 1/2] Empty commit From bad0e8a13755e45f15d12475199fe32c177dd14d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 23 Sep 2024 10:52:08 +0200 Subject: [PATCH 2/2] [Application] feat: app stake transfer (#743) ## Summary - Add `MsgTransferApplicationStake`. - Implement application stake transfer to new "beneficiary" application (unstakes original application). ## Dependents - #788 - #789 ## Issue - #657 ## Type of change Select one or more: - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing **Documentation changes** (only if making doc changes) - [ ] `make docusaurus_start`; only needed if you make doc changes **Local Testing** (only if making code changes) - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - See [quickstart guide](https://dev.poktroll.com/developer_guide/quickstart) for instructions **PR Testing** (only if making code changes) - [x] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. - **THIS IS VERY EXPENSIVE**, so only do it after all the reviews are complete. - Optionally run `make trigger_ci` if you want to re-trigger tests without any code changes - If tests fail, try re-running failed tests only using the GitHub UI as shown [here](https://github.com/pokt-network/poktroll/assets/1892194/607984e9-0615-4569-9452-4c730190c1d2) ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [x] I have left TODOs throughout the codebase, if applicable --------- Co-authored-by: Daniel Olshansky --- api/poktroll/application/tx.pulsar.go | 1347 +++++++++++++++-- api/poktroll/application/tx_grpc.pb.go | 48 +- e2e/tests/stake_app_transfer.feature | 21 + e2e/tests/stake_app_transfer_steps_test.go | 51 + proto/poktroll/application/tx.proto | 36 +- .../msg_server_transfer_application_stake.go | 68 + ..._server_transfer_application_stake_test.go | 136 ++ x/application/module/autocli.go | 8 +- x/application/module/simulation.go | 23 + .../simulation/transfer_application_stake.go | 32 + x/application/types/codec.go | 3 + x/application/types/errors.go | 1 + .../message_transfer_application_stake.go | 40 + ...message_transfer_application_stake_test.go | 67 + x/application/types/tx.pb.go | 521 ++++++- 15 files changed, 2196 insertions(+), 206 deletions(-) create mode 100644 e2e/tests/stake_app_transfer.feature create mode 100644 e2e/tests/stake_app_transfer_steps_test.go create mode 100644 x/application/keeper/msg_server_transfer_application_stake.go create mode 100644 x/application/keeper/msg_server_transfer_application_stake_test.go create mode 100644 x/application/simulation/transfer_application_stake.go create mode 100644 x/application/types/message_transfer_application_stake.go create mode 100644 x/application/types/message_transfer_application_stake_test.go diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index d00a23849..4806798f4 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -4322,6 +4322,925 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) ProtoMethods() *protoi } } +var ( + md_MsgTransferApplicationStake protoreflect.MessageDescriptor + fd_MsgTransferApplicationStake_source_address protoreflect.FieldDescriptor + fd_MsgTransferApplicationStake_destination_address protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_tx_proto_init() + md_MsgTransferApplicationStake = File_poktroll_application_tx_proto.Messages().ByName("MsgTransferApplicationStake") + fd_MsgTransferApplicationStake_source_address = md_MsgTransferApplicationStake.Fields().ByName("source_address") + fd_MsgTransferApplicationStake_destination_address = md_MsgTransferApplicationStake.Fields().ByName("destination_address") +} + +var _ protoreflect.Message = (*fastReflection_MsgTransferApplicationStake)(nil) + +type fastReflection_MsgTransferApplicationStake MsgTransferApplicationStake + +func (x *MsgTransferApplicationStake) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgTransferApplicationStake)(x) +} + +func (x *MsgTransferApplicationStake) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_tx_proto_msgTypes[10] + 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_MsgTransferApplicationStake_messageType fastReflection_MsgTransferApplicationStake_messageType +var _ protoreflect.MessageType = fastReflection_MsgTransferApplicationStake_messageType{} + +type fastReflection_MsgTransferApplicationStake_messageType struct{} + +func (x fastReflection_MsgTransferApplicationStake_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgTransferApplicationStake)(nil) +} +func (x fastReflection_MsgTransferApplicationStake_messageType) New() protoreflect.Message { + return new(fastReflection_MsgTransferApplicationStake) +} +func (x fastReflection_MsgTransferApplicationStake_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTransferApplicationStake +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgTransferApplicationStake) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTransferApplicationStake +} + +// 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_MsgTransferApplicationStake) Type() protoreflect.MessageType { + return _fastReflection_MsgTransferApplicationStake_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgTransferApplicationStake) New() protoreflect.Message { + return new(fastReflection_MsgTransferApplicationStake) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgTransferApplicationStake) Interface() protoreflect.ProtoMessage { + return (*MsgTransferApplicationStake)(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_MsgTransferApplicationStake) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.SourceAddress != "" { + value := protoreflect.ValueOfString(x.SourceAddress) + if !f(fd_MsgTransferApplicationStake_source_address, value) { + return + } + } + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_MsgTransferApplicationStake_destination_address, 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_MsgTransferApplicationStake) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + return x.SourceAddress != "" + case "poktroll.application.MsgTransferApplicationStake.destination_address": + return x.DestinationAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + x.SourceAddress = "" + case "poktroll.application.MsgTransferApplicationStake.destination_address": + x.DestinationAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + value := x.SourceAddress + return protoreflect.ValueOfString(value) + case "poktroll.application.MsgTransferApplicationStake.destination_address": + value := x.DestinationAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + x.SourceAddress = value.Interface().(string) + case "poktroll.application.MsgTransferApplicationStake.destination_address": + x.DestinationAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + panic(fmt.Errorf("field source_address of message poktroll.application.MsgTransferApplicationStake is not mutable")) + case "poktroll.application.MsgTransferApplicationStake.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.MsgTransferApplicationStake is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStake.source_address": + return protoreflect.ValueOfString("") + case "poktroll.application.MsgTransferApplicationStake.destination_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStake 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_MsgTransferApplicationStake) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.MsgTransferApplicationStake", 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_MsgTransferApplicationStake) 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_MsgTransferApplicationStake) 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_MsgTransferApplicationStake) 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_MsgTransferApplicationStake) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgTransferApplicationStake) + 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.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().(*MsgTransferApplicationStake) + 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.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().(*MsgTransferApplicationStake) + 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: MsgTransferApplicationStake: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTransferApplicationStake: 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 + 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_MsgTransferApplicationStakeResponse protoreflect.MessageDescriptor + fd_MsgTransferApplicationStakeResponse_application protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_application_tx_proto_init() + md_MsgTransferApplicationStakeResponse = File_poktroll_application_tx_proto.Messages().ByName("MsgTransferApplicationStakeResponse") + fd_MsgTransferApplicationStakeResponse_application = md_MsgTransferApplicationStakeResponse.Fields().ByName("application") +} + +var _ protoreflect.Message = (*fastReflection_MsgTransferApplicationStakeResponse)(nil) + +type fastReflection_MsgTransferApplicationStakeResponse MsgTransferApplicationStakeResponse + +func (x *MsgTransferApplicationStakeResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgTransferApplicationStakeResponse)(x) +} + +func (x *MsgTransferApplicationStakeResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_application_tx_proto_msgTypes[11] + 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_MsgTransferApplicationStakeResponse_messageType fastReflection_MsgTransferApplicationStakeResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgTransferApplicationStakeResponse_messageType{} + +type fastReflection_MsgTransferApplicationStakeResponse_messageType struct{} + +func (x fastReflection_MsgTransferApplicationStakeResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgTransferApplicationStakeResponse)(nil) +} +func (x fastReflection_MsgTransferApplicationStakeResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgTransferApplicationStakeResponse) +} +func (x fastReflection_MsgTransferApplicationStakeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTransferApplicationStakeResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgTransferApplicationStakeResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTransferApplicationStakeResponse +} + +// 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_MsgTransferApplicationStakeResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgTransferApplicationStakeResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgTransferApplicationStakeResponse) New() protoreflect.Message { + return new(fastReflection_MsgTransferApplicationStakeResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgTransferApplicationStakeResponse) Interface() protoreflect.ProtoMessage { + return (*MsgTransferApplicationStakeResponse)(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_MsgTransferApplicationStakeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgTransferApplicationStakeResponse_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_MsgTransferApplicationStakeResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.application": + return x.Application != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.application": + x.Application = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.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.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.application": + x.Application = value.Message().Interface().(*Application) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.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.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.application.MsgTransferApplicationStakeResponse.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.MsgTransferApplicationStakeResponse")) + } + panic(fmt.Errorf("message poktroll.application.MsgTransferApplicationStakeResponse 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_MsgTransferApplicationStakeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.application.MsgTransferApplicationStakeResponse", 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_MsgTransferApplicationStakeResponse) 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_MsgTransferApplicationStakeResponse) 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_MsgTransferApplicationStakeResponse) 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_MsgTransferApplicationStakeResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgTransferApplicationStakeResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Application != nil { + l = options.Size(x.Application) + 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().(*MsgTransferApplicationStakeResponse) + 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.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 { + 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().(*MsgTransferApplicationStakeResponse) + 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: MsgTransferApplicationStakeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTransferApplicationStakeResponse: 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:]) + 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 @@ -4686,6 +5605,84 @@ func (*MsgUndelegateFromGatewayResponse) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{9} } +type MsgTransferApplicationStake 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"` +} + +func (x *MsgTransferApplicationStake) Reset() { + *x = MsgTransferApplicationStake{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_tx_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgTransferApplicationStake) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgTransferApplicationStake) ProtoMessage() {} + +// Deprecated: Use MsgTransferApplicationStake.ProtoReflect.Descriptor instead. +func (*MsgTransferApplicationStake) Descriptor() ([]byte, []int) { + return file_poktroll_application_tx_proto_rawDescGZIP(), []int{10} +} + +func (x *MsgTransferApplicationStake) GetSourceAddress() string { + if x != nil { + return x.SourceAddress + } + return "" +} + +func (x *MsgTransferApplicationStake) GetDestinationAddress() string { + if x != nil { + return x.DestinationAddress + } + return "" +} + +type MsgTransferApplicationStakeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` +} + +func (x *MsgTransferApplicationStakeResponse) Reset() { + *x = MsgTransferApplicationStakeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_application_tx_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgTransferApplicationStakeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgTransferApplicationStakeResponse) ProtoMessage() {} + +// Deprecated: Use MsgTransferApplicationStakeResponse.ProtoReflect.Descriptor instead. +func (*MsgTransferApplicationStakeResponse) Descriptor() ([]byte, []int) { + return file_poktroll_application_tx_proto_rawDescGZIP(), []int{11} +} + +func (x *MsgTransferApplicationStakeResponse) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + var File_poktroll_application_tx_proto protoreflect.FileDescriptor var file_poktroll_application_tx_proto_rawDesc = []byte{ @@ -4700,122 +5697,151 @@ var file_poktroll_application_tx_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 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, 0x1a, 0x21, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 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, 0xc5, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, - 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0xcf, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x53, - 0x74, 0x61, 0x6b, 0x65, 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, 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, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 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, 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, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 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, 0x1a, 0x21, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 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, 0xc5, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x78, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0xcf, 0x01, 0x0a, 0x13, 0x4d, 0x73, + 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 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, 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, 0x12, 0x45, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 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, + 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, + 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, 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, + 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, 0xbe, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 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, 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, 0x32, 0xd2, 0x04, 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, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 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, 0x6a, 0x0a, 0x23, 0x4d, 0x73, 0x67, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 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, 0xdd, 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, 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, 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, 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, + 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, 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, 0x88, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 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, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x1a, 0x39, 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, 0x53, + 0x74, 0x61, 0x6b, 0x65, 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, 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, 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, + 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 ( @@ -4830,41 +5856,47 @@ func file_poktroll_application_tx_proto_rawDescGZIP() []byte { return file_poktroll_application_tx_proto_rawDescData } -var file_poktroll_application_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_poktroll_application_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_poktroll_application_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: poktroll.application.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: poktroll.application.MsgUpdateParamsResponse - (*MsgStakeApplication)(nil), // 2: poktroll.application.MsgStakeApplication - (*MsgStakeApplicationResponse)(nil), // 3: poktroll.application.MsgStakeApplicationResponse - (*MsgUnstakeApplication)(nil), // 4: poktroll.application.MsgUnstakeApplication - (*MsgUnstakeApplicationResponse)(nil), // 5: poktroll.application.MsgUnstakeApplicationResponse - (*MsgDelegateToGateway)(nil), // 6: poktroll.application.MsgDelegateToGateway - (*MsgDelegateToGatewayResponse)(nil), // 7: poktroll.application.MsgDelegateToGatewayResponse - (*MsgUndelegateFromGateway)(nil), // 8: poktroll.application.MsgUndelegateFromGateway - (*MsgUndelegateFromGatewayResponse)(nil), // 9: poktroll.application.MsgUndelegateFromGatewayResponse - (*Params)(nil), // 10: poktroll.application.Params - (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin - (*shared.ApplicationServiceConfig)(nil), // 12: poktroll.shared.ApplicationServiceConfig + (*MsgUpdateParams)(nil), // 0: poktroll.application.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.application.MsgUpdateParamsResponse + (*MsgStakeApplication)(nil), // 2: poktroll.application.MsgStakeApplication + (*MsgStakeApplicationResponse)(nil), // 3: poktroll.application.MsgStakeApplicationResponse + (*MsgUnstakeApplication)(nil), // 4: poktroll.application.MsgUnstakeApplication + (*MsgUnstakeApplicationResponse)(nil), // 5: poktroll.application.MsgUnstakeApplicationResponse + (*MsgDelegateToGateway)(nil), // 6: poktroll.application.MsgDelegateToGateway + (*MsgDelegateToGatewayResponse)(nil), // 7: poktroll.application.MsgDelegateToGatewayResponse + (*MsgUndelegateFromGateway)(nil), // 8: poktroll.application.MsgUndelegateFromGateway + (*MsgUndelegateFromGatewayResponse)(nil), // 9: poktroll.application.MsgUndelegateFromGatewayResponse + (*MsgTransferApplicationStake)(nil), // 10: poktroll.application.MsgTransferApplicationStake + (*MsgTransferApplicationStakeResponse)(nil), // 11: poktroll.application.MsgTransferApplicationStakeResponse + (*Params)(nil), // 12: poktroll.application.Params + (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin + (*shared.ApplicationServiceConfig)(nil), // 14: poktroll.shared.ApplicationServiceConfig + (*Application)(nil), // 15: poktroll.application.Application } var file_poktroll_application_tx_proto_depIdxs = []int32{ - 10, // 0: poktroll.application.MsgUpdateParams.params:type_name -> poktroll.application.Params - 11, // 1: poktroll.application.MsgStakeApplication.stake:type_name -> cosmos.base.v1beta1.Coin - 12, // 2: poktroll.application.MsgStakeApplication.services:type_name -> poktroll.shared.ApplicationServiceConfig - 0, // 3: poktroll.application.Msg.UpdateParams:input_type -> poktroll.application.MsgUpdateParams - 2, // 4: poktroll.application.Msg.StakeApplication:input_type -> poktroll.application.MsgStakeApplication - 4, // 5: poktroll.application.Msg.UnstakeApplication:input_type -> poktroll.application.MsgUnstakeApplication - 6, // 6: poktroll.application.Msg.DelegateToGateway:input_type -> poktroll.application.MsgDelegateToGateway - 8, // 7: poktroll.application.Msg.UndelegateFromGateway:input_type -> poktroll.application.MsgUndelegateFromGateway - 1, // 8: poktroll.application.Msg.UpdateParams:output_type -> poktroll.application.MsgUpdateParamsResponse - 3, // 9: poktroll.application.Msg.StakeApplication:output_type -> poktroll.application.MsgStakeApplicationResponse - 5, // 10: poktroll.application.Msg.UnstakeApplication:output_type -> poktroll.application.MsgUnstakeApplicationResponse - 7, // 11: poktroll.application.Msg.DelegateToGateway:output_type -> poktroll.application.MsgDelegateToGatewayResponse - 9, // 12: poktroll.application.Msg.UndelegateFromGateway:output_type -> poktroll.application.MsgUndelegateFromGatewayResponse - 8, // [8:13] is the sub-list for method output_type - 3, // [3:8] 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 + 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.MsgTransferApplicationStakeResponse.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.TransferApplicationStake:input_type -> poktroll.application.MsgTransferApplicationStake + 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.TransferApplicationStake:output_type -> poktroll.application.MsgTransferApplicationStakeResponse + 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 } func init() { file_poktroll_application_tx_proto_init() } @@ -4872,6 +5904,7 @@ func file_poktroll_application_tx_proto_init() { if File_poktroll_application_tx_proto != nil { return } + file_poktroll_application_types_proto_init() file_poktroll_application_params_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_application_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -4994,6 +6027,30 @@ func file_poktroll_application_tx_proto_init() { return nil } } + file_poktroll_application_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgTransferApplicationStake); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_application_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgTransferApplicationStakeResponse); 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{ @@ -5001,7 +6058,7 @@ func file_poktroll_application_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_application_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/application/tx_grpc.pb.go b/api/poktroll/application/tx_grpc.pb.go index b8a8e8cee..9fb5ba7e6 100644 --- a/api/poktroll/application/tx_grpc.pb.go +++ b/api/poktroll/application/tx_grpc.pb.go @@ -19,11 +19,12 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Msg_UpdateParams_FullMethodName = "/poktroll.application.Msg/UpdateParams" - Msg_StakeApplication_FullMethodName = "/poktroll.application.Msg/StakeApplication" - Msg_UnstakeApplication_FullMethodName = "/poktroll.application.Msg/UnstakeApplication" - Msg_DelegateToGateway_FullMethodName = "/poktroll.application.Msg/DelegateToGateway" - Msg_UndelegateFromGateway_FullMethodName = "/poktroll.application.Msg/UndelegateFromGateway" + Msg_UpdateParams_FullMethodName = "/poktroll.application.Msg/UpdateParams" + Msg_StakeApplication_FullMethodName = "/poktroll.application.Msg/StakeApplication" + Msg_UnstakeApplication_FullMethodName = "/poktroll.application.Msg/UnstakeApplication" + Msg_DelegateToGateway_FullMethodName = "/poktroll.application.Msg/DelegateToGateway" + Msg_UndelegateFromGateway_FullMethodName = "/poktroll.application.Msg/UndelegateFromGateway" + Msg_TransferApplicationStake_FullMethodName = "/poktroll.application.Msg/TransferApplicationStake" ) // MsgClient is the client API for Msg service. @@ -39,6 +40,7 @@ type MsgClient interface { UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) + TransferApplicationStake(ctx context.Context, in *MsgTransferApplicationStake, opts ...grpc.CallOption) (*MsgTransferApplicationStakeResponse, error) } type msgClient struct { @@ -99,6 +101,16 @@ func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegate return out, nil } +func (c *msgClient) TransferApplicationStake(ctx context.Context, in *MsgTransferApplicationStake, opts ...grpc.CallOption) (*MsgTransferApplicationStakeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgTransferApplicationStakeResponse) + err := c.cc.Invoke(ctx, Msg_TransferApplicationStake_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -112,6 +124,7 @@ type MsgServer interface { UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) + TransferApplicationStake(context.Context, *MsgTransferApplicationStake) (*MsgTransferApplicationStakeResponse, error) mustEmbedUnimplementedMsgServer() } @@ -134,6 +147,9 @@ func (UnimplementedMsgServer) DelegateToGateway(context.Context, *MsgDelegateToG func (UnimplementedMsgServer) UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") } +func (UnimplementedMsgServer) TransferApplicationStake(context.Context, *MsgTransferApplicationStake) (*MsgTransferApplicationStakeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferApplicationStake not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -237,6 +253,24 @@ func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Msg_TransferApplicationStake_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferApplicationStake) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferApplicationStake(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_TransferApplicationStake_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferApplicationStake(ctx, req.(*MsgTransferApplicationStake)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -264,6 +298,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UndelegateFromGateway", Handler: _Msg_UndelegateFromGateway_Handler, }, + { + MethodName: "TransferApplicationStake", + Handler: _Msg_TransferApplicationStake_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/application/tx.proto", diff --git a/e2e/tests/stake_app_transfer.feature b/e2e/tests/stake_app_transfer.feature new file mode 100644 index 000000000..34cf38d82 --- /dev/null +++ b/e2e/tests/stake_app_transfer.feature @@ -0,0 +1,21 @@ +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 "TransferApplicationStake" 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 new file mode 100644 index 000000000..56f2281c9 --- /dev/null +++ b/e2e/tests/stake_app_transfer_steps_test.go @@ -0,0 +1,51 @@ +//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/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index a208d0605..3d5256237 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -1,4 +1,5 @@ syntax = "proto3"; + package poktroll.application; option go_package = "github.com/pokt-network/poktroll/x/application/types"; @@ -9,27 +10,27 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "gogoproto/gogo.proto"; - +import "poktroll/application/types.proto"; import "poktroll/application/params.proto"; import "poktroll/shared/service.proto"; - // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. - rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); - rpc StakeApplication (MsgStakeApplication ) returns (MsgStakeApplicationResponse ); - rpc UnstakeApplication (MsgUnstakeApplication ) returns (MsgUnstakeApplicationResponse ); - rpc DelegateToGateway (MsgDelegateToGateway ) returns (MsgDelegateToGatewayResponse ); - rpc UndelegateFromGateway (MsgUndelegateFromGateway) returns (MsgUndelegateFromGatewayResponse); + rpc UpdateParams (MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc StakeApplication (MsgStakeApplication) returns (MsgStakeApplicationResponse); + rpc UnstakeApplication (MsgUnstakeApplication) returns (MsgUnstakeApplicationResponse); + rpc DelegateToGateway (MsgDelegateToGateway) returns (MsgDelegateToGatewayResponse); + rpc UndelegateFromGateway (MsgUndelegateFromGateway) returns (MsgUndelegateFromGatewayResponse); + rpc TransferApplicationStake (MsgTransferApplicationStake) returns (MsgTransferApplicationStakeResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "poktroll/x/application/MsgUpdateParams"; + option (amino.name) = "poktroll/x/application/MsgUpdateParams"; // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -49,10 +50,12 @@ message MsgUpdateParamsResponse {} message MsgStakeApplication { option (cosmos.msg.v1.signer) = "address"; - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. - cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the application has staked. Must be ≥ to the current amount that the application has staked (if any) + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. + cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the application has staked. Must be ≥ to the current amount that the application has staked (if any) repeated poktroll.shared.ApplicationServiceConfig services = 3; // The list of services this application is staked to request service for + // TODO_POST_MAINNET_CONSIDERATION: Consdier allowing appplications to delegate + // to gateways at time of staking for a better developer experience. + // repeated string gateway_addresss } message MsgStakeApplicationResponse {} @@ -68,7 +71,6 @@ message MsgDelegateToGateway { option (cosmos.msg.v1.signer) = "app_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries 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 wants to delegate to. - } message MsgDelegateToGatewayResponse {} @@ -81,3 +83,13 @@ message MsgUndelegateFromGateway { message MsgUndelegateFromGatewayResponse {} +message MsgTransferApplicationStake { + option (cosmos.msg.v1.signer) = "source_address"; + string source_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string destination_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +message MsgTransferApplicationStakeResponse { + poktroll.application.Application application = 1; +} + diff --git a/x/application/keeper/msg_server_transfer_application_stake.go b/x/application/keeper/msg_server_transfer_application_stake.go new file mode 100644 index 000000000..63e3cae03 --- /dev/null +++ b/x/application/keeper/msg_server_transfer_application_stake.go @@ -0,0 +1,68 @@ +package keeper + +import ( + "context" + "fmt" + + "github.com/pokt-network/poktroll/telemetry" + "github.com/pokt-network/poktroll/x/application/types" +) + +// TransferApplicationStake transfers the stake (held in escrow in the application +// module account) from a source to a (new) destination application account . +func (k msgServer) TransferApplicationStake(ctx context.Context, msg *types.MsgTransferApplicationStake) (*types.MsgTransferApplicationStakeResponse, error) { + isSuccessful := false + defer telemetry.EventSuccessCounter( + "transfer_application_stake", + telemetry.DefaultCounterFn, + func() bool { return isSuccessful }, + ) + + logger := k.Logger().With("method", "TransferApplicationStake") + + 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.MsgTransferApplicationStakeResponse{ + Application: &dstApp, + }, 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 new file mode 100644 index 000000000..2ef04012e --- /dev/null +++ b/x/application/keeper/msg_server_transfer_application_stake_test.go @@ -0,0 +1,136 @@ +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_TransferApplicationStake_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.NewMsgTransferApplicationStake(srcAddr, dstAddr) + + transferAppStakeRes, stakeTransferErr := srv.TransferApplicationStake(ctx, transferStakeMsg) + require.NoError(t, stakeTransferErr) + + // Verify that the destination app was created with the correct state. + srcApp, isSrcFound = k.GetApplication(ctx, dstAddr) + require.True(t, isSrcFound) + + 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, dstApp) + require.EqualValues(t, &dstApp, transferAppStakeRes.Application) + + // Verify that the source app was unstaked. + srcApp, isSrcFound = k.GetApplication(ctx, srcAddr) + require.False(t, isSrcFound) +} + +func TestMsgServer_TransferApplicationStake_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.NewMsgTransferApplicationStake(srcAddr, dstAddr) + + _, err = srv.TransferApplicationStake(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/module/autocli.go b/x/application/module/autocli.go index 404c8a366..e49c32622 100644 --- a/x/application/module/autocli.go +++ b/x/application/module/autocli.go @@ -46,7 +46,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Tx: &autocliv1.ServiceCommandDescriptor{ Service: modulev1.Msg_ServiceDesc.ServiceName, EnhanceCustomCommand: true, // only required if you want to use the custom command - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ // { // RpcMethod: "UpdateParams", // Skip: true, // skipped because authority gated @@ -97,6 +97,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { // $ poktrolld tx application undelegate-from-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, // PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "gateway_address"}}, // }, + { + RpcMethod: "TransferApplicationStake", + Use: "transfer [source app address] [destination app address]", + Short: "Transfer the application stake from [source app address] to [destination app address] and unstake the source application", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "source_address"}, {ProtoField: "destination_address"}}, + }, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/application/module/simulation.go b/x/application/module/simulation.go index 5c0bb42d7..77dd39ddb 100644 --- a/x/application/module/simulation.go +++ b/x/application/module/simulation.go @@ -39,6 +39,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgUndelegateFromGateway int = 100 + opWeightMsgTransferApplicationStake = "op_weight_msg_transfer_application_stake" + // TODO: Determine the simulation weight value + defaultWeightMsgTransferApplicationStake int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -111,6 +115,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp applicationsimulation.SimulateMsgUndelegateFromGateway(am.accountKeeper, am.bankKeeper, am.applicationKeeper), )) + var weightMsgTransferApplicationStake int + simState.AppParams.GetOrGenerate(opWeightMsgTransferApplicationStake, &weightMsgTransferApplicationStake, nil, + func(_ *rand.Rand) { + weightMsgTransferApplicationStake = defaultWeightMsgTransferApplicationStake + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgTransferApplicationStake, + applicationsimulation.SimulateMsgTransferApplicationStake(am.accountKeeper, am.bankKeeper, am.applicationKeeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -151,6 +166,14 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgTransferApplicationStake, + defaultWeightMsgTransferApplicationStake, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + applicationsimulation.SimulateMsgTransferApplicationStake(am.accountKeeper, am.bankKeeper, am.applicationKeeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/application/simulation/transfer_application_stake.go b/x/application/simulation/transfer_application_stake.go new file mode 100644 index 000000000..878cee4f4 --- /dev/null +++ b/x/application/simulation/transfer_application_stake.go @@ -0,0 +1,32 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/pokt-network/poktroll/x/application/keeper" + "github.com/pokt-network/poktroll/x/application/types" +) + +func SimulateMsgTransferApplicationStake( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simSrcAppAccount, _ := simtypes.RandomAcc(r, accs) + simDstAppAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgTransferApplicationStake{ + SourceAddress: simSrcAppAccount.Address.String(), + DestinationAddress: simDstAppAccount.Address.String(), + } + + // TODO: Handling the TransferApplicationStake simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "TransferApplicationStake simulation not implemented"), nil, nil + } +} diff --git a/x/application/types/codec.go b/x/application/types/codec.go index 0bb895958..d6496aa97 100644 --- a/x/application/types/codec.go +++ b/x/application/types/codec.go @@ -20,6 +20,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUndelegateFromGateway{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgTransferApplicationStake{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/application/types/errors.go b/x/application/types/errors.go index 67754829b..b20120506 100644 --- a/x/application/types/errors.go +++ b/x/application/types/errors.go @@ -19,4 +19,5 @@ var ( ErrAppInvalidMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1111, "invalid MaxDelegatedGateways parameter") 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") ) diff --git a/x/application/types/message_transfer_application_stake.go b/x/application/types/message_transfer_application_stake.go new file mode 100644 index 000000000..d8c49b17d --- /dev/null +++ b/x/application/types/message_transfer_application_stake.go @@ -0,0 +1,40 @@ +package types + +import ( + cosmostypes "github.com/cosmos/cosmos-sdk/types" +) + +var _ cosmostypes.Msg = (*MsgTransferApplicationStake)(nil) + +func NewMsgTransferApplicationStake(srcAddr string, dstAddr string) *MsgTransferApplicationStake { + return &MsgTransferApplicationStake{ + SourceAddress: srcAddr, + DestinationAddress: dstAddr, + } +} + +func (msg *MsgTransferApplicationStake) ValidateBasic() error { + if msg.GetSourceAddress() == "" { + return ErrAppInvalidAddress.Wrap("empty source application address") + } + + if msg.GetDestinationAddress() == "" { + return ErrAppInvalidAddress.Wrap("empty destination application address") + } + + _, srcBech32Err := cosmostypes.AccAddressFromBech32(msg.GetSourceAddress()) + if srcBech32Err != nil { + return ErrAppInvalidAddress.Wrapf("invalid source application address (%s): %v", msg.GetSourceAddress(), srcBech32Err) + } + + _, dstBech32Err := cosmostypes.AccAddressFromBech32(msg.GetDestinationAddress()) + if dstBech32Err != nil { + return ErrAppInvalidAddress.Wrapf("invalid destination application address (%s): %v", msg.GetDestinationAddress(), dstBech32Err) + } + + if msg.GetSourceAddress() == msg.GetDestinationAddress() { + return ErrAppDuplicateAddress.Wrapf("source and destination application addresses are the same: %s", msg.GetSourceAddress()) + } + + return nil +} diff --git a/x/application/types/message_transfer_application_stake_test.go b/x/application/types/message_transfer_application_stake_test.go new file mode 100644 index 000000000..3fe9a122c --- /dev/null +++ b/x/application/types/message_transfer_application_stake_test.go @@ -0,0 +1,67 @@ +package types + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" +) + +func TestMsgTransferApplicationStake_ValidateBasic(t *testing.T) { + dupAddr := sample.AccAddress() + + tests := []struct { + name string + msg MsgTransferApplicationStake + err error + }{ + { + name: "invalid duplicate source address", + msg: MsgTransferApplicationStake{ + SourceAddress: dupAddr, + DestinationAddress: dupAddr, + }, + err: ErrAppDuplicateAddress, + }, + { + name: "invalid bech32 source address", + msg: MsgTransferApplicationStake{ + SourceAddress: "invalid_address", + DestinationAddress: sample.AccAddress(), + }, + err: ErrAppInvalidAddress, + }, + { + name: "invalid bech32 destination address", + msg: MsgTransferApplicationStake{ + SourceAddress: sample.AccAddress(), + DestinationAddress: "invalid_address", + }, + err: ErrAppInvalidAddress, + }, + { + name: "valid source and destination addresses", + msg: MsgTransferApplicationStake{ + SourceAddress: sample.AccAddress(), + DestinationAddress: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + if strings.Contains(err.Error(), tt.msg.GetSourceAddress()) { + require.Contains(t, err.Error(), tt.msg.GetSourceAddress()) + } else { + require.Contains(t, err.Error(), tt.msg.GetDestinationAddress()) + } + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go index eb938d65d..849eaa17d 100644 --- a/x/application/types/tx.pb.go +++ b/x/application/types/tx.pb.go @@ -439,6 +439,94 @@ func (m *MsgUndelegateFromGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUndelegateFromGatewayResponse proto.InternalMessageInfo +type MsgTransferApplicationStake 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"` +} + +func (m *MsgTransferApplicationStake) Reset() { *m = MsgTransferApplicationStake{} } +func (m *MsgTransferApplicationStake) String() string { return proto.CompactTextString(m) } +func (*MsgTransferApplicationStake) ProtoMessage() {} +func (*MsgTransferApplicationStake) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{10} +} +func (m *MsgTransferApplicationStake) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferApplicationStake) 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 *MsgTransferApplicationStake) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferApplicationStake.Merge(m, src) +} +func (m *MsgTransferApplicationStake) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferApplicationStake) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferApplicationStake.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferApplicationStake proto.InternalMessageInfo + +func (m *MsgTransferApplicationStake) GetSourceAddress() string { + if m != nil { + return m.SourceAddress + } + return "" +} + +func (m *MsgTransferApplicationStake) GetDestinationAddress() string { + if m != nil { + return m.DestinationAddress + } + return "" +} + +type MsgTransferApplicationStakeResponse struct { + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` +} + +func (m *MsgTransferApplicationStakeResponse) Reset() { *m = MsgTransferApplicationStakeResponse{} } +func (m *MsgTransferApplicationStakeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferApplicationStakeResponse) ProtoMessage() {} +func (*MsgTransferApplicationStakeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bed224e38ab1cc6d, []int{11} +} +func (m *MsgTransferApplicationStakeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferApplicationStakeResponse) 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 *MsgTransferApplicationStakeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferApplicationStakeResponse.Merge(m, src) +} +func (m *MsgTransferApplicationStakeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferApplicationStakeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferApplicationStakeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferApplicationStakeResponse proto.InternalMessageInfo + +func (m *MsgTransferApplicationStakeResponse) GetApplication() *Application { + if m != nil { + return m.Application + } + return nil +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.application.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.application.MsgUpdateParamsResponse") @@ -450,54 +538,63 @@ func init() { proto.RegisterType((*MsgDelegateToGatewayResponse)(nil), "poktroll.application.MsgDelegateToGatewayResponse") proto.RegisterType((*MsgUndelegateFromGateway)(nil), "poktroll.application.MsgUndelegateFromGateway") proto.RegisterType((*MsgUndelegateFromGatewayResponse)(nil), "poktroll.application.MsgUndelegateFromGatewayResponse") + proto.RegisterType((*MsgTransferApplicationStake)(nil), "poktroll.application.MsgTransferApplicationStake") + proto.RegisterType((*MsgTransferApplicationStakeResponse)(nil), "poktroll.application.MsgTransferApplicationStakeResponse") } func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 670 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x4f, 0x13, 0x41, - 0x14, 0xef, 0x82, 0xa0, 0x3c, 0x88, 0xc0, 0x5a, 0x42, 0x59, 0x61, 0xa9, 0x4d, 0x34, 0x50, 0xc3, - 0x4e, 0x5a, 0x0c, 0x09, 0x5c, 0x08, 0xe0, 0x9f, 0x53, 0x13, 0x53, 0xf4, 0xe2, 0x85, 0x4c, 0xdb, - 0x71, 0xd8, 0xd0, 0xee, 0x4c, 0x76, 0x86, 0x02, 0x27, 0x8d, 0x47, 0x4f, 0x7e, 0x0a, 0x63, 0x3c, - 0x71, 0xf0, 0x2b, 0x98, 0x70, 0x93, 0x70, 0xe2, 0x64, 0x4c, 0x39, 0xf0, 0x35, 0xcc, 0x76, 0x66, - 0xb7, 0xb0, 0xdd, 0x4a, 0xb9, 0x79, 0x69, 0xbb, 0xf3, 0x7e, 0xef, 0xf7, 0xe7, 0xcd, 0xcc, 0x16, - 0xe6, 0x38, 0xdb, 0x93, 0x3e, 0xab, 0xd7, 0x11, 0xe6, 0xbc, 0xee, 0x56, 0xb1, 0x74, 0x99, 0x87, - 0xe4, 0xa1, 0xc3, 0x7d, 0x26, 0x99, 0x99, 0x0e, 0xcb, 0xce, 0x95, 0xb2, 0x35, 0x89, 0x1b, 0xae, - 0xc7, 0x50, 0xfb, 0x53, 0x01, 0xad, 0x99, 0x2a, 0x13, 0x0d, 0x26, 0x76, 0xda, 0x4f, 0x48, 0x3d, - 0xe8, 0x92, 0xad, 0x9e, 0x50, 0x05, 0x0b, 0x82, 0x9a, 0x85, 0x0a, 0x91, 0xb8, 0x80, 0xaa, 0xcc, - 0xf5, 0x74, 0x7d, 0x5a, 0xd7, 0x1b, 0x82, 0xa2, 0x66, 0x21, 0xf8, 0xd2, 0x85, 0x34, 0x65, 0x94, - 0x29, 0xc2, 0xe0, 0x97, 0x5e, 0x7d, 0x94, 0xe8, 0x98, 0x63, 0x1f, 0x37, 0x42, 0xc5, 0x4e, 0x28, - 0xb1, 0x8b, 0x7d, 0x52, 0x43, 0x82, 0xf8, 0x4d, 0xb7, 0x4a, 0x54, 0x39, 0xf7, 0xd3, 0x80, 0xf1, - 0x92, 0xa0, 0x6f, 0x79, 0x0d, 0x4b, 0xf2, 0xba, 0xdd, 0x68, 0xae, 0xc0, 0x08, 0xde, 0x97, 0xbb, - 0xcc, 0x77, 0xe5, 0x51, 0xc6, 0xc8, 0x1a, 0x0b, 0x23, 0x9b, 0x99, 0xb3, 0x1f, 0x4b, 0x69, 0x9d, - 0x64, 0xa3, 0x56, 0xf3, 0x89, 0x10, 0xdb, 0xd2, 0x77, 0x3d, 0x5a, 0xee, 0x40, 0xcd, 0x75, 0x18, - 0x56, 0xd2, 0x99, 0x81, 0xac, 0xb1, 0x30, 0x5a, 0x9c, 0x75, 0x92, 0x26, 0xe6, 0x28, 0x95, 0xcd, - 0x91, 0x93, 0xdf, 0xf3, 0xa9, 0x6f, 0x97, 0xc7, 0x79, 0xa3, 0xac, 0xdb, 0xd6, 0x56, 0x3f, 0x5d, - 0x1e, 0xe7, 0x3b, 0x84, 0x9f, 0x2f, 0x8f, 0xf3, 0x4f, 0x22, 0xfb, 0x87, 0xd7, 0x32, 0xc6, 0x3c, - 0xe7, 0x66, 0x60, 0x3a, 0xb6, 0x54, 0x26, 0x82, 0x33, 0x4f, 0x90, 0xdc, 0x2f, 0x03, 0x1e, 0x94, - 0x04, 0xdd, 0x96, 0x78, 0x8f, 0x6c, 0x74, 0x28, 0xcc, 0x22, 0xdc, 0xc5, 0x2a, 0xca, 0x8d, 0x21, - 0x43, 0xa0, 0x89, 0x60, 0x48, 0x04, 0x3c, 0x3a, 0xe1, 0x8c, 0xa3, 0xe1, 0xc1, 0x7e, 0x3a, 0x7a, - 0x3f, 0x9d, 0x2d, 0xe6, 0x7a, 0x65, 0x85, 0x33, 0x5f, 0xc0, 0x3d, 0x3d, 0x70, 0x91, 0x19, 0xcc, - 0x0e, 0x2e, 0x8c, 0x16, 0x17, 0x3b, 0x53, 0x51, 0x3b, 0xe2, 0x5c, 0x31, 0xb5, 0xad, 0xb0, 0x5b, - 0xcc, 0x7b, 0xef, 0xd2, 0x72, 0xd4, 0xba, 0x36, 0x16, 0x4c, 0x26, 0x74, 0x91, 0x9b, 0x83, 0x87, - 0x09, 0x81, 0xa2, 0xc0, 0xeb, 0x30, 0x15, 0xcc, 0xc2, 0x13, 0xf1, 0xc4, 0x99, 0x58, 0xe2, 0x28, - 0x57, 0x8c, 0x7f, 0x1e, 0xe6, 0x12, 0x09, 0x22, 0x85, 0xaf, 0x06, 0xa4, 0x4b, 0x82, 0x3e, 0x27, - 0x75, 0x42, 0xb1, 0x24, 0x6f, 0xd8, 0x2b, 0x2c, 0xc9, 0x01, 0x3e, 0x32, 0x57, 0x61, 0x14, 0x73, - 0xbe, 0xd3, 0xef, 0x5c, 0x01, 0x73, 0xae, 0x57, 0xcc, 0x0d, 0x18, 0xa7, 0x8a, 0x25, 0x6a, 0x1f, - 0xb8, 0xa1, 0xfd, 0xbe, 0x6e, 0xd0, 0xab, 0x6b, 0x13, 0x41, 0x8a, 0xab, 0x06, 0x72, 0x36, 0xcc, - 0x26, 0xf9, 0x8c, 0x82, 0x7c, 0x37, 0x20, 0xd3, 0x8e, 0x5a, 0xd3, 0x90, 0x97, 0x3e, 0x6b, 0xfc, - 0xaf, 0x61, 0x72, 0x90, 0xed, 0xe5, 0x35, 0x0c, 0x54, 0x3c, 0xbb, 0x03, 0x83, 0x25, 0x41, 0xcd, - 0x1a, 0x8c, 0x5d, 0xbb, 0xd3, 0x8f, 0x93, 0xef, 0x62, 0xec, 0xce, 0x58, 0x4b, 0x7d, 0xc1, 0x42, - 0x35, 0x93, 0xc3, 0x44, 0xd7, 0xb5, 0x5a, 0xec, 0x49, 0x11, 0x87, 0x5a, 0x85, 0xbe, 0xa1, 0x91, - 0x62, 0x13, 0xcc, 0x84, 0x83, 0xfd, 0xb4, 0xb7, 0xed, 0x2e, 0xb0, 0xb5, 0x7c, 0x0b, 0x70, 0xa4, - 0x2b, 0x60, 0xb2, 0xfb, 0xb4, 0xe7, 0x7b, 0x32, 0x75, 0x61, 0xad, 0x62, 0xff, 0xd8, 0x48, 0xf4, - 0x03, 0x4c, 0x25, 0x9f, 0x4c, 0xe7, 0x1f, 0x11, 0x12, 0xf0, 0xd6, 0xca, 0xed, 0xf0, 0xa1, 0x01, - 0x6b, 0xe8, 0x63, 0xf0, 0x7e, 0xde, 0x2c, 0x9f, 0xb4, 0x6c, 0xe3, 0xb4, 0x65, 0x1b, 0xe7, 0x2d, - 0xdb, 0xf8, 0xd3, 0xb2, 0x8d, 0x2f, 0x17, 0x76, 0xea, 0xf4, 0xc2, 0x4e, 0x9d, 0x5f, 0xd8, 0xa9, - 0x77, 0xcf, 0xa8, 0x2b, 0x77, 0xf7, 0x2b, 0x4e, 0x95, 0x35, 0x50, 0x20, 0xb3, 0xe4, 0x11, 0x79, - 0xc0, 0xfc, 0x3d, 0xd4, 0xe3, 0xd5, 0x2d, 0x8f, 0x38, 0x11, 0x95, 0xe1, 0xf6, 0xff, 0xcf, 0xf2, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x43, 0x0b, 0x7e, 0x75, 0x07, 0x00, 0x00, + // 776 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x4d, 0x4f, 0xdb, 0x4a, + 0x14, 0x86, 0x33, 0x20, 0xb8, 0x97, 0x13, 0x2e, 0x1f, 0x26, 0x88, 0xe0, 0x0b, 0x26, 0xe4, 0xea, + 0x56, 0x90, 0x0a, 0x5b, 0x09, 0x15, 0x12, 0x6c, 0x10, 0xd0, 0x0f, 0x75, 0x11, 0xa9, 0x0a, 0x74, + 0xd3, 0x0d, 0x9a, 0x24, 0x83, 0x71, 0x49, 0x3c, 0x96, 0x67, 0x08, 0xb0, 0x6a, 0xd5, 0x55, 0xd5, + 0x55, 0x7f, 0x45, 0x55, 0x75, 0xc5, 0xa2, 0xeb, 0xee, 0x2a, 0xb1, 0x2b, 0xea, 0x8a, 0x4d, 0xab, + 0x2a, 0x2c, 0xf8, 0x1b, 0x95, 0xed, 0xb1, 0x63, 0x1c, 0x1b, 0xc2, 0xae, 0x1b, 0xc8, 0xcc, 0x79, + 0xcf, 0x39, 0xef, 0x33, 0x33, 0x1e, 0x1b, 0x66, 0x2d, 0x7a, 0xc0, 0x6d, 0xda, 0x68, 0x68, 0xd8, + 0xb2, 0x1a, 0x46, 0x0d, 0x73, 0x83, 0x9a, 0x1a, 0x3f, 0x56, 0x2d, 0x9b, 0x72, 0x2a, 0x65, 0xfc, + 0xb0, 0x1a, 0x0a, 0xcb, 0xe3, 0xb8, 0x69, 0x98, 0x54, 0x73, 0xff, 0x7a, 0x42, 0x79, 0xba, 0x46, + 0x59, 0x93, 0xb2, 0x5d, 0x77, 0xa4, 0x79, 0x03, 0x11, 0x52, 0xbc, 0x91, 0x56, 0xc5, 0x8c, 0x68, + 0xad, 0x62, 0x95, 0x70, 0x5c, 0xd4, 0x6a, 0xd4, 0x30, 0x45, 0x7c, 0x4a, 0xc4, 0x9b, 0x4c, 0xd7, + 0x5a, 0x45, 0xe7, 0x9f, 0x08, 0x64, 0x74, 0xaa, 0x53, 0xaf, 0xa0, 0xf3, 0x4b, 0xcc, 0xe6, 0xe2, + 0x1d, 0x9f, 0x58, 0xc4, 0x6f, 0x38, 0x1f, 0xab, 0xb0, 0xb0, 0x8d, 0x9b, 0xbe, 0xa4, 0x83, 0xcd, + 0xf6, 0xb1, 0x4d, 0xea, 0x1a, 0x23, 0x76, 0xcb, 0xa8, 0x11, 0x2f, 0x9c, 0xff, 0x8a, 0x60, 0xb4, + 0xcc, 0xf4, 0xe7, 0x56, 0x1d, 0x73, 0xf2, 0xcc, 0x4d, 0x94, 0x56, 0x60, 0x08, 0x1f, 0xf2, 0x7d, + 0x6a, 0x1b, 0xfc, 0x24, 0x8b, 0x72, 0x68, 0x61, 0x68, 0x33, 0xfb, 0xfd, 0xf3, 0x52, 0x46, 0xb0, + 0x6e, 0xd4, 0xeb, 0x36, 0x61, 0x6c, 0x9b, 0xdb, 0x86, 0xa9, 0x57, 0x3a, 0x52, 0x69, 0x1d, 0x06, + 0xbd, 0xd6, 0xd9, 0xbe, 0x1c, 0x5a, 0x48, 0x97, 0x66, 0xd4, 0xb8, 0x35, 0x55, 0xbd, 0x2e, 0x9b, + 0x43, 0x67, 0x3f, 0xe7, 0x52, 0x1f, 0xaf, 0x4e, 0x0b, 0xa8, 0x22, 0xd2, 0xd6, 0x56, 0xdf, 0x5c, + 0x9d, 0x16, 0x3a, 0x05, 0xdf, 0x5d, 0x9d, 0x16, 0xee, 0x05, 0xf6, 0x8f, 0xaf, 0x31, 0x46, 0x3c, + 0xe7, 0xa7, 0x61, 0x2a, 0x32, 0x55, 0x21, 0xcc, 0xa2, 0x26, 0x23, 0xf9, 0x6f, 0x08, 0x26, 0xca, + 0x4c, 0xdf, 0xe6, 0xf8, 0x80, 0x6c, 0x74, 0x4a, 0x48, 0x25, 0xf8, 0x0b, 0x7b, 0x28, 0xb7, 0x42, + 0xfa, 0x42, 0x49, 0x83, 0x01, 0xe6, 0xd4, 0x11, 0x84, 0xd3, 0xaa, 0x90, 0x3b, 0x3b, 0xae, 0x8a, + 0x1d, 0x57, 0xb7, 0xa8, 0x61, 0x56, 0x3c, 0x9d, 0xf4, 0x08, 0xfe, 0x16, 0x0b, 0xce, 0xb2, 0xfd, + 0xb9, 0xfe, 0x85, 0x74, 0x69, 0xb1, 0xb3, 0x2a, 0xde, 0x8e, 0xa8, 0x21, 0x53, 0xdb, 0x9e, 0x76, + 0x8b, 0x9a, 0x7b, 0x86, 0x5e, 0x09, 0x52, 0xd7, 0x86, 0x9d, 0x95, 0xf1, 0x5d, 0xe4, 0x67, 0xe1, + 0xdf, 0x18, 0xa0, 0x00, 0x78, 0x1d, 0x26, 0x9d, 0xb5, 0x30, 0x59, 0x94, 0x38, 0x1b, 0x21, 0x0e, + 0xb8, 0x22, 0xf5, 0xe7, 0x60, 0x36, 0xb6, 0x40, 0xd0, 0xe1, 0x03, 0x82, 0x4c, 0x99, 0xe9, 0x0f, + 0x49, 0x83, 0xe8, 0x98, 0x93, 0x1d, 0xfa, 0x04, 0x73, 0x72, 0x84, 0x4f, 0xa4, 0x55, 0x48, 0x63, + 0xcb, 0xda, 0xed, 0x75, 0x5d, 0x01, 0x5b, 0x96, 0x98, 0x91, 0x36, 0x60, 0x54, 0xf7, 0xaa, 0x04, + 0xe9, 0x7d, 0xb7, 0xa4, 0x8f, 0x88, 0x04, 0x31, 0xbb, 0x36, 0xe6, 0x50, 0x84, 0x0d, 0xe4, 0x15, + 0x98, 0x89, 0xf3, 0x19, 0x80, 0x7c, 0x42, 0x90, 0x75, 0x51, 0xeb, 0x42, 0xf2, 0xd8, 0xa6, 0xcd, + 0x3f, 0x15, 0x26, 0x0f, 0xb9, 0x24, 0xaf, 0x01, 0xd0, 0x17, 0xe4, 0x9e, 0x8d, 0x1d, 0x1b, 0x9b, + 0x6c, 0x8f, 0xd8, 0xe1, 0xa3, 0xe5, 0x9e, 0xc7, 0x75, 0x18, 0x61, 0xf4, 0xd0, 0xae, 0x91, 0x9e, + 0xb1, 0xfe, 0xf1, 0xf4, 0x3e, 0xd9, 0x53, 0x98, 0xa8, 0x13, 0xc6, 0x0d, 0xd3, 0x2d, 0xda, 0x33, + 0x9d, 0x14, 0x4a, 0xf2, 0x09, 0x27, 0x1c, 0xc2, 0x88, 0x9d, 0xfc, 0x4b, 0xf8, 0xef, 0x06, 0xff, + 0x3e, 0xa7, 0xb4, 0xe5, 0xee, 0x8d, 0x1f, 0x73, 0x21, 0xd2, 0xa5, 0xf9, 0xf8, 0x0b, 0x27, 0x7c, + 0x82, 0xc3, 0x59, 0xa5, 0x1f, 0x03, 0xd0, 0x5f, 0x66, 0xba, 0x54, 0x87, 0xe1, 0x6b, 0x17, 0xe0, + 0xff, 0xf1, 0x75, 0x22, 0x17, 0x8c, 0xbc, 0xd4, 0x93, 0x2c, 0xb0, 0x6c, 0xc1, 0x58, 0xd7, 0x1d, + 0xb4, 0x98, 0x58, 0x22, 0x2a, 0x95, 0x8b, 0x3d, 0x4b, 0x83, 0x8e, 0x2d, 0x90, 0x62, 0x6e, 0x81, + 0xfb, 0xc9, 0xb6, 0xbb, 0xc4, 0xf2, 0xf2, 0x1d, 0xc4, 0x41, 0x5f, 0x06, 0xe3, 0xdd, 0x57, 0x43, + 0x21, 0xb1, 0x52, 0x97, 0x56, 0x2e, 0xf5, 0xae, 0x0d, 0x9a, 0xbe, 0x82, 0xc9, 0xf8, 0xc7, 0x58, + 0xbd, 0x01, 0x21, 0x46, 0x2f, 0xaf, 0xdc, 0x4d, 0x1f, 0x18, 0x78, 0x8b, 0x20, 0x9b, 0xf8, 0xdc, + 0x25, 0xef, 0x5e, 0x52, 0x8a, 0xbc, 0x7a, 0xe7, 0x14, 0xdf, 0x8a, 0x3c, 0xf0, 0xda, 0x79, 0xaf, + 0x6e, 0x56, 0xce, 0xda, 0x0a, 0x3a, 0x6f, 0x2b, 0xe8, 0xa2, 0xad, 0xa0, 0x5f, 0x6d, 0x05, 0xbd, + 0xbf, 0x54, 0x52, 0xe7, 0x97, 0x4a, 0xea, 0xe2, 0x52, 0x49, 0xbd, 0x78, 0xa0, 0x1b, 0x7c, 0xff, + 0xb0, 0xaa, 0xd6, 0x68, 0x53, 0x73, 0x3a, 0x2d, 0x99, 0x84, 0x1f, 0x51, 0xfb, 0x40, 0x4b, 0x78, + 0xe5, 0xba, 0x1f, 0x1e, 0xd5, 0x41, 0xf7, 0xbb, 0x61, 0xf9, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x8d, 0xda, 0xe1, 0xbe, 0x4f, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -519,6 +616,7 @@ type MsgClient interface { UnstakeApplication(ctx context.Context, in *MsgUnstakeApplication, opts ...grpc.CallOption) (*MsgUnstakeApplicationResponse, error) DelegateToGateway(ctx context.Context, in *MsgDelegateToGateway, opts ...grpc.CallOption) (*MsgDelegateToGatewayResponse, error) UndelegateFromGateway(ctx context.Context, in *MsgUndelegateFromGateway, opts ...grpc.CallOption) (*MsgUndelegateFromGatewayResponse, error) + TransferApplicationStake(ctx context.Context, in *MsgTransferApplicationStake, opts ...grpc.CallOption) (*MsgTransferApplicationStakeResponse, error) } type msgClient struct { @@ -574,6 +672,15 @@ func (c *msgClient) UndelegateFromGateway(ctx context.Context, in *MsgUndelegate return out, nil } +func (c *msgClient) TransferApplicationStake(ctx context.Context, in *MsgTransferApplicationStake, opts ...grpc.CallOption) (*MsgTransferApplicationStakeResponse, error) { + out := new(MsgTransferApplicationStakeResponse) + err := c.cc.Invoke(ctx, "/poktroll.application.Msg/TransferApplicationStake", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module @@ -583,6 +690,7 @@ type MsgServer interface { UnstakeApplication(context.Context, *MsgUnstakeApplication) (*MsgUnstakeApplicationResponse, error) DelegateToGateway(context.Context, *MsgDelegateToGateway) (*MsgDelegateToGatewayResponse, error) UndelegateFromGateway(context.Context, *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) + TransferApplicationStake(context.Context, *MsgTransferApplicationStake) (*MsgTransferApplicationStakeResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -604,6 +712,9 @@ func (*UnimplementedMsgServer) DelegateToGateway(ctx context.Context, req *MsgDe func (*UnimplementedMsgServer) UndelegateFromGateway(ctx context.Context, req *MsgUndelegateFromGateway) (*MsgUndelegateFromGatewayResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UndelegateFromGateway not implemented") } +func (*UnimplementedMsgServer) TransferApplicationStake(ctx context.Context, req *MsgTransferApplicationStake) (*MsgTransferApplicationStakeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferApplicationStake not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -699,6 +810,24 @@ func _Msg_UndelegateFromGateway_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Msg_TransferApplicationStake_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferApplicationStake) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferApplicationStake(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.application.Msg/TransferApplicationStake", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferApplicationStake(ctx, req.(*MsgTransferApplicationStake)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.application.Msg", HandlerType: (*MsgServer)(nil), @@ -723,6 +852,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UndelegateFromGateway", Handler: _Msg_UndelegateFromGateway_Handler, }, + { + MethodName: "TransferApplicationStake", + Handler: _Msg_TransferApplicationStake_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/application/tx.proto", @@ -1043,6 +1176,78 @@ func (m *MsgUndelegateFromGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } +func (m *MsgTransferApplicationStake) 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 *MsgTransferApplicationStake) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferApplicationStake) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintTx(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 = encodeVarintTx(dAtA, i, uint64(len(m.SourceAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferApplicationStakeResponse) 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 *MsgTransferApplicationStakeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferApplicationStakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1184,6 +1389,36 @@ func (m *MsgUndelegateFromGatewayResponse) Size() (n int) { return n } +func (m *MsgTransferApplicationStake) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourceAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DestinationAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferApplicationStakeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2017,6 +2252,206 @@ func (m *MsgUndelegateFromGatewayResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTransferApplicationStake) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferApplicationStake: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferApplicationStake: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferApplicationStakeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferApplicationStakeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferApplicationStakeResponse: 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:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0