From af4760607a9169668a7aa084acd28e19df4eb3f6 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 9 Dec 2024 10:43:27 +0100 Subject: [PATCH 1/6] [Code Health] Ensure supplier module msg responses are non-empty (#971) ## Summary Ensure all supplier module msg responses are non-empty. This adds a `Supplier` field to the following protobuf type(s), and updates the unit tests to assert for presence and correctness. - `MsgStakeSupplierResponse` - `MsgUnstakeSupplierResponse` ## Issue - #663 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [ ] 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 - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/supplier/tx.pulsar.go | 350 ++++++++++++++---- proto/poktroll/supplier/tx.proto | 9 +- .../keeper/msg_server_stake_supplier.go | 4 +- .../keeper/msg_server_unstake_supplier.go | 4 +- .../msg_server_unstake_supplier_test.go | 8 +- x/supplier/types/tx.pb.go | 209 ++++++++--- 6 files changed, 451 insertions(+), 133 deletions(-) diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index 1d2057b01..099b7a11a 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -1639,12 +1639,14 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { } var ( - md_MsgStakeSupplierResponse protoreflect.MessageDescriptor + md_MsgStakeSupplierResponse protoreflect.MessageDescriptor + fd_MsgStakeSupplierResponse_supplier protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_tx_proto_init() md_MsgStakeSupplierResponse = File_poktroll_supplier_tx_proto.Messages().ByName("MsgStakeSupplierResponse") + fd_MsgStakeSupplierResponse_supplier = md_MsgStakeSupplierResponse.Fields().ByName("supplier") } var _ protoreflect.Message = (*fastReflection_MsgStakeSupplierResponse)(nil) @@ -1712,6 +1714,12 @@ func (x *fastReflection_MsgStakeSupplierResponse) Interface() protoreflect.Proto // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgStakeSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_MsgStakeSupplierResponse_supplier, value) { + return + } + } } // Has reports whether a field is populated. @@ -1727,6 +1735,8 @@ func (x *fastReflection_MsgStakeSupplierResponse) Range(f func(protoreflect.Fiel // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgStakeSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + return x.Supplier != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1743,6 +1753,8 @@ func (x *fastReflection_MsgStakeSupplierResponse) Has(fd protoreflect.FieldDescr // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + x.Supplier = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1759,6 +1771,9 @@ func (x *fastReflection_MsgStakeSupplierResponse) Clear(fd protoreflect.FieldDes // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgStakeSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1779,6 +1794,8 @@ func (x *fastReflection_MsgStakeSupplierResponse) Get(descriptor protoreflect.Fi // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + x.Supplier = value.Message().Interface().(*shared.Supplier) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1799,6 +1816,11 @@ func (x *fastReflection_MsgStakeSupplierResponse) Set(fd protoreflect.FieldDescr // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + if x.Supplier == nil { + x.Supplier = new(shared.Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1812,6 +1834,9 @@ func (x *fastReflection_MsgStakeSupplierResponse) Mutable(fd protoreflect.FieldD // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgStakeSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplierResponse.supplier": + m := new(shared.Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) @@ -1881,6 +1906,10 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met var n int var l int _ = l + if x.Supplier != nil { + l = options.Size(x.Supplier) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1910,6 +1939,20 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + 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 { @@ -1959,6 +2002,42 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgStakeSupplierResponse: 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 Supplier", 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.Supplier == nil { + x.Supplier = &shared.Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2479,12 +2558,14 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUnstakeSupplierResponse protoreflect.MessageDescriptor + md_MsgUnstakeSupplierResponse protoreflect.MessageDescriptor + fd_MsgUnstakeSupplierResponse_supplier protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_tx_proto_init() md_MsgUnstakeSupplierResponse = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUnstakeSupplierResponse") + fd_MsgUnstakeSupplierResponse_supplier = md_MsgUnstakeSupplierResponse.Fields().ByName("supplier") } var _ protoreflect.Message = (*fastReflection_MsgUnstakeSupplierResponse)(nil) @@ -2552,6 +2633,12 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Interface() protoreflect.Pro // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUnstakeSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_MsgUnstakeSupplierResponse_supplier, value) { + return + } + } } // Has reports whether a field is populated. @@ -2567,6 +2654,8 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Range(f func(protoreflect.Fi // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUnstakeSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + return x.Supplier != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2583,6 +2672,8 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Has(fd protoreflect.FieldDes // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + x.Supplier = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2599,6 +2690,9 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Clear(fd protoreflect.FieldD // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUnstakeSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2619,6 +2713,8 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Get(descriptor protoreflect. // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + x.Supplier = value.Message().Interface().(*shared.Supplier) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2639,6 +2735,11 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Set(fd protoreflect.FieldDes // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + if x.Supplier == nil { + x.Supplier = new(shared.Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2652,6 +2753,9 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) Mutable(fd protoreflect.Fiel // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUnstakeSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplierResponse.supplier": + m := new(shared.Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) @@ -2721,6 +2825,10 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) ProtoMethods() *protoiface.M var n int var l int _ = l + if x.Supplier != nil { + l = options.Size(x.Supplier) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2750,6 +2858,20 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) ProtoMethods() *protoiface.M i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + 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 { @@ -2799,6 +2921,42 @@ func (x *fastReflection_MsgUnstakeSupplierResponse) ProtoMethods() *protoiface.M return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUnstakeSupplierResponse: 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 Supplier", 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.Supplier == nil { + x.Supplier = &shared.Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4030,6 +4188,8 @@ type MsgStakeSupplierResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` } func (x *MsgStakeSupplierResponse) Reset() { @@ -4052,6 +4212,13 @@ func (*MsgStakeSupplierResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgStakeSupplierResponse) GetSupplier() *shared.Supplier { + if x != nil { + return x.Supplier + } + return nil +} + type MsgUnstakeSupplier struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4099,6 +4266,8 @@ type MsgUnstakeSupplierResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` } func (x *MsgUnstakeSupplierResponse) Reset() { @@ -4121,6 +4290,13 @@ func (*MsgUnstakeSupplierResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{5} } +func (x *MsgUnstakeSupplierResponse) GetSupplier() *shared.Supplier { + if x != nil { + return x.Supplier + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { state protoimpl.MessageState @@ -4246,7 +4422,9 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xbf, 0x01, 0x0a, 0x0f, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 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, @@ -4281,73 +4459,80 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x51, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 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, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 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, 0x0f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, - 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x0e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x61, 0x73, 0x5f, - 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 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, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, - 0x08, 0x0a, 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4b, 0x0a, 0x16, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x65, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x95, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x61, - 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, - 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, + 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 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, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 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, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x22, 0x53, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x29, 0x2e, 0x70, + 0x65, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x08, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0xac, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x18, 0x03, 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, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, + 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x08, 0x0a, + 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4b, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x32, 0x95, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xad, - 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 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, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, - 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 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, 0x61, 0x0a, 0x0d, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xad, 0x01, 0xd8, + 0xe2, 0x1e, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 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, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4375,26 +4560,29 @@ var file_poktroll_supplier_tx_proto_goTypes = []interface{}{ (*Params)(nil), // 8: poktroll.supplier.Params (*v1beta1.Coin)(nil), // 9: cosmos.base.v1beta1.Coin (*shared.SupplierServiceConfig)(nil), // 10: poktroll.shared.SupplierServiceConfig + (*shared.Supplier)(nil), // 11: poktroll.shared.Supplier } var file_poktroll_supplier_tx_proto_depIdxs = []int32{ 8, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params 9, // 1: poktroll.supplier.MsgStakeSupplier.stake:type_name -> cosmos.base.v1beta1.Coin 10, // 2: poktroll.supplier.MsgStakeSupplier.services:type_name -> poktroll.shared.SupplierServiceConfig - 9, // 3: poktroll.supplier.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin - 8, // 4: poktroll.supplier.MsgUpdateParamResponse.params:type_name -> poktroll.supplier.Params - 0, // 5: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams - 2, // 6: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier - 4, // 7: poktroll.supplier.Msg.UnstakeSupplier:input_type -> poktroll.supplier.MsgUnstakeSupplier - 6, // 8: poktroll.supplier.Msg.UpdateParam:input_type -> poktroll.supplier.MsgUpdateParam - 1, // 9: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse - 3, // 10: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse - 5, // 11: poktroll.supplier.Msg.UnstakeSupplier:output_type -> poktroll.supplier.MsgUnstakeSupplierResponse - 7, // 12: poktroll.supplier.Msg.UpdateParam:output_type -> poktroll.supplier.MsgUpdateParamResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 11, // 3: poktroll.supplier.MsgStakeSupplierResponse.supplier:type_name -> poktroll.shared.Supplier + 11, // 4: poktroll.supplier.MsgUnstakeSupplierResponse.supplier:type_name -> poktroll.shared.Supplier + 9, // 5: poktroll.supplier.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin + 8, // 6: poktroll.supplier.MsgUpdateParamResponse.params:type_name -> poktroll.supplier.Params + 0, // 7: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams + 2, // 8: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier + 4, // 9: poktroll.supplier.Msg.UnstakeSupplier:input_type -> poktroll.supplier.MsgUnstakeSupplier + 6, // 10: poktroll.supplier.Msg.UpdateParam:input_type -> poktroll.supplier.MsgUpdateParam + 1, // 11: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse + 3, // 12: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse + 5, // 13: poktroll.supplier.Msg.UnstakeSupplier:output_type -> poktroll.supplier.MsgUnstakeSupplierResponse + 7, // 14: poktroll.supplier.Msg.UpdateParam:output_type -> poktroll.supplier.MsgUpdateParamResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_poktroll_supplier_tx_proto_init() } diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index cf521df99..54c3b429a 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -12,6 +12,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "poktroll/supplier/params.proto"; import "poktroll/shared/service.proto"; +import "poktroll/shared/supplier.proto"; // Msg defines the Msg service. service Msg { @@ -50,7 +51,9 @@ message MsgStakeSupplier { repeated poktroll.shared.SupplierServiceConfig services = 5; // The list of services this supplier is staked to provide service for } -message MsgStakeSupplierResponse {} +message MsgStakeSupplierResponse { + poktroll.shared.Supplier supplier = 1; +} message MsgUnstakeSupplier { option (cosmos.msg.v1.signer) = "signer"; @@ -58,7 +61,9 @@ message MsgUnstakeSupplier { string operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) } -message MsgUnstakeSupplierResponse {} +message MsgUnstakeSupplierResponse { + poktroll.shared.Supplier supplier = 1; +} // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. message MsgUpdateParam { diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index 4b58ae86c..3a591d460 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -178,7 +178,9 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *suppliertypes.MsgStak } isSuccessful = true - return &suppliertypes.MsgStakeSupplierResponse{}, nil + return &suppliertypes.MsgStakeSupplierResponse{ + Supplier: &supplier, + }, nil } // createSupplier creates a new supplier from the given message. diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 2ac70a39b..3757a2224 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -98,5 +98,7 @@ func (k msgServer) UnstakeSupplier( } isSuccessful = true - return &suppliertypes.MsgUnstakeSupplierResponse{}, nil + return &suppliertypes.MsgUnstakeSupplierResponse{ + Supplier: &supplier, + }, nil } diff --git a/x/supplier/keeper/msg_server_unstake_supplier_test.go b/x/supplier/keeper/msg_server_unstake_supplier_test.go index 4338b4e52..6856dcf34 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier_test.go +++ b/x/supplier/keeper/msg_server_unstake_supplier_test.go @@ -327,11 +327,11 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { stakeMsg, expectedSupplier := newSupplierStakeMsg(ownerAddr, ownerAddr, initialStake, serviceID) stakeMsg.OperatorAddress = supplierOperatorAddr expectedSupplier.OperatorAddress = supplierOperatorAddr - _, err := srv.StakeSupplier(ctx, stakeMsg) + stakeRes, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Assert that the MsgStakeSupplierResponse contains the newly staked supplier. - // TODO_TEST(#663): Ensure responses contain modified state objects. + require.Equal(t, expectedSupplier, stakeRes.GetSupplier()) // Assert that the EventSupplierStaked event is emitted. sharedParams := supplierModuleKeepers.SharedKeeper.GetParams(ctx) @@ -356,13 +356,13 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { Signer: supplierOperatorAddr, OperatorAddress: supplierOperatorAddr, } - _, err = srv.UnstakeSupplier(ctx, unstakeMsg) + unstakeRes, err := srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) expectedSupplier.UnstakeSessionEndHeight = uint64(sessionEndHeight) // Assert that the MsgUnstakeSupplierResponse contains the unstaking supplier. - // TODO_TEST(#663): Ensure responses contain modified state objects. + require.Equal(t, expectedSupplier, unstakeRes.GetSupplier()) // Assert that the EventSupplierUnbondingBegin event is emitted. unbondingEndHeight := sharedtypes.GetSupplierUnbondingEndHeight(&sharedParams, expectedSupplier) diff --git a/x/supplier/types/tx.pb.go b/x/supplier/types/tx.pb.go index 0c48ba0c3..59f71319f 100644 --- a/x/supplier/types/tx.pb.go +++ b/x/supplier/types/tx.pb.go @@ -192,6 +192,7 @@ func (m *MsgStakeSupplier) GetServices() []*types1.SupplierServiceConfig { } type MsgStakeSupplierResponse struct { + Supplier *types1.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` } func (m *MsgStakeSupplierResponse) Reset() { *m = MsgStakeSupplierResponse{} } @@ -223,6 +224,13 @@ func (m *MsgStakeSupplierResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeSupplierResponse proto.InternalMessageInfo +func (m *MsgStakeSupplierResponse) GetSupplier() *types1.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + type MsgUnstakeSupplier struct { Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` @@ -272,6 +280,7 @@ func (m *MsgUnstakeSupplier) GetOperatorAddress() string { } type MsgUnstakeSupplierResponse struct { + Supplier *types1.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` } func (m *MsgUnstakeSupplierResponse) Reset() { *m = MsgUnstakeSupplierResponse{} } @@ -303,6 +312,13 @@ func (m *MsgUnstakeSupplierResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnstakeSupplierResponse proto.InternalMessageInfo +func (m *MsgUnstakeSupplierResponse) GetSupplier() *types1.Supplier { + if m != nil { + return m.Supplier + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). @@ -444,50 +460,51 @@ func init() { func init() { proto.RegisterFile("poktroll/supplier/tx.proto", fileDescriptor_63b974929807ef57) } var fileDescriptor_63b974929807ef57 = []byte{ - // 678 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, - 0x14, 0xcf, 0x35, 0x6d, 0xbe, 0xed, 0x4b, 0x7f, 0x9e, 0xaa, 0x6f, 0x53, 0x0b, 0x4c, 0x49, 0x05, - 0x2a, 0x41, 0x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19, 0x8b, 0x97, 0x82, 0x25, 0x07, 0xbd, 0x84, 0xe2, 0xd9, 0x5e, - 0xb9, 0x9e, 0x69, 0x83, 0x71, 0x2b, 0x13, 0x12, 0x27, 0x37, 0x86, 0xde, 0x04, 0x0f, 0x62, 0xed, - 0xc9, 0x61, 0xc7, 0x44, 0x47, 0x1d, 0x13, 0x1d, 0x77, 0x4c, 0xf4, 0xb3, 0x63, 0xa2, 0xf7, 0x27, - 0x66, 0xee, 0xe8, 0xc4, 0xcc, 0x1d, 0x9f, 0x98, 0xb9, 0x17, 0x55, 0xc7, 0x55, 0x1b, 0xdb, 0x0d, - 0xab, 0xc9, 0xdb, 0x24, 0xc8, 0xbc, 0xe8, 0x31, 0xb5, 0xcb, 0xc5, 0x26, 0xe9, 0xf7, 0x56, 0xaa, - 0x7d, 0x9f, 0xc9, 0x46, 0x21, 0x7c, 0xea, 0xef, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x63, - 0xdc, 0x7f, 0xd7, 0x06, 0x00, 0x00, + // 701 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x6f, 0xd3, 0x4e, + 0x14, 0x8f, 0x9b, 0x36, 0xdf, 0xf6, 0xa5, 0x3f, 0x4f, 0xd5, 0xb7, 0xa9, 0x25, 0x4c, 0x71, 0x05, + 0x2a, 0x41, 0xf5, 0x91, 0x02, 0x1d, 0x2a, 0x18, 0x48, 0x17, 0x24, 0x54, 0x01, 0x0e, 0x2c, 0x20, + 0x51, 0x5d, 0x92, 0xc3, 0xb5, 0xda, 0xf8, 0xac, 0xbb, 0xeb, 0xaf, 0x0d, 0x31, 0x32, 0xb1, 0x20, + 0xf1, 0x27, 0x30, 0x30, 0x74, 0x60, 0x67, 0xad, 0x98, 0x2a, 0xa6, 0x4e, 0x08, 0xa5, 0x43, 0xff, + 0x0d, 0x64, 0xfb, 0x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4, 0xb0, 0x6d, 0x68, 0x47, 0x6d, 0x43, 0x3b, 0x6e, 0x1b, + 0xda, 0xaf, 0xb6, 0xa1, 0x7d, 0x38, 0x31, 0x72, 0x47, 0x27, 0x46, 0xee, 0xf8, 0xc4, 0xc8, 0xbd, + 0xac, 0x38, 0xae, 0xdc, 0xd8, 0xae, 0x5b, 0x0d, 0xd6, 0xc2, 0x01, 0xf3, 0xa2, 0x47, 0xe5, 0x2e, + 0xe3, 0x9b, 0xb8, 0xdf, 0xcb, 0x2c, 0xf7, 0x7d, 0x2a, 0xea, 0x85, 0xf0, 0xc3, 0x72, 0xe7, 0x77, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xe6, 0x12, 0x17, 0x65, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -835,6 +852,18 @@ func (m *MsgStakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.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 } @@ -895,6 +924,18 @@ func (m *MsgUnstakeSupplierResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if m.Supplier != nil { + { + size, err := m.Supplier.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 } @@ -1072,6 +1113,10 @@ func (m *MsgStakeSupplierResponse) Size() (n int) { } var l int _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1098,6 +1143,10 @@ func (m *MsgUnstakeSupplierResponse) Size() (n int) { } var l int _ = l + if m.Supplier != nil { + l = m.Supplier.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1562,6 +1611,42 @@ func (m *MsgStakeSupplierResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgStakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier == nil { + m.Supplier = &types1.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1726,6 +1811,42 @@ func (m *MsgUnstakeSupplierResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUnstakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supplier", 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.Supplier == nil { + m.Supplier = &types1.Supplier{} + } + if err := m.Supplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From a6e99b10d2e409664ab6a42edc74d9618ce604bc Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 9 Dec 2024 10:43:46 +0100 Subject: [PATCH 2/6] [Code Health] Ensure gateway module msg responses are non-empty (#972) ## Summary Ensure all supplier module msg responses are non-empty. This adds an `Gateway` field to the following protobuf type(s), and updates the unit tests to assert for presence and correctness. - `MsgUnstakeGatewayResponse` ## Issue - #663 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [ ] 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 - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/gateway/tx.pulsar.go | 230 ++++++++++++------ proto/poktroll/gateway/tx.proto | 4 +- .../keeper/msg_server_unstake_gateway.go | 4 +- .../keeper/msg_server_unstake_gateway_test.go | 4 +- x/gateway/types/tx.pb.go | 138 ++++++++--- 5 files changed, 269 insertions(+), 111 deletions(-) diff --git a/api/poktroll/gateway/tx.pulsar.go b/api/poktroll/gateway/tx.pulsar.go index ab91c6084..56bee72e9 100644 --- a/api/poktroll/gateway/tx.pulsar.go +++ b/api/poktroll/gateway/tx.pulsar.go @@ -2227,12 +2227,14 @@ func (x *fastReflection_MsgUnstakeGateway) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUnstakeGatewayResponse protoreflect.MessageDescriptor + md_MsgUnstakeGatewayResponse protoreflect.MessageDescriptor + fd_MsgUnstakeGatewayResponse_gateway protoreflect.FieldDescriptor ) func init() { file_poktroll_gateway_tx_proto_init() md_MsgUnstakeGatewayResponse = File_poktroll_gateway_tx_proto.Messages().ByName("MsgUnstakeGatewayResponse") + fd_MsgUnstakeGatewayResponse_gateway = md_MsgUnstakeGatewayResponse.Fields().ByName("gateway") } var _ protoreflect.Message = (*fastReflection_MsgUnstakeGatewayResponse)(nil) @@ -2300,6 +2302,12 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Interface() protoreflect.Prot // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUnstakeGatewayResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Gateway != nil { + value := protoreflect.ValueOfMessage(x.Gateway.ProtoReflect()) + if !f(fd_MsgUnstakeGatewayResponse_gateway, value) { + return + } + } } // Has reports whether a field is populated. @@ -2315,6 +2323,8 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Range(f func(protoreflect.Fie // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUnstakeGatewayResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + return x.Gateway != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2331,6 +2341,8 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Has(fd protoreflect.FieldDesc // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeGatewayResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + x.Gateway = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2347,6 +2359,9 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Clear(fd protoreflect.FieldDe // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUnstakeGatewayResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + value := x.Gateway + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2367,6 +2382,8 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Get(descriptor protoreflect.F // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeGatewayResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + x.Gateway = value.Message().Interface().(*Gateway) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2387,6 +2404,11 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Set(fd protoreflect.FieldDesc // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeGatewayResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + if x.Gateway == nil { + x.Gateway = new(Gateway) + } + return protoreflect.ValueOfMessage(x.Gateway.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2400,6 +2422,9 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) Mutable(fd protoreflect.Field // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUnstakeGatewayResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.gateway.MsgUnstakeGatewayResponse.gateway": + m := new(Gateway) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.gateway.MsgUnstakeGatewayResponse")) @@ -2469,6 +2494,10 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) ProtoMethods() *protoiface.Me var n int var l int _ = l + if x.Gateway != nil { + l = options.Size(x.Gateway) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2498,6 +2527,20 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) ProtoMethods() *protoiface.Me i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Gateway != nil { + encoded, err := options.Marshal(x.Gateway) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -2547,6 +2590,42 @@ func (x *fastReflection_MsgUnstakeGatewayResponse) ProtoMethods() *protoiface.Me return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUnstakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Gateway == nil { + x.Gateway = &Gateway{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Gateway); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3824,6 +3903,8 @@ type MsgUnstakeGatewayResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Gateway *Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway,omitempty"` } func (x *MsgUnstakeGatewayResponse) Reset() { @@ -3846,6 +3927,13 @@ func (*MsgUnstakeGatewayResponse) Descriptor() ([]byte, []int) { return file_poktroll_gateway_tx_proto_rawDescGZIP(), []int{5} } +func (x *MsgUnstakeGatewayResponse) GetGateway() *Gateway { + if x != nil { + return x.Gateway + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { state protoimpl.MessageState @@ -4004,61 +4092,64 @@ var file_poktroll_gateway_tx_proto_rawDesc = []byte{ 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xba, 0x01, - 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x07, - 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 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, 0x42, 0x0b, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x73, - 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, - 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4a, 0x0a, 0x16, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x87, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, + 0x22, 0x50, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, + 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0c, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x21, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, - 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x55, 0x6e, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x23, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, + 0x79, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x22, 0xba, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 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, 0x42, 0x0b, 0xea, + 0xde, 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, + 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x4a, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x87, 0x03, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x62, 0x0a, 0x0e, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, - 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, - 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xa2, 0x02, 0x03, 0x50, 0x47, - 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, + 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0xa2, 0x02, 0x03, 0x50, 0x47, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xe2, 0x02, 0x1c, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4091,21 +4182,22 @@ var file_poktroll_gateway_tx_proto_depIdxs = []int32{ 8, // 0: poktroll.gateway.MsgUpdateParams.params:type_name -> poktroll.gateway.Params 9, // 1: poktroll.gateway.MsgStakeGateway.stake:type_name -> cosmos.base.v1beta1.Coin 10, // 2: poktroll.gateway.MsgStakeGatewayResponse.gateway:type_name -> poktroll.gateway.Gateway - 9, // 3: poktroll.gateway.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin - 8, // 4: poktroll.gateway.MsgUpdateParamResponse.params:type_name -> poktroll.gateway.Params - 0, // 5: poktroll.gateway.Msg.UpdateParams:input_type -> poktroll.gateway.MsgUpdateParams - 2, // 6: poktroll.gateway.Msg.StakeGateway:input_type -> poktroll.gateway.MsgStakeGateway - 4, // 7: poktroll.gateway.Msg.UnstakeGateway:input_type -> poktroll.gateway.MsgUnstakeGateway - 6, // 8: poktroll.gateway.Msg.UpdateParam:input_type -> poktroll.gateway.MsgUpdateParam - 1, // 9: poktroll.gateway.Msg.UpdateParams:output_type -> poktroll.gateway.MsgUpdateParamsResponse - 3, // 10: poktroll.gateway.Msg.StakeGateway:output_type -> poktroll.gateway.MsgStakeGatewayResponse - 5, // 11: poktroll.gateway.Msg.UnstakeGateway:output_type -> poktroll.gateway.MsgUnstakeGatewayResponse - 7, // 12: poktroll.gateway.Msg.UpdateParam:output_type -> poktroll.gateway.MsgUpdateParamResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 3: poktroll.gateway.MsgUnstakeGatewayResponse.gateway:type_name -> poktroll.gateway.Gateway + 9, // 4: poktroll.gateway.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin + 8, // 5: poktroll.gateway.MsgUpdateParamResponse.params:type_name -> poktroll.gateway.Params + 0, // 6: poktroll.gateway.Msg.UpdateParams:input_type -> poktroll.gateway.MsgUpdateParams + 2, // 7: poktroll.gateway.Msg.StakeGateway:input_type -> poktroll.gateway.MsgStakeGateway + 4, // 8: poktroll.gateway.Msg.UnstakeGateway:input_type -> poktroll.gateway.MsgUnstakeGateway + 6, // 9: poktroll.gateway.Msg.UpdateParam:input_type -> poktroll.gateway.MsgUpdateParam + 1, // 10: poktroll.gateway.Msg.UpdateParams:output_type -> poktroll.gateway.MsgUpdateParamsResponse + 3, // 11: poktroll.gateway.Msg.StakeGateway:output_type -> poktroll.gateway.MsgStakeGatewayResponse + 5, // 12: poktroll.gateway.Msg.UnstakeGateway:output_type -> poktroll.gateway.MsgUnstakeGatewayResponse + 7, // 13: poktroll.gateway.Msg.UpdateParam:output_type -> poktroll.gateway.MsgUpdateParamResponse + 10, // [10:14] is the sub-list for method output_type + 6, // [6:10] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_poktroll_gateway_tx_proto_init() } diff --git a/proto/poktroll/gateway/tx.proto b/proto/poktroll/gateway/tx.proto index e8a37c698..1422c0334 100644 --- a/proto/poktroll/gateway/tx.proto +++ b/proto/poktroll/gateway/tx.proto @@ -60,7 +60,9 @@ message MsgUnstakeGateway { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway } -message MsgUnstakeGatewayResponse {} +message MsgUnstakeGatewayResponse { + poktroll.gateway.Gateway gateway = 1; +} // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. message MsgUpdateParam { diff --git a/x/gateway/keeper/msg_server_unstake_gateway.go b/x/gateway/keeper/msg_server_unstake_gateway.go index d8c757713..745ade883 100644 --- a/x/gateway/keeper/msg_server_unstake_gateway.go +++ b/x/gateway/keeper/msg_server_unstake_gateway.go @@ -79,5 +79,7 @@ func (k msgServer) UnstakeGateway( } isSuccessful = true - return &types.MsgUnstakeGatewayResponse{}, nil + return &types.MsgUnstakeGatewayResponse{ + Gateway: &gateway, + }, nil } diff --git a/x/gateway/keeper/msg_server_unstake_gateway_test.go b/x/gateway/keeper/msg_server_unstake_gateway_test.go index 64ad5cadf..8d1aaf4bf 100644 --- a/x/gateway/keeper/msg_server_unstake_gateway_test.go +++ b/x/gateway/keeper/msg_server_unstake_gateway_test.go @@ -43,9 +43,11 @@ func TestMsgServer_UnstakeGateway_Success(t *testing.T) { // Unstake the gateway unstakeMsg := &types.MsgUnstakeGateway{Address: addr} - _, err = srv.UnstakeGateway(ctx, unstakeMsg) + unstakeRes, err := srv.UnstakeGateway(ctx, unstakeMsg) require.NoError(t, err) + require.Equal(t, &foundGateway, unstakeRes.GetGateway()) + // Make sure the gateway can no longer be found after unstaking _, isGatewayFound = k.GetGateway(ctx, addr) require.False(t, isGatewayFound) diff --git a/x/gateway/types/tx.pb.go b/x/gateway/types/tx.pb.go index 1de507649..f0d49bb3f 100644 --- a/x/gateway/types/tx.pb.go +++ b/x/gateway/types/tx.pb.go @@ -247,6 +247,7 @@ func (m *MsgUnstakeGateway) GetAddress() string { } type MsgUnstakeGatewayResponse struct { + Gateway *Gateway `protobuf:"bytes,1,opt,name=gateway,proto3" json:"gateway,omitempty"` } func (m *MsgUnstakeGatewayResponse) Reset() { *m = MsgUnstakeGatewayResponse{} } @@ -278,6 +279,13 @@ func (m *MsgUnstakeGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnstakeGatewayResponse proto.InternalMessageInfo +func (m *MsgUnstakeGatewayResponse) GetGateway() *Gateway { + if m != nil { + return m.Gateway + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). @@ -419,45 +427,45 @@ func init() { func init() { proto.RegisterFile("poktroll/gateway/tx.proto", fileDescriptor_7ad4b0c5e3b59f23) } var fileDescriptor_7ad4b0c5e3b59f23 = []byte{ - // 606 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, - 0x1c, 0xcd, 0x7d, 0xfb, 0x6d, 0xa3, 0x5c, 0xa2, 0x40, 0xad, 0x8a, 0x26, 0x06, 0xdc, 0x60, 0x96, - 0x10, 0x54, 0x5f, 0x93, 0x0a, 0x86, 0x30, 0x35, 0x0c, 0x20, 0xa4, 0x56, 0xc8, 0x55, 0x07, 0x50, - 0xa5, 0xea, 0x92, 0x58, 0xae, 0x95, 0xda, 0x67, 0xf9, 0xae, 0x3f, 0xb2, 0x21, 0x84, 0x84, 0xc4, - 0xc4, 0x9f, 0xc1, 0x98, 0x81, 0x09, 0x89, 0xbd, 0x63, 0xc5, 0xd4, 0xa9, 0x42, 0xc9, 0x10, 0x89, - 0xbf, 0x02, 0x9d, 0xef, 0xec, 0xc6, 0x4e, 0x20, 0x08, 0x96, 0xc4, 0xbe, 0xcf, 0xfb, 0xbc, 0x7b, - 0xef, 0x73, 0xcf, 0x07, 0xcb, 0x3e, 0xe9, 0xb1, 0x80, 0x1c, 0x1d, 0x21, 0x1b, 0x33, 0xeb, 0x14, - 0xf7, 0x11, 0x3b, 0x33, 0xfc, 0x80, 0x30, 0xa2, 0xdc, 0x8c, 0x4a, 0x86, 0x2c, 0xa9, 0xcb, 0xd8, - 0x75, 0x3c, 0x82, 0xc2, 0x5f, 0x01, 0x52, 0x57, 0x3b, 0x84, 0xba, 0x84, 0x22, 0x97, 0xda, 0xe8, - 0xa4, 0xce, 0xff, 0x64, 0xa1, 0x2c, 0x0a, 0x07, 0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, 0xc5, 0x7b, 0xbc, 0x82, 0xf9, 0xc9, 0xb0, 0x54, 0xe6, 0x79, 0x57, 0xab, 0xf3, - 0x10, 0x11, 0xb5, 0xba, 0xf8, 0x86, 0xdf, 0x1b, 0xad, 0x9d, 0xf3, 0xa1, 0x06, 0x2e, 0x86, 0x1a, - 0xb8, 0x1c, 0x6a, 0xe0, 0xfb, 0x50, 0x03, 0x1f, 0x47, 0x5a, 0xe6, 0x62, 0xa4, 0x65, 0x2e, 0x47, - 0x5a, 0xe6, 0xf5, 0x86, 0xed, 0xb0, 0xc3, 0xe3, 0xb6, 0xd1, 0x21, 0x2e, 0xe2, 0xc4, 0xeb, 0x9e, - 0xc5, 0x4e, 0x49, 0xd0, 0x43, 0x33, 0xae, 0x94, 0xf0, 0x3a, 0x6c, 0x2f, 0x85, 0xf7, 0xe1, 0xe6, - 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x05, 0x4a, 0x88, 0xc9, 0xf8, 0x05, 0x00, 0x00, + // 605 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0x51, 0xda, 0x2a, 0x97, 0x28, 0x50, 0xab, 0xa2, 0x89, 0x05, 0x6e, 0x30, 0x4b, 0x08, + 0xaa, 0xaf, 0x49, 0x05, 0x43, 0x98, 0x1a, 0x06, 0x10, 0x52, 0xab, 0xca, 0x55, 0x07, 0x50, 0xa5, + 0xea, 0x92, 0x58, 0xae, 0x95, 0xda, 0x67, 0xf9, 0xae, 0x3f, 0xb2, 0x21, 0x84, 0x84, 0xc4, 0xc4, + 0x9f, 0xc1, 0x98, 0x81, 0x09, 0x89, 0xbd, 0x63, 0xc5, 0xd4, 0xa9, 0x42, 0xc9, 0x10, 0x89, 0xbf, + 0x02, 0x9d, 0xef, 0xec, 0xc6, 0x4e, 0x20, 0x88, 0x2e, 0x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e, 0xef, 0xc5, 0x7a, 0x9c, 0x72, 0xf0, 0xf7, 0x94, 0x47, 0xd1, 0xae, + 0x7f, 0x9c, 0x83, 0x73, 0x5b, 0xd4, 0x56, 0xf6, 0x61, 0x3e, 0x71, 0xce, 0x1e, 0x4e, 0x76, 0xa6, + 0xb2, 0xac, 0x3e, 0x9e, 0x09, 0x89, 0x75, 0xed, 0xc3, 0x7c, 0x22, 0xea, 0xd3, 0xd9, 0xc7, 0x21, + 0x7f, 0x60, 0x9f, 0x1a, 0xd5, 0x16, 0x2c, 0xa4, 0x22, 0xf7, 0x68, 0xba, 0xb4, 0x04, 0x48, 0x7d, + 0xf2, 0x0f, 0xa0, 0xf8, 0x1b, 0x6f, 0x60, 0x6e, 0x3c, 0x2c, 0xe5, 0x59, 0xde, 0xd5, 0xca, 0x2c, + 0x44, 0x44, 0xad, 0xce, 0xbf, 0xe3, 0x97, 0x4d, 0x73, 0xfb, 0x7c, 0xa0, 0x81, 0x8b, 0x81, 0x06, + 0x2e, 0x07, 0x1a, 0xf8, 0x39, 0xd0, 0xc0, 0xe7, 0xa1, 0x96, 0xb9, 0x18, 0x6a, 0x99, 0xcb, 0xa1, + 0x96, 0x79, 0xbb, 0x6e, 0x3b, 0xec, 0xf0, 0xb8, 0x65, 0xb4, 0x89, 0x8b, 0x38, 0xf1, 0x9a, 0x67, + 0xb1, 0x53, 0x12, 0x74, 0xd1, 0x94, 0x7b, 0x28, 0xbc, 0x43, 0x5b, 0x0b, 0xe1, 0x25, 0xba, 0xf1, + 0x3b, 0x00, 0x00, 0xff, 0xff, 0x24, 0x9f, 0x5b, 0xdd, 0x2d, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -842,6 +850,18 @@ func (m *MsgUnstakeGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if m.Gateway != nil { + { + size, err := m.Gateway.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1031,6 +1051,10 @@ func (m *MsgUnstakeGatewayResponse) Size() (n int) { } var l int _ = l + if m.Gateway != nil { + l = m.Gateway.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1565,6 +1589,42 @@ func (m *MsgUnstakeGatewayResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUnstakeGatewayResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gateway == nil { + m.Gateway = &Gateway{} + } + if err := m.Gateway.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 3faea85154113b2a535e303d38afc5bdc927f8f8 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 9 Dec 2024 10:44:24 +0100 Subject: [PATCH 3/6] [Code Health] Ensure service module msg responses are non-empty (#973) # Summary Ensure all supplier module msg responses are non-empty. This adds a `Service` field to the following protobuf type(s), and updates the unit tests to assert for presence and correctness. - `MsgAddServiceResopnse` ## Issue - #663 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [ ] I have tested my changes using the available tooling - [ ] I have commented my code - [ ] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/service/tx.pulsar.go | 176 +++++++++++++----- proto/poktroll/service/tx.proto | 4 +- x/service/keeper/msg_server_add_service.go | 4 +- .../keeper/msg_server_add_service_test.go | 3 +- x/service/types/tx.pb.go | 139 ++++++++++---- 5 files changed, 242 insertions(+), 84 deletions(-) diff --git a/api/poktroll/service/tx.pulsar.go b/api/poktroll/service/tx.pulsar.go index c4e61fa8a..df5b6af63 100644 --- a/api/poktroll/service/tx.pulsar.go +++ b/api/poktroll/service/tx.pulsar.go @@ -2474,12 +2474,14 @@ func (x *fastReflection_MsgAddService) ProtoMethods() *protoiface.Methods { } var ( - md_MsgAddServiceResponse protoreflect.MessageDescriptor + md_MsgAddServiceResponse protoreflect.MessageDescriptor + fd_MsgAddServiceResponse_service protoreflect.FieldDescriptor ) func init() { file_poktroll_service_tx_proto_init() md_MsgAddServiceResponse = File_poktroll_service_tx_proto.Messages().ByName("MsgAddServiceResponse") + fd_MsgAddServiceResponse_service = md_MsgAddServiceResponse.Fields().ByName("service") } var _ protoreflect.Message = (*fastReflection_MsgAddServiceResponse)(nil) @@ -2547,6 +2549,12 @@ func (x *fastReflection_MsgAddServiceResponse) Interface() protoreflect.ProtoMes // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgAddServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_MsgAddServiceResponse_service, value) { + return + } + } } // Has reports whether a field is populated. @@ -2562,6 +2570,8 @@ func (x *fastReflection_MsgAddServiceResponse) Range(f func(protoreflect.FieldDe // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgAddServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + return x.Service != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2578,6 +2588,8 @@ func (x *fastReflection_MsgAddServiceResponse) Has(fd protoreflect.FieldDescript // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAddServiceResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + x.Service = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2594,6 +2606,9 @@ func (x *fastReflection_MsgAddServiceResponse) Clear(fd protoreflect.FieldDescri // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgAddServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2614,6 +2629,8 @@ func (x *fastReflection_MsgAddServiceResponse) Get(descriptor protoreflect.Field // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAddServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + x.Service = value.Message().Interface().(*shared.Service) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2634,6 +2651,11 @@ func (x *fastReflection_MsgAddServiceResponse) Set(fd protoreflect.FieldDescript // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAddServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + if x.Service == nil { + x.Service = new(shared.Service) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2647,6 +2669,9 @@ func (x *fastReflection_MsgAddServiceResponse) Mutable(fd protoreflect.FieldDesc // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgAddServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.service.MsgAddServiceResponse.service": + m := new(shared.Service) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgAddServiceResponse")) @@ -2716,6 +2741,10 @@ func (x *fastReflection_MsgAddServiceResponse) ProtoMethods() *protoiface.Method var n int var l int _ = l + if x.Service != nil { + l = options.Size(x.Service) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2745,6 +2774,20 @@ func (x *fastReflection_MsgAddServiceResponse) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Service != nil { + encoded, err := options.Marshal(x.Service) + 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 { @@ -2794,6 +2837,42 @@ func (x *fastReflection_MsgAddServiceResponse) ProtoMethods() *protoiface.Method return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAddServiceResponse: 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 Service", 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.Service == nil { + x.Service = &shared.Service{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3093,6 +3172,8 @@ type MsgAddServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Service *shared.Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` } func (x *MsgAddServiceResponse) Reset() { @@ -3115,6 +3196,13 @@ func (*MsgAddServiceResponse) Descriptor() ([]byte, []int) { return file_poktroll_service_tx_proto_rawDescGZIP(), []int{5} } +func (x *MsgAddServiceResponse) GetService() *shared.Service { + if x != nil { + return x.Service + } + return nil +} + var File_poktroll_service_tx_proto protoreflect.FileDescriptor var file_poktroll_service_tx_proto_rawDesc = []byte{ @@ -3175,38 +3263,41 @@ var file_poktroll_service_tx_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x12, 0x82, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4b, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0x9d, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, + 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0x9d, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 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, 0x59, 0x0a, 0x0b, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 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, 0x59, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, - 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, - 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, + 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3238,17 +3329,18 @@ var file_poktroll_service_tx_proto_depIdxs = []int32{ 7, // 1: poktroll.service.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin 6, // 2: poktroll.service.MsgUpdateParamResponse.params:type_name -> poktroll.service.Params 8, // 3: poktroll.service.MsgAddService.service:type_name -> poktroll.shared.Service - 0, // 4: poktroll.service.Msg.UpdateParams:input_type -> poktroll.service.MsgUpdateParams - 2, // 5: poktroll.service.Msg.UpdateParam:input_type -> poktroll.service.MsgUpdateParam - 4, // 6: poktroll.service.Msg.AddService:input_type -> poktroll.service.MsgAddService - 1, // 7: poktroll.service.Msg.UpdateParams:output_type -> poktroll.service.MsgUpdateParamsResponse - 3, // 8: poktroll.service.Msg.UpdateParam:output_type -> poktroll.service.MsgUpdateParamResponse - 5, // 9: poktroll.service.Msg.AddService:output_type -> poktroll.service.MsgAddServiceResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] 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 + 8, // 4: poktroll.service.MsgAddServiceResponse.service:type_name -> poktroll.shared.Service + 0, // 5: poktroll.service.Msg.UpdateParams:input_type -> poktroll.service.MsgUpdateParams + 2, // 6: poktroll.service.Msg.UpdateParam:input_type -> poktroll.service.MsgUpdateParam + 4, // 7: poktroll.service.Msg.AddService:input_type -> poktroll.service.MsgAddService + 1, // 8: poktroll.service.Msg.UpdateParams:output_type -> poktroll.service.MsgUpdateParamsResponse + 3, // 9: poktroll.service.Msg.UpdateParam:output_type -> poktroll.service.MsgUpdateParamResponse + 5, // 10: poktroll.service.Msg.AddService:output_type -> poktroll.service.MsgAddServiceResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_poktroll_service_tx_proto_init() } diff --git a/proto/poktroll/service/tx.proto b/proto/poktroll/service/tx.proto index b80a5d5d2..c5c32807a 100644 --- a/proto/poktroll/service/tx.proto +++ b/proto/poktroll/service/tx.proto @@ -73,5 +73,7 @@ message MsgAddService { poktroll.shared.Service service = 2 [(gogoproto.nullable) = false]; // The Service being added to the network } -message MsgAddServiceResponse {} +message MsgAddServiceResponse { + poktroll.shared.Service service = 1; +} diff --git a/x/service/keeper/msg_server_add_service.go b/x/service/keeper/msg_server_add_service.go index 2d3dd69c0..4596883f9 100644 --- a/x/service/keeper/msg_server_add_service.go +++ b/x/service/keeper/msg_server_add_service.go @@ -111,5 +111,7 @@ func (k msgServer) AddService( k.SetService(ctx, msg.Service) isSuccessful = true - return &types.MsgAddServiceResponse{}, nil + return &types.MsgAddServiceResponse{ + Service: &msg.Service, + }, nil } diff --git a/x/service/keeper/msg_server_add_service_test.go b/x/service/keeper/msg_server_add_service_test.go index 48268469b..ce913e568 100644 --- a/x/service/keeper/msg_server_add_service_test.go +++ b/x/service/keeper/msg_server_add_service_test.go @@ -43,11 +43,12 @@ func TestMsgServer_AddService(t *testing.T) { keepertest.AddAccToAccMapCoins(t, oldServiceOwnerAddr, volatile.DenomuPOKT, oneUPOKTGreaterThanFee) // Add the service to the store - _, err := srv.AddService(ctx, &types.MsgAddService{ + addSvcRes, err := srv.AddService(ctx, &types.MsgAddService{ OwnerAddress: oldServiceOwnerAddr, Service: oldService, }) require.NoError(t, err) + require.Equal(t, &oldService, addSvcRes.GetService()) // Validate the service was added serviceFound, found := k.GetService(ctx, oldService.Id) diff --git a/x/service/types/tx.pb.go b/x/service/types/tx.pb.go index c6c9e1259..5d7dd88e7 100644 --- a/x/service/types/tx.pb.go +++ b/x/service/types/tx.pb.go @@ -314,6 +314,7 @@ func (m *MsgAddService) GetService() types1.Service { } type MsgAddServiceResponse struct { + Service *types1.Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` } func (m *MsgAddServiceResponse) Reset() { *m = MsgAddServiceResponse{} } @@ -345,6 +346,13 @@ func (m *MsgAddServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddServiceResponse proto.InternalMessageInfo +func (m *MsgAddServiceResponse) GetService() *types1.Service { + if m != nil { + return m.Service + } + return nil +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.service.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.service.MsgUpdateParamsResponse") @@ -357,45 +365,46 @@ func init() { func init() { proto.RegisterFile("poktroll/service/tx.proto", fileDescriptor_31ba9559706e649e) } var fileDescriptor_31ba9559706e649e = []byte{ - // 607 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, - 0x14, 0xf7, 0xb5, 0xf9, 0xb6, 0x5f, 0x5f, 0x7f, 0x00, 0x56, 0xa1, 0x8e, 0x25, 0x9c, 0xe0, 0x85, - 0x50, 0x51, 0xbb, 0x29, 0x50, 0xa1, 0x20, 0x86, 0x98, 0xa5, 0x42, 0x0a, 0x42, 0xae, 0x8a, 0x04, - 0x42, 0x8a, 0x2e, 0xf1, 0xc9, 0xb1, 0x5a, 0xfb, 0x2c, 0xdf, 0x25, 0x6d, 0x37, 0xc4, 0xc8, 0xc4, - 0x1f, 0x00, 0x3b, 0x63, 0x06, 0x56, 0xf6, 0x8e, 0x15, 0x53, 0xa7, 0x08, 0x25, 0x43, 0x50, 0xff, - 0x0a, 0x64, 0xfb, 0x9c, 0xd4, 0x49, 0x44, 0x24, 0x96, 0xe4, 0xee, 0x7d, 0x3e, 0xef, 0xc7, 0xe7, - 0xbd, 0x77, 0x86, 0xf9, 0x80, 0x1c, 0xb1, 0x90, 0x1c, 0x1f, 0x1b, 0x14, 0x87, 0x1d, 0xb7, 0x89, - 0x0d, 0x76, 0xaa, 0x07, 0x21, 0x61, 0x44, 0xba, 0x99, 0x42, 0x3a, 0x87, 0x94, 0x5b, 0xc8, 0x73, - 0x7d, 0x62, 0xc4, 0xbf, 0x09, 0x49, 0x51, 0x9b, 0x84, 0x7a, 0x84, 0x1a, 0x0d, 0x44, 0xb1, 0xd1, - 0x29, 0x37, 0x30, 0x43, 0x65, 0xa3, 0x49, 0x5c, 0x9f, 0xe3, 0x9b, 0x1c, 0xf7, 0xa8, 0x63, 0x74, - 0xca, 0xd1, 0x1f, 0x07, 0xf2, 0x09, 0x50,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ef, 0x43, 0xf4, 0xd0, 0xcc, 0x57, 0xe7, 0x7d, 0x15, 0x5c, 0xf4, - 0x55, 0x70, 0xd9, 0x57, 0xc1, 0xaf, 0xbe, 0x0a, 0x3e, 0x0f, 0x54, 0xe1, 0x62, 0xa0, 0x0a, 0x97, - 0x03, 0x55, 0x78, 0xb7, 0xe3, 0xb8, 0xac, 0xd5, 0x6e, 0xe8, 0x4d, 0xe2, 0x19, 0x51, 0xdc, 0x6d, - 0x1f, 0xb3, 0x13, 0x12, 0x1e, 0x19, 0x33, 0xde, 0x60, 0xb4, 0x72, 0xb4, 0xb1, 0x14, 0x7f, 0x40, - 0x1e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe3, 0x94, 0x22, 0x2a, 0x05, 0x00, 0x00, + // 615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xf6, 0xb5, 0xf9, 0xb5, 0x3f, 0x5f, 0xff, 0x00, 0x56, 0xa1, 0x8e, 0x25, 0x9c, 0xe0, 0x85, + 0x50, 0x51, 0xbb, 0x2d, 0x50, 0xa1, 0x22, 0x86, 0x9a, 0xa5, 0x02, 0x05, 0x21, 0x57, 0x45, 0x02, + 0x21, 0x45, 0x97, 0xf8, 0xe4, 0x58, 0xad, 0x7d, 0x96, 0xef, 0x92, 0xb6, 0x1b, 0x62, 0x64, 0xe2, + 0x03, 0xc0, 0xce, 0x98, 0x81, 0x95, 0xbd, 0x63, 0xc5, 0xd4, 0x29, 0x42, 0xc9, 0x10, 0xd4, 0x4f, + 0x81, 0x6c, 0x9f, 0x9d, 0x3a, 0x89, 0x1a, 0x89, 0x25, 0xb9, 0x7b, 0x9f, 0xe7, 0x7d, 0x9f, 0xf7, + 0xdf, 0x19, 0x16, 0x03, 0x72, 0xc8, 0x42, 0x72, 0x74, 0x64, 0x50,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78, 0x3b, 0x97, 0x5d, 0x56, 0xe9, 0xd6, 0x50, + 0x06, 0x5c, 0x2f, 0x93, 0x09, 0x6c, 0x7d, 0x9b, 0x81, 0xb3, 0x55, 0xea, 0x48, 0x1f, 0xe0, 0x62, + 0xee, 0x05, 0xdc, 0x1b, 0xef, 0xd2, 0xc8, 0x96, 0x29, 0x0f, 0xa6, 0x52, 0xb2, 0xcc, 0xde, 0xc1, + 0x85, 0xab, 0x4b, 0x58, 0x9e, 0xe6, 0xa9, 0x54, 0xa6, 0x31, 0xb2, 0xd0, 0x6f, 0x21, 0xbc, 0x32, + 0xa8, 0xd2, 0x44, 0xbf, 0x21, 0x41, 0xb9, 0x3f, 0x85, 0x90, 0xc6, 0x55, 0xfe, 0xfb, 0x18, 0x3d, + 0x4e, 0xf3, 0xf5, 0x59, 0x4f, 0x05, 0xe7, 0x3d, 0x15, 0x5c, 0xf4, 0x54, 0xf0, 0xbb, 0xa7, 0x82, + 0x2f, 0x7d, 0x55, 0x38, 0xef, 0xab, 0xc2, 0x45, 0x5f, 0x15, 0xde, 0x6f, 0x38, 0x2e, 0x6b, 0xb6, + 0xea, 0x7a, 0x83, 0x78, 0x46, 0x14, 0x77, 0xdd, 0xc7, 0xec, 0x98, 0x84, 0x87, 0xc6, 0x84, 0x77, + 0x1b, 0xad, 0x29, 0xad, 0xcf, 0xc5, 0x1f, 0x9d, 0x47, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd8, + 0x94, 0xfb, 0x9f, 0x5e, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -791,6 +800,18 @@ func (m *MsgAddServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Service != nil { + { + size, err := m.Service.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 } @@ -904,6 +925,10 @@ func (m *MsgAddServiceResponse) Size() (n int) { } var l int _ = l + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1477,6 +1502,42 @@ func (m *MsgAddServiceResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgAddServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service == nil { + m.Service = &types1.Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 037698631d8ec9992b605df4ed02428dfe259ccf Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 9 Dec 2024 10:55:18 +0100 Subject: [PATCH 4/6] [Code Health] Ensure tokenomics module msg responses are non-empty (#975) ## Summary Ensure all supplier module msg responses are non-empty. This adds a `Params` field to the following protobuf type(s), and updates the unit tests to assert for presence and correctness. - `MsgUpdateParamsResponse` ## Issue - #663 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [ ] 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 - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/application/query.pulsar.go | 6 +- api/poktroll/tokenomics/tx.pulsar.go | 230 ++++++++++++------ proto/poktroll/tokenomics/tx.proto | 4 +- x/application/types/query.pb.go | 6 +- x/tokenomics/keeper/msg_update_params.go | 4 +- x/tokenomics/keeper/msg_update_params_test.go | 3 +- x/tokenomics/types/tx.pb.go | 134 +++++++--- 7 files changed, 274 insertions(+), 113 deletions(-) diff --git a/api/poktroll/application/query.pulsar.go b/api/poktroll/application/query.pulsar.go index 5349bbc49..85eae4e9f 100644 --- a/api/poktroll/application/query.pulsar.go +++ b/api/poktroll/application/query.pulsar.go @@ -2887,8 +2887,10 @@ type QueryAllApplicationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - DelegateeGatewayAddress string `protobuf:"bytes,2,opt,name=delegatee_gateway_address,json=delegateeGatewayAddress,proto3" json:"delegatee_gateway_address,omitempty"` + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // TODO_MAINNET(@adshmh): rename this field to `gateway_address_delegated_to` + // delegatee_gateway_address, if specified, filters the application list to only include those with delegation to the specified gateway address. + DelegateeGatewayAddress string `protobuf:"bytes,2,opt,name=delegatee_gateway_address,json=delegateeGatewayAddress,proto3" json:"delegatee_gateway_address,omitempty"` } func (x *QueryAllApplicationsRequest) Reset() { diff --git a/api/poktroll/tokenomics/tx.pulsar.go b/api/poktroll/tokenomics/tx.pulsar.go index 516d78e90..d7508f038 100644 --- a/api/poktroll/tokenomics/tx.pulsar.go +++ b/api/poktroll/tokenomics/tx.pulsar.go @@ -518,12 +518,14 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUpdateParamsResponse protoreflect.MessageDescriptor + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor + fd_MsgUpdateParamsResponse_params protoreflect.FieldDescriptor ) func init() { file_poktroll_tokenomics_tx_proto_init() md_MsgUpdateParamsResponse = File_poktroll_tokenomics_tx_proto.Messages().ByName("MsgUpdateParamsResponse") + fd_MsgUpdateParamsResponse_params = md_MsgUpdateParamsResponse.Fields().ByName("params") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) @@ -591,6 +593,12 @@ func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoM // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParamsResponse_params, value) { + return + } + } } // Has reports whether a field is populated. @@ -606,6 +614,8 @@ func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.Field // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + return x.Params != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -622,6 +632,8 @@ func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescri // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + x.Params = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -638,6 +650,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDesc // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -658,6 +673,8 @@ func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.Fie // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + x.Params = value.Message().Interface().(*Params) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -678,6 +695,11 @@ func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescri // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -691,6 +713,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDe // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.tokenomics.MsgUpdateParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParamsResponse")) @@ -760,6 +785,10 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth var n int var l int _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -789,6 +818,20 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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 { @@ -838,6 +881,42 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2111,6 +2190,8 @@ type MsgUpdateParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (x *MsgUpdateParamsResponse) Reset() { @@ -2133,6 +2214,13 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_tokenomics_tx_proto_rawDescGZIP(), []int{1} } +func (x *MsgUpdateParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { state protoimpl.MessageState @@ -2299,65 +2387,68 @@ var file_poktroll_tokenomics_tx_proto_rawDesc = []byte{ 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x25, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x4e, 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, 0x95, 0x03, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0xc2, 0x01, 0x0a, 0x1e, 0x61, 0x73, 0x5f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x61, - 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, - 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, - 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x42, 0x4b, 0xea, 0xde, 0x1f, - 0x1e, 0x61, 0x73, 0x5f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0xf2, - 0xde, 0x1f, 0x25, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x73, 0x5f, 0x6d, 0x69, 0x6e, 0x74, - 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x22, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x73, 0x4d, 0x69, - 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, - 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x66, 0x6c, 0x6f, 0x61, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x46, 0x6c, 0x6f, 0x61, 0x74, - 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xd1, 0x01, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 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, 0x5f, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x95, 0x03, 0x0a, 0x0e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xc2, 0x01, 0x0a, 0x1e, 0x61, 0x73, 0x5f, 0x6d, + 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, + 0x42, 0x4b, 0xea, 0xde, 0x1f, 0x1e, 0x61, 0x73, 0x5f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x6c, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x61, 0x67, 0x65, 0x73, 0xf2, 0xde, 0x1f, 0x25, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x73, + 0x5f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x22, 0x48, 0x00, 0x52, + 0x1b, 0x61, 0x73, 0x4d, 0x69, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x09, + 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, + 0x52, 0x08, 0x61, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, + 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0c, 0xea, 0xde, + 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, + 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x4d, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb9, - 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xa2, - 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, 0x02, 0x13, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, - 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, + 0xd1, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, + 0x69, 0x63, 0x73, 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, 0x5f, 0x0a, 0x0b, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, + 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xb9, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, + 0x69, 0x63, 0x73, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, + 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, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, + 0x6d, 0x69, 0x63, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, + 0xca, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2383,17 +2474,18 @@ var file_poktroll_tokenomics_tx_proto_goTypes = []interface{}{ } var file_poktroll_tokenomics_tx_proto_depIdxs = []int32{ 4, // 0: poktroll.tokenomics.MsgUpdateParams.params:type_name -> poktroll.tokenomics.Params - 5, // 1: poktroll.tokenomics.MsgUpdateParam.as_mint_allocation_percentages:type_name -> poktroll.tokenomics.MintAllocationPercentages - 4, // 2: poktroll.tokenomics.MsgUpdateParamResponse.params:type_name -> poktroll.tokenomics.Params - 0, // 3: poktroll.tokenomics.Msg.UpdateParams:input_type -> poktroll.tokenomics.MsgUpdateParams - 2, // 4: poktroll.tokenomics.Msg.UpdateParam:input_type -> poktroll.tokenomics.MsgUpdateParam - 1, // 5: poktroll.tokenomics.Msg.UpdateParams:output_type -> poktroll.tokenomics.MsgUpdateParamsResponse - 3, // 6: poktroll.tokenomics.Msg.UpdateParam:output_type -> poktroll.tokenomics.MsgUpdateParamResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] 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 + 4, // 1: poktroll.tokenomics.MsgUpdateParamsResponse.params:type_name -> poktroll.tokenomics.Params + 5, // 2: poktroll.tokenomics.MsgUpdateParam.as_mint_allocation_percentages:type_name -> poktroll.tokenomics.MintAllocationPercentages + 4, // 3: poktroll.tokenomics.MsgUpdateParamResponse.params:type_name -> poktroll.tokenomics.Params + 0, // 4: poktroll.tokenomics.Msg.UpdateParams:input_type -> poktroll.tokenomics.MsgUpdateParams + 2, // 5: poktroll.tokenomics.Msg.UpdateParam:input_type -> poktroll.tokenomics.MsgUpdateParam + 1, // 6: poktroll.tokenomics.Msg.UpdateParams:output_type -> poktroll.tokenomics.MsgUpdateParamsResponse + 3, // 7: poktroll.tokenomics.Msg.UpdateParam:output_type -> poktroll.tokenomics.MsgUpdateParamResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] 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_tokenomics_tx_proto_init() } diff --git a/proto/poktroll/tokenomics/tx.proto b/proto/poktroll/tokenomics/tx.proto index b20145c15..344856a51 100644 --- a/proto/poktroll/tokenomics/tx.proto +++ b/proto/poktroll/tokenomics/tx.proto @@ -40,7 +40,9 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -message MsgUpdateParamsResponse {} +message MsgUpdateParamsResponse { + Params params = 1; +} // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. message MsgUpdateParam { diff --git a/x/application/types/query.pb.go b/x/application/types/query.pb.go index 61dddd8e2..e0377020a 100644 --- a/x/application/types/query.pb.go +++ b/x/application/types/query.pb.go @@ -188,8 +188,10 @@ func (m *QueryGetApplicationResponse) GetApplication() Application { } type QueryAllApplicationsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - DelegateeGatewayAddress string `protobuf:"bytes,2,opt,name=delegatee_gateway_address,json=delegateeGatewayAddress,proto3" json:"delegatee_gateway_address,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // TODO_MAINNET(@adshmh): rename this field to `gateway_address_delegated_to` + // delegatee_gateway_address, if specified, filters the application list to only include those with delegation to the specified gateway address. + DelegateeGatewayAddress string `protobuf:"bytes,2,opt,name=delegatee_gateway_address,json=delegateeGatewayAddress,proto3" json:"delegatee_gateway_address,omitempty"` } func (m *QueryAllApplicationsRequest) Reset() { *m = QueryAllApplicationsRequest{} } diff --git a/x/tokenomics/keeper/msg_update_params.go b/x/tokenomics/keeper/msg_update_params.go index 16e1bfe95..afa981dfb 100644 --- a/x/tokenomics/keeper/msg_update_params.go +++ b/x/tokenomics/keeper/msg_update_params.go @@ -38,5 +38,7 @@ func (k msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) logger.Info("Done updating params") - return &types.MsgUpdateParamsResponse{}, nil + return &types.MsgUpdateParamsResponse{ + Params: &msg.Params, + }, nil } diff --git a/x/tokenomics/keeper/msg_update_params_test.go b/x/tokenomics/keeper/msg_update_params_test.go index 163cb10fb..71375b179 100644 --- a/x/tokenomics/keeper/msg_update_params_test.go +++ b/x/tokenomics/keeper/msg_update_params_test.go @@ -120,11 +120,12 @@ func TestMsgUpdateParams(t *testing.T) { for _, test := range tests { t.Run(test.desc, func(t *testing.T) { - _, err := srv.UpdateParams(ctx, test.req) + updateRes, err := srv.UpdateParams(ctx, test.req) if test.shouldError { require.Error(t, err) require.ErrorContains(t, err, test.expectedErrMsg) } else { + require.Equal(t, &test.req.Params, updateRes.GetParams()) require.Nil(t, err) } }) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index a08ce9be9..eb33636b4 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -87,6 +87,7 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. type MsgUpdateParamsResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } @@ -118,6 +119,13 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +func (m *MsgUpdateParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + // MsgUpdateParam is the Msg/UpdateParam request type to update a single param. type MsgUpdateParam struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). @@ -284,43 +292,43 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/tx.proto", fileDescriptor_aa0f2fdbd9b6d7eb) } var fileDescriptor_aa0f2fdbd9b6d7eb = []byte{ - // 561 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xf6, 0x91, 0x7e, 0xf9, 0x5a, 0x8a, 0x30, 0x15, 0x75, 0x53, 0xe4, 0x44, 0x86, 0x4a, 0x21, - 0xb4, 0xb6, 0x68, 0x24, 0x84, 0x32, 0x20, 0xd5, 0x03, 0x8a, 0x84, 0x22, 0x15, 0x23, 0x16, 0x16, - 0xeb, 0x92, 0x1c, 0xae, 0x15, 0xfb, 0xce, 0xf2, 0x5d, 0xa1, 0xd9, 0x10, 0x23, 0x13, 0x0b, 0xff, - 0x81, 0x31, 0x03, 0xbf, 0x00, 0x96, 0x8e, 0x85, 0xa9, 0x53, 0x84, 0x92, 0x21, 0x52, 0x46, 0x7e, - 0x01, 0xf2, 0x47, 0xe2, 0xba, 0x32, 0x34, 0xea, 0x62, 0xdf, 0xbd, 0xcf, 0xfb, 0x71, 0xcf, 0x73, - 0xcf, 0xc1, 0x7b, 0x3e, 0xed, 0xf2, 0x80, 0xba, 0xae, 0xce, 0x69, 0x17, 0x13, 0xea, 0x39, 0x6d, - 0xa6, 0xf3, 0x13, 0xcd, 0x0f, 0x28, 0xa7, 0xd2, 0x9d, 0x29, 0xaa, 0xa5, 0x68, 0xf1, 0x36, 0xf2, - 0x1c, 0x42, 0xf5, 0xe8, 0x1b, 0xe7, 0x15, 0x37, 0xdb, 0x94, 0x79, 0x94, 0xe9, 0x1e, 0xb3, 0xf5, - 0x77, 0x8f, 0xc3, 0x5f, 0x02, 0x6c, 0xc5, 0x80, 0x15, 0xed, 0xf4, 0x78, 0x93, 0x40, 0x1b, 0x36, - 0xb5, 0x69, 0x1c, 0x0f, 0x57, 0x49, 0xb4, 0x9c, 0x77, 0x1e, 0x1f, 0x05, 0xc8, 0x4b, 0xea, 0xd4, - 0x1f, 0x00, 0xde, 0x6a, 0x32, 0xfb, 0xb5, 0xdf, 0x41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 0x00, 0xff, 0xff, 0x4c, 0x0c, 0x38, 0xd8, 0xa9, 0x04, 0x00, - 0x00, + // 563 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xf6, 0x91, 0x7e, 0xf9, 0x5a, 0x8a, 0x30, 0x15, 0x35, 0x29, 0x72, 0x22, 0x43, 0xa5, 0x10, + 0x5a, 0x5b, 0x34, 0x12, 0x42, 0x19, 0x90, 0xea, 0x01, 0x45, 0x42, 0x41, 0xc5, 0x88, 0x85, 0xc5, + 0xba, 0x24, 0x87, 0x6b, 0xc5, 0xbe, 0xb3, 0x7c, 0x57, 0x68, 0x36, 0xc4, 0xc8, 0xc4, 0xc2, 0x7f, + 0x60, 0xcc, 0xc0, 0x2f, 0x80, 0xa5, 0x63, 0x61, 0xea, 0x14, 0xa1, 0x64, 0x88, 0x94, 0x91, 0x5f, + 0x80, 0xfc, 0x91, 0xb8, 0xae, 0x0c, 0x8d, 0x60, 0x49, 0xee, 0xde, 0xe7, 0xfd, 0x78, 0xde, 0xe7, + 0xde, 0xd7, 0xf0, 0xb6, 0x4f, 0xbb, 0x3c, 0xa0, 0xae, 0xab, 0x73, 0xda, 0xc5, 0x84, 0x7a, 0x4e, + 0x9b, 0xe9, 0xfc, 0x58, 0xf3, 0x03, 0xca, 0xa9, 0x74, 0x63, 0x8a, 0x6a, 0x29, 0x5a, 0xbc, 0x8e, + 0x3c, 0x87, 0x50, 0x3d, 0xfa, 0x8d, 0xfd, 0x8a, 0x9b, 0x6d, 0xca, 0x3c, 0xca, 0x74, 0x8f, 0xd9, + 0xfa, 0x9b, 0x07, 0xe1, 0x5f, 0x02, 0xdc, 0x8a, 0x01, 0x2b, 0xba, 0xe9, 0xf1, 0x25, 0x81, 0x36, + 0x6c, 0x6a, 0xd3, 0xd8, 0x1e, 0x9e, 0x12, 0x6b, 0x39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0x98, 0xbf, 0xa5, 0x41, 0x57, 0xcf, 0xdf, 0xb3, 0x50, 0x74, 0xd6, + 0x5a, 0x8a, 0x3e, 0x15, 0xb5, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x0d, 0x78, 0xc9, 0xde, + 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -503,6 +511,18 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.Params != nil { + { + size, err := m.Params.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 } @@ -667,6 +687,10 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { } var l int _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -884,6 +908,42 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 23b4c88eb0eb8666a03b53c03e39072080d7f59a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 9 Dec 2024 17:00:54 +0100 Subject: [PATCH 5/6] [Code Health] Ensure application module msg responses are non-empty (#974) ## Summary Ensure all application module msg responses are non-empty. This adds a `Application` field to the following protobuf type(s), and updates the unit tests to assert for presence and correctness. - `MsgUnstakeApplicationResponse` - `MsgUndelegateFromGatewayResponse` ## Issue - #663 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [ ] 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 - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/application/tx.pulsar.go | 497 ++++++++++++------ proto/poktroll/application/tx.proto | 8 +- .../msg_server_delegate_to_gateway_test.go | 28 +- .../msg_server_stake_application_test.go | 27 +- .../msg_server_undelegate_from_gateway.go | 4 +- ...msg_server_undelegate_from_gateway_test.go | 9 +- .../keeper/msg_server_unstake_application.go | 4 +- .../msg_server_unstake_application_test.go | 6 +- x/application/types/tx.pb.go | 236 +++++++-- 9 files changed, 576 insertions(+), 243 deletions(-) diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index d0e0c31e7..58fc70aa6 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -5,11 +5,11 @@ import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -2366,12 +2366,14 @@ func (x *fastReflection_MsgUnstakeApplication) ProtoMethods() *protoiface.Method } var ( - md_MsgUnstakeApplicationResponse protoreflect.MessageDescriptor + md_MsgUnstakeApplicationResponse protoreflect.MessageDescriptor + fd_MsgUnstakeApplicationResponse_application protoreflect.FieldDescriptor ) func init() { file_poktroll_application_tx_proto_init() md_MsgUnstakeApplicationResponse = File_poktroll_application_tx_proto.Messages().ByName("MsgUnstakeApplicationResponse") + fd_MsgUnstakeApplicationResponse_application = md_MsgUnstakeApplicationResponse.Fields().ByName("application") } var _ protoreflect.Message = (*fastReflection_MsgUnstakeApplicationResponse)(nil) @@ -2439,6 +2441,12 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Interface() protoreflect. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUnstakeApplicationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgUnstakeApplicationResponse_application, value) { + return + } + } } // Has reports whether a field is populated. @@ -2454,6 +2462,8 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Range(f func(protoreflect // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUnstakeApplicationResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.application": + return x.Application != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUnstakeApplicationResponse")) @@ -2470,6 +2480,8 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Has(fd protoreflect.Field // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeApplicationResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.application": + x.Application = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUnstakeApplicationResponse")) @@ -2486,6 +2498,9 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Clear(fd protoreflect.Fie // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUnstakeApplicationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.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.MsgUnstakeApplicationResponse")) @@ -2506,6 +2521,8 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Get(descriptor protorefle // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeApplicationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.application": + x.Application = value.Message().Interface().(*Application) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUnstakeApplicationResponse")) @@ -2526,6 +2543,11 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Set(fd protoreflect.Field // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeApplicationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.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.MsgUnstakeApplicationResponse")) @@ -2539,6 +2561,9 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) Mutable(fd protoreflect.F // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUnstakeApplicationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgUnstakeApplicationResponse.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.MsgUnstakeApplicationResponse")) @@ -2608,6 +2633,10 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) ProtoMethods() *protoifac 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) } @@ -2637,6 +2666,20 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) ProtoMethods() *protoifac 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 { @@ -2686,6 +2729,42 @@ func (x *fastReflection_MsgUnstakeApplicationResponse) ProtoMethods() *protoifac return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUnstakeApplicationResponse: 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:]) @@ -4125,12 +4204,14 @@ func (x *fastReflection_MsgUndelegateFromGateway) ProtoMethods() *protoiface.Met } var ( - md_MsgUndelegateFromGatewayResponse protoreflect.MessageDescriptor + md_MsgUndelegateFromGatewayResponse protoreflect.MessageDescriptor + fd_MsgUndelegateFromGatewayResponse_application protoreflect.FieldDescriptor ) func init() { file_poktroll_application_tx_proto_init() md_MsgUndelegateFromGatewayResponse = File_poktroll_application_tx_proto.Messages().ByName("MsgUndelegateFromGatewayResponse") + fd_MsgUndelegateFromGatewayResponse_application = md_MsgUndelegateFromGatewayResponse.Fields().ByName("application") } var _ protoreflect.Message = (*fastReflection_MsgUndelegateFromGatewayResponse)(nil) @@ -4198,6 +4279,12 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Interface() protorefle // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgUndelegateFromGatewayResponse_application, value) { + return + } + } } // Has reports whether a field is populated. @@ -4213,6 +4300,8 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Range(f func(protorefl // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.application": + return x.Application != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUndelegateFromGatewayResponse")) @@ -4229,6 +4318,8 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Has(fd protoreflect.Fi // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.application": + x.Application = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUndelegateFromGatewayResponse")) @@ -4245,6 +4336,9 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Clear(fd protoreflect. // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.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.MsgUndelegateFromGatewayResponse")) @@ -4265,6 +4359,8 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Get(descriptor protore // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.application": + x.Application = value.Message().Interface().(*Application) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUndelegateFromGatewayResponse")) @@ -4285,6 +4381,11 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Set(fd protoreflect.Fi // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUndelegateFromGatewayResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.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.MsgUndelegateFromGatewayResponse")) @@ -4298,6 +4399,9 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) Mutable(fd protoreflec // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUndelegateFromGatewayResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.application.MsgUndelegateFromGatewayResponse.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.MsgUndelegateFromGatewayResponse")) @@ -4367,6 +4471,10 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) ProtoMethods() *protoi 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) } @@ -4396,6 +4504,20 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) ProtoMethods() *protoi 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 { @@ -4445,6 +4567,42 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) ProtoMethods() *protoi return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegateFromGatewayResponse: 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:]) @@ -6713,6 +6871,8 @@ type MsgUnstakeApplicationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (x *MsgUnstakeApplicationResponse) Reset() { @@ -6735,6 +6895,13 @@ func (*MsgUnstakeApplicationResponse) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{5} } +func (x *MsgUnstakeApplicationResponse) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + type MsgDelegateToGateway struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6860,6 +7027,8 @@ type MsgUndelegateFromGatewayResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (x *MsgUndelegateFromGatewayResponse) Reset() { @@ -6882,6 +7051,13 @@ func (*MsgUndelegateFromGatewayResponse) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{9} } +func (x *MsgUndelegateFromGatewayResponse) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + type MsgTransferApplication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7139,140 +7315,149 @@ var file_poktroll_application_tx_proto_rawDesc = []byte{ 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, + 0x22, 0x64, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, - 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, - 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x63, 0x0a, 0x1c, 0x4d, 0x73, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xaa, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x0b, - 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x70, 0x70, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, - 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x22, 0x0a, 0x20, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, - 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xb9, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 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, 0x0d, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x65, 0x0a, 0x1e, - 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xe7, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 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, 0x42, 0x0b, 0xea, 0xde, - 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, - 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4e, 0x0a, - 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 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, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xb0, 0x06, - 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, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x10, 0x82, + 0xe7, 0xb0, 0x2a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0x63, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x43, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xaa, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0a, 0x61, 0x70, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x0f, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, + 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x67, 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, 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, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x13, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, + 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb9, 0x01, 0x0a, 0x16, 0x4d, + 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x65, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x24, 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, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe7, 0x01, + 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, + 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, + 0x52, 0x08, 0x61, 0x73, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, + 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 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, 0x42, 0x0b, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, + 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, + 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x08, 0x0a, + 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4e, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 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, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xb0, 0x06, 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, 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, + 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x61, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x24, 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, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, + 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7313,29 +7498,31 @@ var file_poktroll_application_tx_proto_depIdxs = []int32{ 15, // 1: poktroll.application.MsgStakeApplication.stake:type_name -> cosmos.base.v1beta1.Coin 16, // 2: poktroll.application.MsgStakeApplication.services:type_name -> poktroll.shared.ApplicationServiceConfig 17, // 3: poktroll.application.MsgStakeApplicationResponse.application:type_name -> poktroll.application.Application - 17, // 4: poktroll.application.MsgDelegateToGatewayResponse.application:type_name -> poktroll.application.Application - 17, // 5: poktroll.application.MsgTransferApplicationResponse.application:type_name -> poktroll.application.Application - 15, // 6: poktroll.application.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin - 14, // 7: poktroll.application.MsgUpdateParamResponse.params:type_name -> poktroll.application.Params - 0, // 8: poktroll.application.Msg.UpdateParams:input_type -> poktroll.application.MsgUpdateParams - 2, // 9: poktroll.application.Msg.StakeApplication:input_type -> poktroll.application.MsgStakeApplication - 4, // 10: poktroll.application.Msg.UnstakeApplication:input_type -> poktroll.application.MsgUnstakeApplication - 6, // 11: poktroll.application.Msg.DelegateToGateway:input_type -> poktroll.application.MsgDelegateToGateway - 8, // 12: poktroll.application.Msg.UndelegateFromGateway:input_type -> poktroll.application.MsgUndelegateFromGateway - 10, // 13: poktroll.application.Msg.TransferApplication:input_type -> poktroll.application.MsgTransferApplication - 12, // 14: poktroll.application.Msg.UpdateParam:input_type -> poktroll.application.MsgUpdateParam - 1, // 15: poktroll.application.Msg.UpdateParams:output_type -> poktroll.application.MsgUpdateParamsResponse - 3, // 16: poktroll.application.Msg.StakeApplication:output_type -> poktroll.application.MsgStakeApplicationResponse - 5, // 17: poktroll.application.Msg.UnstakeApplication:output_type -> poktroll.application.MsgUnstakeApplicationResponse - 7, // 18: poktroll.application.Msg.DelegateToGateway:output_type -> poktroll.application.MsgDelegateToGatewayResponse - 9, // 19: poktroll.application.Msg.UndelegateFromGateway:output_type -> poktroll.application.MsgUndelegateFromGatewayResponse - 11, // 20: poktroll.application.Msg.TransferApplication:output_type -> poktroll.application.MsgTransferApplicationResponse - 13, // 21: poktroll.application.Msg.UpdateParam:output_type -> poktroll.application.MsgUpdateParamResponse - 15, // [15:22] is the sub-list for method output_type - 8, // [8:15] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 17, // 4: poktroll.application.MsgUnstakeApplicationResponse.application:type_name -> poktroll.application.Application + 17, // 5: poktroll.application.MsgDelegateToGatewayResponse.application:type_name -> poktroll.application.Application + 17, // 6: poktroll.application.MsgUndelegateFromGatewayResponse.application:type_name -> poktroll.application.Application + 17, // 7: poktroll.application.MsgTransferApplicationResponse.application:type_name -> poktroll.application.Application + 15, // 8: poktroll.application.MsgUpdateParam.as_coin:type_name -> cosmos.base.v1beta1.Coin + 14, // 9: poktroll.application.MsgUpdateParamResponse.params:type_name -> poktroll.application.Params + 0, // 10: poktroll.application.Msg.UpdateParams:input_type -> poktroll.application.MsgUpdateParams + 2, // 11: poktroll.application.Msg.StakeApplication:input_type -> poktroll.application.MsgStakeApplication + 4, // 12: poktroll.application.Msg.UnstakeApplication:input_type -> poktroll.application.MsgUnstakeApplication + 6, // 13: poktroll.application.Msg.DelegateToGateway:input_type -> poktroll.application.MsgDelegateToGateway + 8, // 14: poktroll.application.Msg.UndelegateFromGateway:input_type -> poktroll.application.MsgUndelegateFromGateway + 10, // 15: poktroll.application.Msg.TransferApplication:input_type -> poktroll.application.MsgTransferApplication + 12, // 16: poktroll.application.Msg.UpdateParam:input_type -> poktroll.application.MsgUpdateParam + 1, // 17: poktroll.application.Msg.UpdateParams:output_type -> poktroll.application.MsgUpdateParamsResponse + 3, // 18: poktroll.application.Msg.StakeApplication:output_type -> poktroll.application.MsgStakeApplicationResponse + 5, // 19: poktroll.application.Msg.UnstakeApplication:output_type -> poktroll.application.MsgUnstakeApplicationResponse + 7, // 20: poktroll.application.Msg.DelegateToGateway:output_type -> poktroll.application.MsgDelegateToGatewayResponse + 9, // 21: poktroll.application.Msg.UndelegateFromGateway:output_type -> poktroll.application.MsgUndelegateFromGatewayResponse + 11, // 22: poktroll.application.Msg.TransferApplication:output_type -> poktroll.application.MsgTransferApplicationResponse + 13, // 23: poktroll.application.Msg.UpdateParam:output_type -> poktroll.application.MsgUpdateParamResponse + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_poktroll_application_tx_proto_init() } diff --git a/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index 9fc236bf8..5930b6a75 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -69,7 +69,9 @@ message MsgUnstakeApplication { string address = 1; } -message MsgUnstakeApplicationResponse {} +message MsgUnstakeApplicationResponse { + poktroll.application.Application application = 1; +} message MsgDelegateToGateway { option (cosmos.msg.v1.signer) = "app_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries @@ -87,7 +89,9 @@ message MsgUndelegateFromGateway { string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to undelegate from. } -message MsgUndelegateFromGatewayResponse {} +message MsgUndelegateFromGatewayResponse { + poktroll.application.Application application = 1; +} message MsgTransferApplication { option (cosmos.msg.v1.signer) = "source_address"; diff --git a/x/application/keeper/msg_server_delegate_to_gateway_test.go b/x/application/keeper/msg_server_delegate_to_gateway_test.go index 873817d8b..108d491e3 100644 --- a/x/application/keeper/msg_server_delegate_to_gateway_test.go +++ b/x/application/keeper/msg_server_delegate_to_gateway_test.go @@ -37,10 +37,19 @@ func TestMsgServer_DelegateToGateway_SuccessfullyDelegate(t *testing.T) { }, } + expectedApp := &apptypes.Application{ + Address: stakeMsg.GetAddress(), + Stake: stakeMsg.GetStake(), + ServiceConfigs: stakeMsg.GetServices(), + DelegateeGatewayAddresses: make([]string, 0), + PendingUndelegations: make(map[uint64]apptypes.UndelegatingGatewayList), + } + // Stake the application & verify that the application exists _, err := srv.StakeApplication(ctx, stakeMsg) require.NoError(t, err) - _, isAppFound := k.GetApplication(ctx, appAddr) + foundApp, isAppFound := k.GetApplication(ctx, appAddr) + require.Equal(t, expectedApp, &foundApp) require.True(t, isAppFound) // Prepare the delegation message @@ -49,21 +58,17 @@ func TestMsgServer_DelegateToGateway_SuccessfullyDelegate(t *testing.T) { GatewayAddress: gatewayAddr1, } + expectedApp.DelegateeGatewayAddresses = append(expectedApp.DelegateeGatewayAddresses, gatewayAddr1) + // Delegate the application to the gateway - _, err = srv.DelegateToGateway(ctx, delegateMsg) + delegateRes, err := srv.DelegateToGateway(ctx, delegateMsg) require.NoError(t, err) + require.Equal(t, delegateRes.GetApplication(), expectedApp) sdkCtx := sdk.UnwrapSDKContext(ctx) currentHeight := sdkCtx.BlockHeight() sharedParams := sharedtypes.DefaultParams() sessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, currentHeight) - expectedApp := &apptypes.Application{ - Address: stakeMsg.GetAddress(), - Stake: stakeMsg.GetStake(), - ServiceConfigs: stakeMsg.GetServices(), - DelegateeGatewayAddresses: []string{gatewayAddr1}, - PendingUndelegations: make(map[uint64]apptypes.UndelegatingGatewayList), - } expectedEvent := &apptypes.EventRedelegation{ Application: expectedApp, SessionEndHeight: sessionEndHeight, @@ -77,11 +82,6 @@ func TestMsgServer_DelegateToGateway_SuccessfullyDelegate(t *testing.T) { // Reset the events, as if a new block were created. ctx, sdkCtx = testevents.ResetEventManager(ctx) - // Verify that the application exists - foundApp, isAppFound := k.GetApplication(ctx, appAddr) - require.True(t, isAppFound) - require.EqualValues(t, expectedApp, &foundApp) - // Prepare a second delegation message delegateMsg2 := &apptypes.MsgDelegateToGateway{ AppAddress: appAddr, diff --git a/x/application/keeper/msg_server_stake_application_test.go b/x/application/keeper/msg_server_stake_application_test.go index be52fc518..b76aef6b7 100644 --- a/x/application/keeper/msg_server_stake_application_test.go +++ b/x/application/keeper/msg_server_stake_application_test.go @@ -42,10 +42,14 @@ func TestMsgServer_StakeApplication_SuccessfulCreateAndUpdate(t *testing.T) { require.NoError(t, err) // Assert that the response contains the staked application. - app := stakeAppRes.GetApplication() - require.Equal(t, stakeMsg.GetAddress(), app.GetAddress()) - require.Equal(t, stakeMsg.GetStake(), app.GetStake()) - require.Equal(t, stakeMsg.GetServices(), app.GetServiceConfigs()) + expectedApp := &apptypes.Application{ + Address: stakeMsg.GetAddress(), + Stake: stakeMsg.GetStake(), + ServiceConfigs: stakeMsg.GetServices(), + PendingUndelegations: make(map[uint64]apptypes.UndelegatingGatewayList), + DelegateeGatewayAddresses: make([]string, 0), + } + require.Equal(t, expectedApp, stakeAppRes.GetApplication()) // Assert that the EventApplicationStaked event is emitted. sharedParams := sharedtypes.DefaultParams() @@ -53,7 +57,7 @@ func TestMsgServer_StakeApplication_SuccessfulCreateAndUpdate(t *testing.T) { sessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, currentHeight) expectedEvent, err := cosmostypes.TypedEventToEvent( &apptypes.EventApplicationStaked{ - Application: app, + Application: stakeAppRes.GetApplication(), SessionEndHeight: sessionEndHeight, }, ) @@ -85,8 +89,19 @@ func TestMsgServer_StakeApplication_SuccessfulCreateAndUpdate(t *testing.T) { } // Update the staked application - _, err = srv.StakeApplication(ctx, updateStakeMsg) + stakeAppRes, err = srv.StakeApplication(ctx, updateStakeMsg) require.NoError(t, err) + + // Assert that the response contains the staked application. + expectedApp = &apptypes.Application{ + Address: updateStakeMsg.GetAddress(), + Stake: updateStakeMsg.GetStake(), + ServiceConfigs: updateStakeMsg.GetServices(), + PendingUndelegations: make(map[uint64]apptypes.UndelegatingGatewayList), + DelegateeGatewayAddresses: make([]string, 0), + } + require.Equal(t, expectedApp, stakeAppRes.GetApplication()) + foundApp, isAppFound = k.GetApplication(ctx, appAddr) require.True(t, isAppFound) require.Equal(t, &upStake, foundApp.Stake) diff --git a/x/application/keeper/msg_server_undelegate_from_gateway.go b/x/application/keeper/msg_server_undelegate_from_gateway.go index 9fd7b1258..9dbd1ee1d 100644 --- a/x/application/keeper/msg_server_undelegate_from_gateway.go +++ b/x/application/keeper/msg_server_undelegate_from_gateway.go @@ -87,7 +87,9 @@ func (k msgServer) UndelegateFromGateway(ctx context.Context, msg *apptypes.MsgU logger.Info(fmt.Sprintf("Emitted application redelegation event %v", event)) isSuccessful = true - return &apptypes.MsgUndelegateFromGatewayResponse{}, nil + return &apptypes.MsgUndelegateFromGatewayResponse{ + Application: &foundApp, + }, nil } // recordPendingUndelegation adds the given gateway address to the application's diff --git a/x/application/keeper/msg_server_undelegate_from_gateway_test.go b/x/application/keeper/msg_server_undelegate_from_gateway_test.go index 4a2f7663b..c1a710d8f 100644 --- a/x/application/keeper/msg_server_undelegate_from_gateway_test.go +++ b/x/application/keeper/msg_server_undelegate_from_gateway_test.go @@ -102,10 +102,6 @@ func TestMsgServer_UndelegateFromGateway_SuccessfullyUndelegate(t *testing.T) { GatewayAddress: expectedGatewayAddresses[3], } - // Undelegate the application from the gateway - _, err = srv.UndelegateFromGateway(ctx, undelegateMsg) - require.NoError(t, err) - // Assert that the EventRedelegation event is emitted. expectedGatewayAddresses = append(expectedGatewayAddresses[:3], expectedGatewayAddresses[4:]...) expectedApp := &apptypes.Application{ @@ -118,6 +114,11 @@ func TestMsgServer_UndelegateFromGateway_SuccessfullyUndelegate(t *testing.T) { }, } + // Undelegate the application from the gateway + undelegateRes, err := srv.UndelegateFromGateway(ctx, undelegateMsg) + require.NoError(t, err) + require.Equal(t, undelegateRes.GetApplication(), expectedApp) + events = sdkCtx.EventManager().Events() redelgationEvents = testevents.FilterEvents[*apptypes.EventRedelegation](t, events) lastEventIdx := len(redelgationEvents) - 1 diff --git a/x/application/keeper/msg_server_unstake_application.go b/x/application/keeper/msg_server_unstake_application.go index bdd3a6bb5..7534cde46 100644 --- a/x/application/keeper/msg_server_unstake_application.go +++ b/x/application/keeper/msg_server_unstake_application.go @@ -94,5 +94,7 @@ func (k msgServer) UnstakeApplication( } isSuccessful = true - return &apptypes.MsgUnstakeApplicationResponse{}, nil + return &apptypes.MsgUnstakeApplicationResponse{ + Application: &foundApp, + }, nil } diff --git a/x/application/keeper/msg_server_unstake_application_test.go b/x/application/keeper/msg_server_unstake_application_test.go index 68fb1db13..c09672360 100644 --- a/x/application/keeper/msg_server_unstake_application_test.go +++ b/x/application/keeper/msg_server_unstake_application_test.go @@ -146,12 +146,14 @@ func TestMsgServer_UnstakeApplication_CancelUnbondingIfRestaked(t *testing.T) { // Initiate the application unstaking unstakeMsg := &apptypes.MsgUnstakeApplication{Address: appAddr} - _, err = srv.UnstakeApplication(ctx, unstakeMsg) + unstakeRes, err := srv.UnstakeApplication(ctx, unstakeMsg) require.NoError(t, err) - // Assert that the EventApplicationUnbondingBegin event is emitted. foundApp.UnstakeSessionEndHeight = uint64(sessionEndHeight) foundApp.DelegateeGatewayAddresses = make([]string, 0) + require.Equal(t, &foundApp, unstakeRes.GetApplication()) + + // Assert that the EventApplicationUnbondingBegin event is emitted. unbondingEndHeight := apptypes.GetApplicationUnbondingHeight(&sharedParams, &foundApp) expectedAppUnbondingBeginEvent := &apptypes.EventApplicationUnbondingBegin{ Application: &foundApp, diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go index 99df3c002..27f5f6f20 100644 --- a/x/application/types/tx.pb.go +++ b/x/application/types/tx.pb.go @@ -256,6 +256,7 @@ func (m *MsgUnstakeApplication) GetAddress() string { } type MsgUnstakeApplicationResponse struct { + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (m *MsgUnstakeApplicationResponse) Reset() { *m = MsgUnstakeApplicationResponse{} } @@ -287,6 +288,13 @@ func (m *MsgUnstakeApplicationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnstakeApplicationResponse proto.InternalMessageInfo +func (m *MsgUnstakeApplicationResponse) GetApplication() *Application { + if m != nil { + return m.Application + } + return nil +} + type MsgDelegateToGateway struct { AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` @@ -424,6 +432,7 @@ func (m *MsgUndelegateFromGateway) GetGatewayAddress() string { } type MsgUndelegateFromGatewayResponse struct { + Application *Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` } func (m *MsgUndelegateFromGatewayResponse) Reset() { *m = MsgUndelegateFromGatewayResponse{} } @@ -455,6 +464,13 @@ func (m *MsgUndelegateFromGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUndelegateFromGatewayResponse proto.InternalMessageInfo +func (m *MsgUndelegateFromGatewayResponse) GetApplication() *Application { + if m != nil { + return m.Application + } + return nil +} + type MsgTransferApplication 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"` @@ -702,64 +718,64 @@ func init() { func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 903 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0xdb, 0x56, - 0x10, 0xd7, 0x8b, 0x1d, 0xc5, 0x3a, 0x25, 0x4e, 0x42, 0x3b, 0x0d, 0xcd, 0x26, 0xb4, 0x42, 0xb4, - 0x85, 0xe3, 0xda, 0x24, 0xac, 0x08, 0x06, 0xa2, 0xc5, 0x90, 0xdc, 0x3f, 0xe9, 0xa0, 0xa2, 0xa0, - 0x9d, 0xa5, 0x8b, 0xf0, 0x24, 0xbd, 0xd0, 0x84, 0x25, 0x3e, 0x82, 0xef, 0x49, 0x89, 0xa6, 0x16, - 0x1d, 0x3b, 0xf5, 0x53, 0x14, 0x45, 0x27, 0x0d, 0x5d, 0xfa, 0x01, 0x0a, 0x64, 0x6b, 0xd0, 0x29, - 0x93, 0x51, 0xc8, 0x83, 0x80, 0x7c, 0x8a, 0x82, 0x7f, 0x45, 0x51, 0x54, 0x45, 0x17, 0x19, 0xba, - 0xd8, 0xe4, 0xbb, 0xdf, 0xdd, 0xfd, 0x7e, 0x77, 0xd4, 0xdd, 0x83, 0x87, 0x36, 0x3d, 0xe7,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x17, 0x5e, 0x5f, 0x6c, 0xe7, 0x7e, 0x99, 0x8c, 0x76, 0x91, 0x1e, - 0xb8, 0x55, 0x9f, 0xfe, 0x30, 0x19, 0xed, 0x4e, 0x03, 0xfe, 0x38, 0x19, 0xed, 0x7e, 0x12, 0xd1, - 0x7f, 0x35, 0xa3, 0x31, 0xc1, 0x59, 0xd9, 0x82, 0xfb, 0x89, 0x23, 0x9d, 0x30, 0x9b, 0x5a, 0x8c, - 0x28, 0x7f, 0x22, 0xd8, 0x68, 0x30, 0xe3, 0x84, 0xe3, 0x73, 0x52, 0x9b, 0x86, 0x10, 0xca, 0x70, - 0x03, 0xfb, 0x52, 0x96, 0x8a, 0x0c, 0x81, 0x82, 0x06, 0xd7, 0x99, 0x1b, 0x27, 0x50, 0xb8, 0xa5, - 0x06, 0x70, 0xb7, 0xe3, 0x6a, 0xd0, 0x71, 0xf5, 0x98, 0x9a, 0x96, 0xee, 0xe3, 0x84, 0xcf, 0x61, - 0x2d, 0x28, 0x38, 0x13, 0x57, 0x4a, 0x2b, 0x3b, 0xc5, 0xf2, 0xe3, 0x69, 0x55, 0xfc, 0x8e, 0xa8, - 0x31, 0x52, 0x27, 0x3e, 0xf6, 0x98, 0x5a, 0x2f, 0x4c, 0x43, 0x8f, 0x5c, 0xab, 0x37, 0xdd, 0xca, - 0x84, 0x2c, 0x94, 0x16, 0x7c, 0x98, 0x22, 0x28, 0x14, 0x2c, 0x1c, 0x43, 0x31, 0x56, 0x2a, 0x4f, - 0x5c, 0xb1, 0xfc, 0x28, 0xbd, 0x19, 0x71, 0xff, 0xb8, 0x97, 0x72, 0x04, 0xf7, 0xdc, 0x82, 0x5a, - 0x2c, 0x59, 0x36, 0x31, 0x51, 0xb6, 0xa8, 0x38, 0x09, 0x92, 0xdb, 0xf0, 0x30, 0x35, 0x40, 0xd4, - 0x97, 0x9f, 0x11, 0x6c, 0x36, 0x98, 0xf1, 0x19, 0xe9, 0x12, 0x03, 0x73, 0x72, 0x4a, 0xb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fe, 0x1e, 0xcb, 0xe8, 0xa7, - 0x4b, 0x39, 0xf7, 0xe6, 0x52, 0xce, 0xbd, 0xbd, 0x94, 0x73, 0xdf, 0x56, 0x0c, 0x93, 0x9f, 0xf5, - 0x5b, 0x6a, 0x9b, 0xf6, 0x34, 0x37, 0xf8, 0xbe, 0x45, 0xf8, 0x4b, 0xea, 0x9c, 0x6b, 0x0b, 0xee, - 0x5f, 0xde, 0x2d, 0xb4, 0x95, 0xf7, 0x2e, 0x91, 0x4f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1d, - 0x19, 0xb2, 0x0c, 0x5c, 0x0b, 0x00, 0x00, + // 904 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0xd6, 0xc5, 0x8e, 0x62, 0x3d, 0x25, 0x4e, 0x42, 0x3b, 0x0d, 0xcd, 0x26, 0xb4, 0x42, 0xb4, + 0x85, 0xe3, 0xda, 0x24, 0xac, 0x18, 0x06, 0xe2, 0xc5, 0xb0, 0xdc, 0x1f, 0xe9, 0xa0, 0xa2, 0xa0, + 0x9d, 0xa5, 0x8b, 0x71, 0x12, 0x2f, 0x34, 0x61, 0x89, 0x47, 0xf0, 0x4e, 0x4a, 0x34, 0xb5, 0xe8, + 0xd8, 0xa9, 0x7f, 0x45, 0x51, 0x74, 0xd2, 0xd0, 0xa5, 0x7f, 0x40, 0x81, 0x6c, 0x0d, 0x3a, 0x65, + 0x32, 0x0a, 0x79, 0x10, 0xe0, 0xbf, 0xa2, 0xe0, 0x4f, 0x51, 0x14, 0x55, 0xd1, 0x85, 0x86, 0x2e, + 0x36, 0x79, 0xef, 0x7b, 0xdf, 0xfb, 0xde, 0x77, 0xd4, 0xbd, 0x83, 0xc7, 0x0e, 0x3d, 0xe7, 0x2e, + 0x6d, 0xb5, 0x34, 0xec, 0x38, 0x2d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0xfd, 0x4d, 0xa4, 0x87, + 0x69, 0xfb, 0xcf, 0x7f, 0x18, 0xf6, 0x37, 0x47, 0x84, 0x3f, 0x0e, 0xfb, 0x9b, 0x9f, 0xc4, 0xf2, + 0xdf, 0x8c, 0xf5, 0x98, 0xd2, 0xac, 0xac, 0xc1, 0xc3, 0xd4, 0x92, 0x4e, 0x98, 0x43, 0x6d, 0x46, + 0x94, 0x3f, 0x11, 0xac, 0xd4, 0x99, 0x79, 0xcc, 0xf1, 0x39, 0x39, 0x1c, 0x51, 0x08, 0x55, 0xb8, + 0x85, 0x83, 0x56, 0x66, 0x36, 0x19, 0x01, 0x05, 0x0d, 0x6e, 0x32, 0x8f, 0x27, 0xec, 0x70, 0x4d, + 0x0d, 0xe1, 0xde, 0x8e, 0xab, 0xe1, 0x8e, 0xab, 0x47, 0xd4, 0xb2, 0xf5, 0x00, 0x27, 0x7c, 0x0e, + 0x4b, 0xa1, 0xe1, 0x4c, 0x5c, 0xa8, 0x2c, 0x6c, 0x94, 0xab, 0x4f, 0x47, 0xae, 0x04, 0x3b, 0xa2, + 0x26, 0x44, 0x1d, 0x07, 0xd8, 0x23, 0x6a, 0xbf, 0xb2, 0x4c, 0x3d, 0x4e, 0xdd, 0xbf, 0xed, 0x39, + 0x13, 0xa9, 0x50, 0x1a, 0xf0, 0x61, 0x46, 0x43, 0x51, 0xc3, 0xc2, 0x11, 0x94, 0x13, 0x56, 0xf9, + 0xcd, 0x95, 0xab, 0x4f, 0xb2, 0x37, 0x23, 0x99, 0x9f, 0xcc, 0x52, 0x0e, 0xe0, 0x81, 0x67, 0xa8, + 0xcd, 0xd2, 0xb6, 0x89, 0x29, 0xdb, 0x62, 0x73, 0x52, 0x22, 0x0d, 0x78, 0x9c, 0x49, 0x30, 0x5f, + 0x99, 0x3f, 0x23, 0x58, 0xad, 0x33, 0xf3, 0x33, 0xd2, 0x22, 0x26, 0xe6, 0xe4, 0x84, 0x7e, 0x89, + 0x39, 0x79, 0x8d, 0x7b,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+ 0x9f, 0x2e, 0xe5, 0xc2, 0xbb, 0x4b, 0xb9, 0xf0, 0xfe, 0x52, 0x2e, 0x7c, 0xbb, 0x6b, 0x5a, 0xfc, + 0xac, 0xd3, 0x50, 0x9b, 0xb4, 0xad, 0x79, 0xe4, 0xdb, 0x36, 0xe1, 0xaf, 0xa9, 0x7b, 0xae, 0x4d, + 0xb9, 0x09, 0xfa, 0xf7, 0xe1, 0x46, 0xd1, 0xbf, 0xce, 0x3e, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, + 0xe7, 0x83, 0x9b, 0xb4, 0xe6, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1266,6 +1282,18 @@ func (m *MsgUnstakeApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = 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 } @@ -1398,6 +1426,18 @@ func (m *MsgUndelegateFromGatewayResponse) MarshalToSizedBuffer(dAtA []byte) (in _ = 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 } @@ -1677,6 +1717,10 @@ func (m *MsgUnstakeApplicationResponse) Size() (n int) { } var l int _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1733,6 +1777,10 @@ func (m *MsgUndelegateFromGatewayResponse) Size() (n int) { } var l int _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2340,6 +2388,42 @@ func (m *MsgUnstakeApplicationResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUnstakeApplicationResponse: 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:]) @@ -2704,6 +2788,42 @@ func (m *MsgUndelegateFromGatewayResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUndelegateFromGatewayResponse: 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:]) From 29aec8a675f92c0806b83f5539a14c38b592ee72 Mon Sep 17 00:00:00 2001 From: ZhengXingRu Date: Tue, 10 Dec 2024 02:39:22 +0800 Subject: [PATCH 6/6] chore: fix some function names in comment (#989) Match comments with function names --- Signed-off-by: standstaff Co-authored-by: Daniel Olshansky --- x/application/types/message_update_param.go | 2 +- x/service/types/relay.go | 2 +- x/tokenomics/keeper/keeper_settle_pending_claims_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x/application/types/message_update_param.go b/x/application/types/message_update_param.go index 251ab6a4b..33971c17e 100644 --- a/x/application/types/message_update_param.go +++ b/x/application/types/message_update_param.go @@ -57,7 +57,7 @@ func (msg *MsgUpdateParam) ValidateBasic() error { } } -// genericTypeIsCoin checks if the parameter type is T, returning an error if not. +// genericParamTypeIs checks if the parameter type is T, returning an error if not. func genericParamTypeIs[T any](msg *MsgUpdateParam) error { if _, ok := msg.AsType.(T); !ok { return ErrAppParamInvalid.Wrapf( diff --git a/x/service/types/relay.go b/x/service/types/relay.go index 2824538de..57264aafc 100644 --- a/x/service/types/relay.go +++ b/x/service/types/relay.go @@ -118,7 +118,7 @@ func (res *RelayResponse) VerifySupplierOperatorSignature(supplierOperatorPubKey return nil } -// nullifyForObservability generates an empty RelayRequest that has the same +// NullifyForObservability generates an empty RelayRequest that has the same // service and payload as the source RelayRequest if they are not nil. // It is meant to be used when replying with an error but no valid RelayRequest is available. func (sourceRelayRequest *RelayRequest) NullifyForObservability() *RelayRequest { diff --git a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index f40d66890..076663cce 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -204,7 +204,7 @@ func (s *TestSuite) SetupTest() { s.proof = *testtree.NewProof(t, supplierOwnerAddr, sessionHeader, sessionTree, expectedMerkleProofPath) } -// TestSettleExpiringClaimsSuite tests the claim settlement process. +// TestSettlePendingClaims tests the claim settlement process. // NB: Each test scenario (method) is run in isolation and #TestSetup() is called // for each prior to running. func TestSettlePendingClaims(t *testing.T) {