diff --git a/api/poktroll/application/query.pulsar.go b/api/poktroll/application/query.pulsar.go index 85eae4e9f..e2d02e859 100644 --- a/api/poktroll/application/query.pulsar.go +++ b/api/poktroll/application/query.pulsar.go @@ -1664,16 +1664,16 @@ func (x *fastReflection_QueryGetApplicationResponse) ProtoMethods() *protoiface. } var ( - md_QueryAllApplicationsRequest protoreflect.MessageDescriptor - fd_QueryAllApplicationsRequest_pagination protoreflect.FieldDescriptor - fd_QueryAllApplicationsRequest_delegatee_gateway_address protoreflect.FieldDescriptor + md_QueryAllApplicationsRequest protoreflect.MessageDescriptor + fd_QueryAllApplicationsRequest_pagination protoreflect.FieldDescriptor + fd_QueryAllApplicationsRequest_gateway_address_delegated_to protoreflect.FieldDescriptor ) func init() { file_poktroll_application_query_proto_init() md_QueryAllApplicationsRequest = File_poktroll_application_query_proto.Messages().ByName("QueryAllApplicationsRequest") fd_QueryAllApplicationsRequest_pagination = md_QueryAllApplicationsRequest.Fields().ByName("pagination") - fd_QueryAllApplicationsRequest_delegatee_gateway_address = md_QueryAllApplicationsRequest.Fields().ByName("delegatee_gateway_address") + fd_QueryAllApplicationsRequest_gateway_address_delegated_to = md_QueryAllApplicationsRequest.Fields().ByName("gateway_address_delegated_to") } var _ protoreflect.Message = (*fastReflection_QueryAllApplicationsRequest)(nil) @@ -1747,9 +1747,9 @@ func (x *fastReflection_QueryAllApplicationsRequest) Range(f func(protoreflect.F return } } - if x.DelegateeGatewayAddress != "" { - value := protoreflect.ValueOfString(x.DelegateeGatewayAddress) - if !f(fd_QueryAllApplicationsRequest_delegatee_gateway_address, value) { + if x.GatewayAddressDelegatedTo != "" { + value := protoreflect.ValueOfString(x.GatewayAddressDelegatedTo) + if !f(fd_QueryAllApplicationsRequest_gateway_address_delegated_to, value) { return } } @@ -1770,8 +1770,8 @@ func (x *fastReflection_QueryAllApplicationsRequest) Has(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.application.QueryAllApplicationsRequest.pagination": return x.Pagination != nil - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": - return x.DelegateeGatewayAddress != "" + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": + return x.GatewayAddressDelegatedTo != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.QueryAllApplicationsRequest")) @@ -1790,8 +1790,8 @@ func (x *fastReflection_QueryAllApplicationsRequest) Clear(fd protoreflect.Field switch fd.FullName() { case "poktroll.application.QueryAllApplicationsRequest.pagination": x.Pagination = nil - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": - x.DelegateeGatewayAddress = "" + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": + x.GatewayAddressDelegatedTo = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.QueryAllApplicationsRequest")) @@ -1811,8 +1811,8 @@ func (x *fastReflection_QueryAllApplicationsRequest) Get(descriptor protoreflect case "poktroll.application.QueryAllApplicationsRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": - value := x.DelegateeGatewayAddress + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": + value := x.GatewayAddressDelegatedTo return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -1836,8 +1836,8 @@ func (x *fastReflection_QueryAllApplicationsRequest) Set(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.application.QueryAllApplicationsRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": - x.DelegateeGatewayAddress = value.Interface().(string) + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": + x.GatewayAddressDelegatedTo = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.QueryAllApplicationsRequest")) @@ -1863,8 +1863,8 @@ func (x *fastReflection_QueryAllApplicationsRequest) Mutable(fd protoreflect.Fie x.Pagination = new(v1beta1.PageRequest) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": - panic(fmt.Errorf("field delegatee_gateway_address of message poktroll.application.QueryAllApplicationsRequest is not mutable")) + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": + panic(fmt.Errorf("field gateway_address_delegated_to of message poktroll.application.QueryAllApplicationsRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.QueryAllApplicationsRequest")) @@ -1881,7 +1881,7 @@ func (x *fastReflection_QueryAllApplicationsRequest) NewField(fd protoreflect.Fi case "poktroll.application.QueryAllApplicationsRequest.pagination": m := new(v1beta1.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.application.QueryAllApplicationsRequest.delegatee_gateway_address": + case "poktroll.application.QueryAllApplicationsRequest.gateway_address_delegated_to": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1956,7 +1956,7 @@ func (x *fastReflection_QueryAllApplicationsRequest) ProtoMethods() *protoiface. l = options.Size(x.Pagination) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.DelegateeGatewayAddress) + l = len(x.GatewayAddressDelegatedTo) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1989,10 +1989,10 @@ func (x *fastReflection_QueryAllApplicationsRequest) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.DelegateeGatewayAddress) > 0 { - i -= len(x.DelegateeGatewayAddress) - copy(dAtA[i:], x.DelegateeGatewayAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegateeGatewayAddress))) + if len(x.GatewayAddressDelegatedTo) > 0 { + i -= len(x.GatewayAddressDelegatedTo) + copy(dAtA[i:], x.GatewayAddressDelegatedTo) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GatewayAddressDelegatedTo))) i-- dAtA[i] = 0x12 } @@ -2097,7 +2097,7 @@ func (x *fastReflection_QueryAllApplicationsRequest) ProtoMethods() *protoiface. iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegateeGatewayAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GatewayAddressDelegatedTo", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2125,7 +2125,7 @@ func (x *fastReflection_QueryAllApplicationsRequest) ProtoMethods() *protoiface. if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.DelegateeGatewayAddress = string(dAtA[iNdEx:postIndex]) + x.GatewayAddressDelegatedTo = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2888,9 +2888,8 @@ type QueryAllApplicationsRequest struct { unknownFields protoimpl.UnknownFields 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"` + GatewayAddressDelegatedTo string `protobuf:"bytes,2,opt,name=gateway_address_delegated_to,json=gatewayAddressDelegatedTo,proto3" json:"gateway_address_delegated_to,omitempty"` } func (x *QueryAllApplicationsRequest) Reset() { @@ -2920,9 +2919,9 @@ func (x *QueryAllApplicationsRequest) GetPagination() *v1beta1.PageRequest { return nil } -func (x *QueryAllApplicationsRequest) GetDelegateeGatewayAddress() string { +func (x *QueryAllApplicationsRequest) GetGatewayAddressDelegatedTo() string { if x != nil { - return x.DelegateeGatewayAddress + return x.GatewayAddressDelegatedTo } return "" } @@ -3007,73 +3006,74 @@ var file_poktroll_application_query_proto_rawDesc = []byte{ 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, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xa1, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, + 0x22, 0xa6, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x65, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, - 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x84, 0x04, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x90, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, - 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xb4, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, - 0xb0, 0x01, 0x0a, 0x0f, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x1c, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x32, 0x84, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x90, 0x01, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0xc2, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xb4, 0x01, + 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb0, 0x01, 0x0a, 0x0f, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xc2, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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 ( diff --git a/api/poktroll/shared/service.pulsar.go b/api/poktroll/shared/service.pulsar.go index a923eda0b..51dabf2fa 100644 --- a/api/poktroll/shared/service.pulsar.go +++ b/api/poktroll/shared/service.pulsar.go @@ -2416,8 +2416,13 @@ func (x *fastReflection_ServiceRevenueShare) Range(f func(protoreflect.FieldDesc return } } +<<<<<<< HEAD + if x.RevSharePercentage != uint32(0) { + value := protoreflect.ValueOfUint32(x.RevSharePercentage) +======= if x.RevSharePercentage != uint64(0) { value := protoreflect.ValueOfUint64(x.RevSharePercentage) +>>>>>>> main if !f(fd_ServiceRevenueShare_rev_share_percentage, value) { return } @@ -2440,7 +2445,11 @@ func (x *fastReflection_ServiceRevenueShare) Has(fd protoreflect.FieldDescriptor case "poktroll.shared.ServiceRevenueShare.address": return x.Address != "" case "poktroll.shared.ServiceRevenueShare.rev_share_percentage": +<<<<<<< HEAD + return x.RevSharePercentage != uint32(0) +======= return x.RevSharePercentage != uint64(0) +>>>>>>> main default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ServiceRevenueShare")) @@ -2460,7 +2469,11 @@ func (x *fastReflection_ServiceRevenueShare) Clear(fd protoreflect.FieldDescript case "poktroll.shared.ServiceRevenueShare.address": x.Address = "" case "poktroll.shared.ServiceRevenueShare.rev_share_percentage": +<<<<<<< HEAD + x.RevSharePercentage = uint32(0) +======= x.RevSharePercentage = uint64(0) +>>>>>>> main default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ServiceRevenueShare")) @@ -2482,7 +2495,11 @@ func (x *fastReflection_ServiceRevenueShare) Get(descriptor protoreflect.FieldDe return protoreflect.ValueOfString(value) case "poktroll.shared.ServiceRevenueShare.rev_share_percentage": value := x.RevSharePercentage +<<<<<<< HEAD + return protoreflect.ValueOfUint32(value) +======= return protoreflect.ValueOfUint64(value) +>>>>>>> main default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ServiceRevenueShare")) @@ -2506,7 +2523,11 @@ func (x *fastReflection_ServiceRevenueShare) Set(fd protoreflect.FieldDescriptor case "poktroll.shared.ServiceRevenueShare.address": x.Address = value.Interface().(string) case "poktroll.shared.ServiceRevenueShare.rev_share_percentage": +<<<<<<< HEAD + x.RevSharePercentage = uint32(value.Uint()) +======= x.RevSharePercentage = value.Uint() +>>>>>>> main default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ServiceRevenueShare")) @@ -2547,7 +2568,11 @@ func (x *fastReflection_ServiceRevenueShare) NewField(fd protoreflect.FieldDescr case "poktroll.shared.ServiceRevenueShare.address": return protoreflect.ValueOfString("") case "poktroll.shared.ServiceRevenueShare.rev_share_percentage": +<<<<<<< HEAD + return protoreflect.ValueOfUint32(uint32(0)) +======= return protoreflect.ValueOfUint64(uint64(0)) +>>>>>>> main default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ServiceRevenueShare")) @@ -2760,7 +2785,11 @@ func (x *fastReflection_ServiceRevenueShare) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ +<<<<<<< HEAD + x.RevSharePercentage |= uint32(b&0x7F) << shift +======= x.RevSharePercentage |= uint64(b&0x7F) << shift +>>>>>>> main if b < 0x80 { break } @@ -3604,7 +3633,11 @@ type ServiceRevenueShare struct { unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the revenue share recipient +<<<<<<< HEAD + RevSharePercentage uint32 `protobuf:"varint,3,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` // The percentage of revenue share the recipient will receive +======= RevSharePercentage uint64 `protobuf:"varint,3,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` // The percentage of revenue share the recipient will receive +>>>>>>> main } func (x *ServiceRevenueShare) Reset() { @@ -3634,7 +3667,11 @@ func (x *ServiceRevenueShare) GetAddress() string { return "" } +<<<<<<< HEAD +func (x *ServiceRevenueShare) GetRevSharePercentage() uint32 { +======= func (x *ServiceRevenueShare) GetRevSharePercentage() uint64 { +>>>>>>> main if x != nil { return x.RevSharePercentage } @@ -3735,7 +3772,11 @@ var file_poktroll_shared_service_proto_rawDesc = []byte{ 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x72, 0x65, 0x76, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x70, 0x65, +<<<<<<< HEAD + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, +======= 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, +>>>>>>> main 0x72, 0x65, 0x76, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x56, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, diff --git a/go.mod b/go.mod index 162807307..f03fc9853 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/pokt-network/poktroll go 1.23.0 -// replace ( +replace ( // DEVELOPER_TIP: Uncomment to use a local copy of shannon-sdk for development purposes. // github.com/pokt-network/shannon-sdk => ../shannon-sdk @@ -10,7 +10,7 @@ go 1.23.0 // github.com/pokt-network/smt => ../smt // github.com/pokt-network/smt/kvstore/badger => ../smt/kvstore/badger // github.com/pokt-network/smt/kvstore/pebble => ../smt/kvstore/pebble -// ) +) // replace broken goleveldb replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/proto/poktroll/application/query.proto b/proto/poktroll/application/query.proto index 22f7b746a..68fa84a0d 100644 --- a/proto/poktroll/application/query.proto +++ b/proto/poktroll/application/query.proto @@ -53,9 +53,10 @@ message QueryGetApplicationResponse { message QueryAllApplicationsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; - // 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. - string delegatee_gateway_address = 2; + + oneof filter { + string gateway_address_delegated_to = 2; // filters applications that delegate to the specified gateway address + } } message QueryAllApplicationsResponse { diff --git a/x/application/keeper/application_test.go b/x/application/keeper/application_test.go index 157c68db4..10fa503fc 100644 --- a/x/application/keeper/application_test.go +++ b/x/application/keeper/application_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "context" - "slices" "strconv" "testing" @@ -12,6 +11,7 @@ import ( "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/x/application/keeper" "github.com/pokt-network/poktroll/x/application/types" ) @@ -25,7 +25,7 @@ type testAppModifier func(app *types.Application) func createNApplications(keeper keeper.Keeper, ctx context.Context, n int, testAppModifiers ...testAppModifier) []types.Application { apps := make([]types.Application, n) for i := range apps { - apps[i].Address = strconv.Itoa(i) + apps[i].Address = sample.AccAddress() // Setting pending undelegations since nullify.Fill() does not seem to do it. apps[i].PendingUndelegations = make(map[uint64]types.UndelegatingGatewayList) @@ -38,13 +38,11 @@ func createNApplications(keeper keeper.Keeper, ctx context.Context, n int, testA return apps } -// testAppModifierDelegateeAddr adds the supplied gateway address to the application's delegatee list if the application's address matches -// the supplied address list. -func withAppDelegateeGatewayAddr(delegateeGatewayAddr string, appsWithDelegationAddr []string) testAppModifier { +// withGatewayAddressDelegatedTo updates the list of gateways the application delegates +// to by adding the given gateway address. +func withGatewayAddressDelegatedTo(gatewayDelegatedToAddr string) testAppModifier { return func(app *types.Application) { - if slices.Contains(appsWithDelegationAddr, app.Address) { - app.DelegateeGatewayAddresses = append(app.DelegateeGatewayAddresses, delegateeGatewayAddr) - } + app.DelegateeGatewayAddresses = append(app.DelegateeGatewayAddresses, gatewayDelegatedToAddr) } } diff --git a/x/application/keeper/query_application.go b/x/application/keeper/query_application.go index 5d39b21ca..248139d11 100644 --- a/x/application/keeper/query_application.go +++ b/x/application/keeper/query_application.go @@ -14,7 +14,11 @@ import ( "github.com/pokt-network/poktroll/x/application/types" ) -func (k Keeper) AllApplications(ctx context.Context, req *types.QueryAllApplicationsRequest) (*types.QueryAllApplicationsResponse, error) { +// AllApplications returns all applications filtered based on any criteria specified in the request. +func (k Keeper) AllApplications( + ctx context.Context, + req *types.QueryAllApplicationsRequest, +) (*types.QueryAllApplicationsResponse, error) { logger := k.Logger().With("method", "AllApplications") if req == nil { @@ -27,6 +31,12 @@ func (k Keeper) AllApplications(ctx context.Context, req *types.QueryAllApplicat var apps []types.Application + // TODO_IMPROVE(#767): Consider adding a custom onchain index (similar to proofs) + // if/when the performance of the flags used to filter the response becomes an issue. + // Specifically, the following onchain indecies can be added: + // - app_addr -> [gateways delegated to] + // - gateway_addr -> [apps that delegate to it] + // - service_id -> [apps that have a service with that id] store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) applicationStore := prefix.NewStore(store, types.KeyPrefix(types.ApplicationKeyPrefix)) @@ -37,10 +47,12 @@ func (k Keeper) AllApplications(ctx context.Context, req *types.QueryAllApplicat return status.Error(codes.Internal, err.Error()) } - // Filter out the application if the request specifies a delegatee gateway address as a contraint and the application - // does not delegate to the specifies gateway address. - if req.DelegateeGatewayAddress != "" && !slices.Contains(application.DelegateeGatewayAddresses, req.DelegateeGatewayAddress) { - return nil + // Filter out the application if the request specifies a gateway address delegated to as a constraint + gatewayDelegatedToAddrFilter := req.GetGatewayAddressDelegatedTo() + if gatewayDelegatedToAddrFilter != "" { + if !slices.Contains(application.DelegateeGatewayAddresses, req.GatewayAddressDelegatedTo) { + return nil + } } // Ensure that the PendingUndelegations is an empty map and not nil when diff --git a/x/application/keeper/query_application_test.go b/x/application/keeper/query_application_test.go index 79464a0d9..1c8b0b53f 100644 --- a/x/application/keeper/query_application_test.go +++ b/x/application/keeper/query_application_test.go @@ -125,25 +125,32 @@ func TestApplicationQueryPaginated(t *testing.T) { }) } -func TestAllApplicationsQuery_WithDelegateeGatewayAddressConstraint(t *testing.T) { +func TestAllApplicationsQuery_WithGatewayAddressDelegatedTo(t *testing.T) { keeper, ctx := keepertest.ApplicationKeeper(t) - gatewayAddr1 := sample.AccAddress() - appsWithDelegationAddr := []string{"1", "2"} - apps := createNApplications(keeper, ctx, 5, withAppDelegateeGatewayAddr(gatewayAddr1, appsWithDelegationAddr)) + gatewayAddr := sample.AccAddress() + + appsWithDelegation := createNApplications(keeper, ctx, 2, withGatewayAddressDelegatedTo(gatewayAddr)) + appsWithDelegationAddrs := make([]string, len(appsWithDelegation)) + for i, app := range appsWithDelegation { + appsWithDelegationAddrs[i] = app.Address + } + + appsWithoutDelegation := createNApplications(keeper, ctx, 3) + apps := append(appsWithDelegation, appsWithoutDelegation...) requestBuilder := func(gatewayAddr string) *types.QueryAllApplicationsRequest { return &types.QueryAllApplicationsRequest{ - DelegateeGatewayAddress: gatewayAddr, + GatewayAddressDelegatedTo: gatewayAddr, } } - t.Run("QueryAppsWithDelegatee", func(t *testing.T) { - resp, err := keeper.AllApplications(ctx, requestBuilder(gatewayAddr1)) + t.Run("QueryAppsWithGatewayAddressDelegatedTo", func(t *testing.T) { + resp, err := keeper.AllApplications(ctx, requestBuilder(gatewayAddr)) require.NoError(t, err) var expectedApps []types.Application for _, app := range apps { - if slices.Contains(appsWithDelegationAddr, app.Address) { + if slices.Contains(appsWithDelegationAddrs, app.Address) { expectedApps = append(expectedApps, app) } } @@ -154,7 +161,7 @@ func TestAllApplicationsQuery_WithDelegateeGatewayAddressConstraint(t *testing.T ) }) - t.Run("QueryAppsWithNoDelegationConstraint", func(t *testing.T) { + t.Run("QueryAppsWithoutGatewayAddressDelegatedTo", func(t *testing.T) { resp, err := keeper.AllApplications(ctx, &types.QueryAllApplicationsRequest{}) require.NoError(t, err) diff --git a/x/application/module/autocli.go b/x/application/module/autocli.go index 0271f1ab5..00f9eb46b 100644 --- a/x/application/module/autocli.go +++ b/x/application/module/autocli.go @@ -10,36 +10,57 @@ import ( func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ Query: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Query_ServiceDesc.ServiceName, + Service: modulev1.Query_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // Enable custom command enhancement for backwards compatibility RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - // { - // RpcMethod: "Params", - // Use: "params", - // Short: "Shows the parameters of the module", - // Long: `Shows all the parameters related to the application module. - // - // Example: - // $ poktrolld q application params --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, - // }, - // { - // RpcMethod: "AllApplications", - // Use: "list-application", - // Short: "List all application", - // Long: `List all the applications that staked in the network. - // - // Example: - // $ poktrolld q application list-application --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, - // }, - // { - // RpcMethod: "Application", - // Use: "show-application [address]", - // Short: "Shows a application", - // Long: `Finds a staked application given its address. - // - // Example: - // $ poktrolld q application show-application $(APP_ADDRESS) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, - // PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, - // }, + { + Alias: []string{"apps", "ls"}, + RpcMethod: "AllApplications", + Use: "list-applications", + Short: "List all applications on Pocket Network", + Long: `Retrieves a paginated list of all applications currently registered on Pocket Network, including all their details. + +The command supports pagination parameters. +Returns application addresses, staked amounts, and current status.`, + + Example: ` + poktrolld query application list-applications + poktrolld query application list-applications --page 2 --limit 50 + poktrolld query application list-applications --page 1 --limit 100`, + }, + { + Alias: []string{"app", "a"}, + RpcMethod: "Application", + Use: "show-application [address]", + Short: "Shows detailed information about a specific application", + Long: `Retrieves comprehensive information about an application identified by its address. + +Returns details include: +- Application's staked amount and status +- Application metadata and configuration`, + + Example: ` + poktrolld query application show-application pokt1abc...xyz + poktrolld query application show-application pokt1abc...xyz --output json + poktrolld query application show-application pokt1abc...xyz --height 100`, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "address", + }, + }, + }, + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the application module", + Long: `Shows all the parameters related to the application module. + +Returns the current values of all application module parameters.`, + + Example: ` + poktrolld query application params + poktrolld query application params --output json`, + }, // this line is used by ignite scaffolding # autocli/query }, }, diff --git a/x/application/module/query.go b/x/application/module/query.go index 16d157750..5f7461eda 100644 --- a/x/application/module/query.go +++ b/x/application/module/query.go @@ -22,8 +22,6 @@ func (am AppModule) GetQueryCmd() *cobra.Command { } cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListApplication()) - cmd.AddCommand(CmdShowApplication()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/application/module/query_application.go b/x/application/module/query_application.go deleted file mode 100644 index b1a371c8e..000000000 --- a/x/application/module/query_application.go +++ /dev/null @@ -1,86 +0,0 @@ -package application - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/pokt-network/poktroll/x/application/types" -) - -func CmdListApplication() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-application", - Short: "list all application", - Long: `List all the applications that staked in the network. - -Example: -$ poktrolld q application list-application --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllApplicationsRequest{ - Pagination: pageReq, - } - - res, err := queryClient.AllApplications(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowApplication() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-application ", - Short: "shows a application", - Long: `Finds a staked application given its address. - -Example: -$ poktrolld q application show-application $(APP_ADDRESS) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argAddress := args[0] - - params := &types.QueryGetApplicationRequest{ - Address: argAddress, - } - - res, err := queryClient.Application(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/application/module/query_application_test.go b/x/application/module/query_application_test.go deleted file mode 100644 index 0a9c96efc..000000000 --- a/x/application/module/query_application_test.go +++ /dev/null @@ -1,139 +0,0 @@ -package application_test - -import ( - "fmt" - "strconv" - "testing" - - cometcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/pokt-network/poktroll/testutil/nullify" - application "github.com/pokt-network/poktroll/x/application/module" - "github.com/pokt-network/poktroll/x/application/types" -) - -func TestShowApplication(t *testing.T) { - net, apps := networkWithApplicationObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", cometcli.OutputFlag), - } - tests := []struct { - desc string - idAddress string - - args []string - expectedErr error - app types.Application - }{ - { - desc: "found", - idAddress: apps[0].Address, - - args: common, - app: apps[0], - }, - { - desc: "not found", - idAddress: strconv.Itoa(100000), - - args: common, - expectedErr: status.Error(codes.NotFound, "not found"), - }, - } - for _, test := range tests { - t.Run(test.desc, func(t *testing.T) { - args := []string{ - test.idAddress, - } - args = append(args, test.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, application.CmdShowApplication(), args) - if test.expectedErr != nil { - stat, ok := status.FromError(test.expectedErr) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), test.expectedErr) - } else { - require.NoError(t, err) - var resp types.QueryGetApplicationResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Application) - require.Equal(t, - nullify.Fill(&test.app), - nullify.Fill(&resp.Application), - ) - } - }) - } -} - -func TestListApplication(t *testing.T) { - net, apps := networkWithApplicationObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", cometcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(apps); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, application.CmdListApplication(), args) - require.NoError(t, err) - var resp types.QueryAllApplicationsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Applications), step) - require.Subset(t, - nullify.Fill(apps), - nullify.Fill(resp.Applications), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(apps); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, application.CmdListApplication(), args) - require.NoError(t, err) - var resp types.QueryAllApplicationsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Applications), step) - require.Subset(t, - nullify.Fill(apps), - nullify.Fill(resp.Applications), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(apps)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, application.CmdListApplication(), args) - require.NoError(t, err) - var resp types.QueryAllApplicationsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(apps), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(apps), - nullify.Fill(resp.Applications), - ) - }) -} diff --git a/x/application/types/query.pb.go b/x/application/types/query.pb.go index e0377020a..39d3266e5 100644 --- a/x/application/types/query.pb.go +++ b/x/application/types/query.pb.go @@ -189,9 +189,8 @@ func (m *QueryGetApplicationResponse) GetApplication() Application { type QueryAllApplicationsRequest struct { 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"` + GatewayAddressDelegatedTo string `protobuf:"bytes,2,opt,name=gateway_address_delegated_to,json=gatewayAddressDelegatedTo,proto3" json:"gateway_address_delegated_to,omitempty"` } func (m *QueryAllApplicationsRequest) Reset() { *m = QueryAllApplicationsRequest{} } @@ -230,9 +229,9 @@ func (m *QueryAllApplicationsRequest) GetPagination() *query.PageRequest { return nil } -func (m *QueryAllApplicationsRequest) GetDelegateeGatewayAddress() string { +func (m *QueryAllApplicationsRequest) GetGatewayAddressDelegatedTo() string { if m != nil { - return m.DelegateeGatewayAddress + return m.GatewayAddressDelegatedTo } return "" } @@ -297,43 +296,44 @@ func init() { func init() { proto.RegisterFile("poktroll/application/query.proto", fileDescriptor_5cf77e4e046ed3a7) } var fileDescriptor_5cf77e4e046ed3a7 = []byte{ - // 574 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x41, 0x6f, 0xd3, 0x3e, - 0x18, 0xc6, 0xeb, 0xfe, 0xf7, 0x2f, 0x9a, 0x8b, 0x84, 0x30, 0x95, 0x18, 0xa1, 0x0a, 0x5b, 0x0e, - 0xb0, 0x0d, 0x61, 0xaf, 0x05, 0x4d, 0x68, 0x17, 0x68, 0x0f, 0x54, 0x88, 0xcb, 0xc8, 0x81, 0x03, - 0x97, 0xc9, 0x6d, 0xad, 0x2c, 0x5a, 0x1a, 0x67, 0x89, 0xcb, 0xa8, 0x10, 0x17, 0xc4, 0x07, 0x98, - 0xc4, 0x27, 0xe0, 0xc6, 0x71, 0x87, 0x7d, 0x88, 0x1d, 0x27, 0x71, 0xd9, 0x09, 0xa1, 0x16, 0x89, - 0xaf, 0x81, 0x62, 0x3b, 0xcc, 0x65, 0xa6, 0xac, 0x97, 0xc8, 0x8d, 0x9f, 0xc7, 0xef, 0xef, 0x79, - 0xfd, 0x36, 0x70, 0x39, 0xe1, 0x7b, 0x22, 0xe5,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66, 0x9d, 0x5e, 0xa7, 0x31, 0x87, 0x43, 0x73, 0x3e, 0x95, 0x9c, 0x5b, 0xe8, 0xf1, - 0x25, 0x38, 0xcd, 0xf5, 0x3b, 0x3d, 0x28, 0xef, 0xd1, 0x11, 0x80, 0xd7, 0xfe, 0x98, 0x02, 0x34, - 0x0b, 0xc4, 0x3e, 0xd5, 0x4e, 0x73, 0x1e, 0x8b, 0x86, 0xdf, 0x94, 0xf0, 0x1b, 0x08, 0xcf, 0x07, - 0xdf, 0xf6, 0x4f, 0xc6, 0x2e, 0x38, 0x1d, 0xbb, 0xe0, 0x6c, 0xec, 0x82, 0xef, 0x63, 0x17, 0x1c, - 0x4e, 0xdc, 0xd2, 0xe9, 0xc4, 0x2d, 0x9d, 0x4d, 0xdc, 0xd2, 0xeb, 0x47, 0x41, 0x28, 0x76, 0x87, - 0x5d, 0xdc, 0xe3, 0x83, 0xbf, 0x9c, 0xfb, 0xf6, 0xe2, 0xb7, 0xac, 0x5b, 0x91, 0x1f, 0xb3, 0x87, - 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x43, 0x1f, 0xbc, 0xde, 0x05, 0x00, 0x00, + // 577 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0xeb, 0x32, 0x8a, 0xe6, 0x22, 0x21, 0x4c, 0x0f, 0x25, 0x54, 0x61, 0xcb, 0x01, 0xb6, + 0x21, 0xec, 0xb5, 0xa0, 0x09, 0x71, 0x19, 0xad, 0x10, 0x13, 0xe2, 0x32, 0x22, 0xc4, 0x81, 0x4b, + 0xe5, 0xb6, 0x56, 0x16, 0x2d, 0x8d, 0xb3, 0xc4, 0x65, 0x54, 0x88, 0x0b, 0xe2, 0x01, 0x26, 0xf1, + 0x0e, 0x88, 0xe3, 0x0e, 0x7b, 0x88, 0x1d, 0x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e, 0x42, 0xa9, 0xaa, 0x3a, 0xcd, 0xcf, 0x3f, 0x7e, 0x7f, 0x2d, 0x3f, 0x40, 0xab, + 0x24, 0xb5, 0x3c, 0x0c, 0x99, 0xd8, 0xe7, 0xf1, 0x2e, 0x99, 0xf3, 0xd2, 0xa0, 0x23, 0x00, 0xab, + 0x46, 0x27, 0xd0, 0xfa, 0x9c, 0x6a, 0xb9, 0x23, 0x6c, 0x35, 0x0b, 0x38, 0x34, 0xe7, 0x33, 0xc9, + 0xf9, 0x14, 0x3d, 0xb9, 0x04, 0xa7, 0xb9, 0xfe, 0xa8, 0xe7, 0xe6, 0x13, 0x3a, 0x04, 0xf0, 0xc6, + 0x3f, 0x53, 0x80, 0xe6, 0x81, 0xe4, 0x8f, 0xb6, 0xd5, 0x2a, 0x62, 0xd1, 0xf0, 0x1b, 0x12, 0x7e, + 0x1d, 0xe1, 0x62, 0xf0, 0x1d, 0xf7, 0x78, 0x62, 0x83, 0x93, 0x89, 0x0d, 0x4e, 0x27, 0x36, 0xf8, + 0x35, 0xb1, 0xc1, 0xc1, 0xd4, 0x2e, 0x9d, 0x4c, 0xed, 0xd2, 0xe9, 0xd4, 0x2e, 0xbd, 0x7b, 0xec, + 0xf9, 0x62, 0x67, 0xd4, 0xc3, 0x7d, 0x3e, 0xfc, 0xcf, 0xb9, 0x1f, 0xce, 0x7f, 0xd0, 0x7a, 0x15, + 0xf9, 0x45, 0x7b, 0xf4, 0x37, 0x00, 0x00, 0xff, 0xff, 0x60, 0x09, 0xa8, 0x31, 0xe3, 0x05, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -631,10 +631,10 @@ func (m *QueryAllApplicationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if len(m.DelegateeGatewayAddress) > 0 { - i -= len(m.DelegateeGatewayAddress) - copy(dAtA[i:], m.DelegateeGatewayAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegateeGatewayAddress))) + if len(m.GatewayAddressDelegatedTo) > 0 { + i -= len(m.GatewayAddressDelegatedTo) + copy(dAtA[i:], m.GatewayAddressDelegatedTo) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GatewayAddressDelegatedTo))) i-- dAtA[i] = 0x12 } @@ -767,7 +767,7 @@ func (m *QueryAllApplicationsRequest) Size() (n int) { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) } - l = len(m.DelegateeGatewayAddress) + l = len(m.GatewayAddressDelegatedTo) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1164,7 +1164,7 @@ func (m *QueryAllApplicationsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateeGatewayAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GatewayAddressDelegatedTo", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1192,7 +1192,7 @@ func (m *QueryAllApplicationsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegateeGatewayAddress = string(dAtA[iNdEx:postIndex]) + m.GatewayAddressDelegatedTo = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/application/types/query_validation.go b/x/application/types/query_validation.go index 7df32b36e..007b3132f 100644 --- a/x/application/types/query_validation.go +++ b/x/application/types/query_validation.go @@ -6,14 +6,14 @@ import ( // ValidateBasic performs basic (non-state-dependant) validation on a QueryAllApplicationsRequest. func (query *QueryAllApplicationsRequest) ValidateBasic() error { - delegateeGatewayAddr := query.GetDelegateeGatewayAddress() - if delegateeGatewayAddr == "" { + gatewayDelegatedToAddr := query.GetGatewayAddressDelegatedTo() + if gatewayDelegatedToAddr == "" { return nil } // Validate the delegation gateway address if the request specifies it as a constraint. - if _, err := sdk.AccAddressFromBech32(delegateeGatewayAddr); err != nil { - return ErrQueryAppsInvalidGatewayAddress.Wrapf("%q; (%v)", delegateeGatewayAddr, err) + if _, err := sdk.AccAddressFromBech32(gatewayDelegatedToAddr); err != nil { + return ErrQueryAppsInvalidGatewayAddress.Wrapf("%q; (%v)", gatewayDelegatedToAddr, err) } return nil diff --git a/x/shared/types/service.pb.go b/x/shared/types/service.pb.go index 6da21cd5f..d2b362ace 100644 --- a/x/shared/types/service.pb.go +++ b/x/shared/types/service.pb.go @@ -321,7 +321,11 @@ func (m *SupplierEndpoint) GetConfigs() []*ConfigOption { // ServiceRevenueShare message to hold revenue share configuration details type ServiceRevenueShare struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +<<<<<<< HEAD + RevSharePercentage uint32 `protobuf:"varint,3,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` +======= RevSharePercentage uint64 `protobuf:"varint,3,opt,name=rev_share_percentage,json=revSharePercentage,proto3" json:"rev_share_percentage,omitempty"` +>>>>>>> main } func (m *ServiceRevenueShare) Reset() { *m = ServiceRevenueShare{} } @@ -360,7 +364,11 @@ func (m *ServiceRevenueShare) GetAddress() string { return "" } +<<<<<<< HEAD +func (m *ServiceRevenueShare) GetRevSharePercentage() uint32 { +======= func (m *ServiceRevenueShare) GetRevSharePercentage() uint64 { +>>>>>>> main if m != nil { return m.RevSharePercentage } @@ -430,6 +438,49 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/service.proto", fileDescriptor_302c2f793a11ae1e) } var fileDescriptor_302c2f793a11ae1e = []byte{ +<<<<<<< HEAD + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xce, 0xc6, 0xf9, 0xfd, 0x92, 0x4c, 0x9b, 0xd4, 0x1a, 0x82, 0x30, 0x95, 0x6a, 0x95, 0x88, + 0x43, 0x55, 0xa9, 0x49, 0x95, 0x0a, 0x21, 0x0e, 0x08, 0xb5, 0x51, 0xa8, 0xda, 0xaa, 0x49, 0xb4, + 0x4e, 0xa9, 0xc4, 0xc5, 0x72, 0xed, 0x25, 0xb5, 0xea, 0x78, 0xad, 0xb5, 0x9d, 0x92, 0x23, 0x6f, + 0x80, 0x78, 0x05, 0x5e, 0x81, 0x13, 0x4f, 0xc0, 0xb1, 0xe2, 0xd4, 0x23, 0x4a, 0x5f, 0x04, 0xad, + 0xff, 0x04, 0x68, 0x11, 0x88, 0xdb, 0x78, 0xbe, 0x6f, 0x66, 0xbe, 0xfd, 0x76, 0xbc, 0xb0, 0x16, + 0xf0, 0x8b, 0x48, 0x70, 0xcf, 0x6b, 0x87, 0xe7, 0x96, 0x60, 0x4e, 0x3b, 0x64, 0x62, 0xea, 0xda, + 0xac, 0x15, 0x08, 0x1e, 0x71, 0x5c, 0xc9, 0xe1, 0x56, 0x0a, 0xaf, 0x3e, 0xb4, 0x79, 0x38, 0xe1, + 0xa1, 0x99, 0xc0, 0xed, 0xf4, 0x23, 0xe5, 0xae, 0x36, 0xc6, 0x7c, 0xcc, 0xd3, 0xbc, 0x8c, 0xd2, + 0x6c, 0xf3, 0x23, 0x81, 0xb2, 0x91, 0xf6, 0xc4, 0x3a, 0x14, 0x5d, 0x47, 0x23, 0xeb, 0x64, 0xa3, + 0x4a, 0x8b, 0xae, 0x83, 0x08, 0x25, 0xdf, 0x9a, 0x30, 0xad, 0x98, 0x64, 0x92, 0x18, 0x9f, 0xc0, + 0x03, 0x9b, 0x4f, 0x82, 0x38, 0x62, 0x66, 0xec, 0xbb, 0x51, 0x68, 0x06, 0x4c, 0x98, 0x82, 0x79, + 0xd6, 0x4c, 0x53, 0xd6, 0xc9, 0x46, 0x89, 0x36, 0x32, 0xf8, 0x44, 0xa2, 0x43, 0x26, 0xa8, 0xc4, + 0xf0, 0x39, 0xd4, 0xf8, 0xa5, 0xcf, 0x84, 0x69, 0x39, 0x8e, 0x60, 0x61, 0xa8, 0x95, 0x64, 0xcf, + 0x3d, 0xed, 0xeb,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, 0xe1, 0x96, 0xcf, 0xa2, 0x4b, 0x2e, 0x2e, 0xda, 0x8b, 0x47, 0xe2, 0x6d, 0xfe, 0x4c, 0xc8, + 0x55, 0x08, 0xcf, 0xfe, 0x4f, 0xfe, 0xf1, 0x9d, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x27, + 0x73, 0xed, 0x46, 0x04, 0x00, 0x00, +======= // 628 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, 0x10, 0xce, 0xc6, 0xf9, 0xfd, 0x92, 0x4c, 0xdb, 0xd4, 0x1a, 0x82, 0x30, 0x95, 0x6a, 0x95, 0x88, @@ -471,6 +522,7 @@ var fileDescriptor_302c2f793a11ae1e = []byte{ 0x6e, 0xfb, 0x2c, 0xba, 0xe2, 0xe2, 0xb2, 0x35, 0x7f, 0x24, 0xde, 0xe6, 0xcf, 0x84, 0x5c, 0x85, 0xf0, 0xfc, 0xff, 0xe4, 0x1f, 0xdf, 0xfd, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x46, 0xaf, 0x53, 0xa2, 0x46, 0x04, 0x00, 0x00, +>>>>>>> main } func (m *Service) Marshal() (dAtA []byte, err error) { @@ -1469,7 +1521,11 @@ func (m *ServiceRevenueShare) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ +<<<<<<< HEAD + m.RevSharePercentage |= uint32(b&0x7F) << shift +======= m.RevSharePercentage |= uint64(b&0x7F) << shift +>>>>>>> main if b < 0x80 { break } diff --git a/x/shared/types/service_configs.go b/x/shared/types/service_configs.go index bcfb3935e..70a718bac 100644 --- a/x/shared/types/service_configs.go +++ b/x/shared/types/service_configs.go @@ -95,7 +95,11 @@ func ValidateSupplierServiceConfigs(services []*SupplierServiceConfig) error { // ensuring that the sum of the revenue share percentages is 100. // NB: This function is unit tested via the supplier staking config tests. func ValidateServiceRevShare(revShareList []*ServiceRevenueShare) error { +<<<<<<< HEAD + revSharePercentageSum := uint32(0) +======= revSharePercentageSum := uint64(0) +>>>>>>> main if len(revShareList) == 0 { return ErrSharedInvalidRevShare.Wrap("no rev share configurations") diff --git a/x/supplier/config/supplier_configs_reader.go b/x/supplier/config/supplier_configs_reader.go index 6c604677e..077444352 100644 --- a/x/supplier/config/supplier_configs_reader.go +++ b/x/supplier/config/supplier_configs_reader.go @@ -19,14 +19,22 @@ type YAMLStakeConfig struct { OperatorAddress string `yaml:"operator_address"` StakeAmount string `yaml:"stake_amount"` Services []*YAMLStakeService `yaml:"services"` +<<<<<<< HEAD + DefaultRevSharePercent map[string]uint32 `yaml:"default_rev_share_percent"` +======= DefaultRevSharePercent map[string]uint64 `yaml:"default_rev_share_percent"` +>>>>>>> main } // YAMLStakeService is the structure describing a single service entry in the // stake config file. type YAMLStakeService struct { ServiceId string `yaml:"service_id"` +<<<<<<< HEAD + RevSharePercent map[string]uint32 `yaml:"rev_share_percent"` +======= RevSharePercent map[string]uint64 `yaml:"rev_share_percent"` +>>>>>>> main Endpoints []YAMLServiceEndpoint `yaml:"endpoints"` } @@ -102,7 +110,11 @@ func ParseSupplierConfigs(ctx context.Context, configContent []byte) (*SupplierS ) } +<<<<<<< HEAD + defaultRevSharePercent := map[string]uint32{} +======= defaultRevSharePercent := map[string]uint64{} +>>>>>>> main if len(stakeConfig.DefaultRevSharePercent) == 0 { // Ensure that if no default rev share is provided, the owner address is set // to 100% rev share. diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index bdecfd975..91b48657b 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -47,6 +47,10 @@ func (k Keeper) AllSuppliers( return status.Error(codes.Internal, err.Error()) } +<<<<<<< HEAD + // Filter out the supplier if the request specifies a serviceId as a constraint and the supplier +======= +>>>>>>> main serviceIdFilter := req.GetServiceId() if serviceIdFilter != "" { hasService := false @@ -62,10 +66,13 @@ func (k Keeper) AllSuppliers( } } +<<<<<<< HEAD +======= // TODO_MAINNET(@olshansk, #1033): Newer version of the CosmosSDK doesn't support maps. // Decide on a direction w.r.t maps in protos based on feedback from the CosmoSDK team. supplier.ServicesActivationHeightsMap = nil +>>>>>>> main suppliers = append(suppliers, supplier) return nil }, diff --git a/x/supplier/keeper/query_supplier_test.go b/x/supplier/keeper/query_supplier_test.go index 880f815f9..8a4e3e20f 100644 --- a/x/supplier/keeper/query_supplier_test.go +++ b/x/supplier/keeper/query_supplier_test.go @@ -22,7 +22,10 @@ var _ = strconv.IntSize func TestSupplierQuerySingle(t *testing.T) { supplierModuleKeepers, ctx := keepertest.SupplierKeeper(t) suppliers := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 2) +<<<<<<< HEAD +======= supplierAddr := sample.AccAddress() +>>>>>>> main tests := []struct { desc string @@ -49,7 +52,11 @@ func TestSupplierQuerySingle(t *testing.T) { request: &types.QueryGetSupplierRequest{ OperatorAddress: supplierAddr, }, +<<<<<<< HEAD + expectedErr: status.Error(codes.NotFound, "supplier with address: \"100000\""), +======= expectedErr: status.Error(codes.NotFound, fmt.Sprintf("supplier with address: \"%s\"", supplierAddr)), +>>>>>>> main }, { desc: "InvalidRequest", @@ -135,17 +142,28 @@ func TestSupplierQueryPaginated(t *testing.T) { func TestSupplierQueryFilterByServiceId(t *testing.T) { supplierModuleKeepers, ctx := keepertest.SupplierKeeper(t) +<<<<<<< HEAD + msgs := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 5) + + // Get the first service ID from the first supplier to use as filter + firstServiceId := msgs[0].Services[0].ServiceId +======= suppliers := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 5) // Get the first service ID from the first supplier to use as filter firstServiceId := suppliers[0].Services[0].ServiceId +>>>>>>> main request := &types.QueryAllSuppliersRequest{ Filter: &types.QueryAllSuppliersRequest_ServiceId{ ServiceId: firstServiceId, }, Pagination: &query.PageRequest{ +<<<<<<< HEAD + Limit: uint64(len(msgs)), +======= Limit: uint64(len(suppliers)), +>>>>>>> main }, } diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index a64176dd8..81066af3f 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -21,25 +21,42 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { { Alias: []string{"suppliers", "ls"}, RpcMethod: "AllSuppliers", +<<<<<<< HEAD + Use: "list-suppliers [service-id]", +======= Use: "list-suppliers", +>>>>>>> main Short: "List all suppliers on Pocket Network", Long: `Retrieves a paginated list of all suppliers currently registered on Pocket Network, including all their details. The command supports optional filtering by service ID and pagination parameters. Returns supplier addresses, staked amounts, service details, and current status.`, +<<<<<<< HEAD + Example: ` + poktrolld query supplier list-suppliers +======= Example: ` poktrolld query supplier list-suppliers +>>>>>>> main poktrolld query supplier list-suppliers --service-id anvil poktrolld query supplier list-suppliers --page 2 --limit 50 poktrolld query supplier list-suppliers --service-id anvil --page 1 --limit 100`, FlagOptions: map[string]*autocliv1.FlagOptions{ "service_id": {Name: "service-id", Shorthand: "s", Usage: "service id to filter by", Hidden: false}, }, +<<<<<<< HEAD + // PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "service_id"}}, +======= +>>>>>>> main }, { Alias: []string{"supplier", "s"}, RpcMethod: "Supplier", +<<<<<<< HEAD + Use: "show-supplier [address]", +======= Use: "show-supplier [operator_address]", +>>>>>>> main Short: "Shows detailed information about a specific supplier", Long: `Retrieves comprehensive information about a supplier identified by their address. @@ -47,7 +64,13 @@ Returns details include things like: - Supplier's staked amount and status - List of services they provide`, +<<<<<<< HEAD + Example: ` + + poktrolld query supplier show-supplier pokt1abc...xyz +======= Example: ` poktrolld query supplier show-supplier pokt1abc...xyz +>>>>>>> main poktrolld query supplier show-supplier pokt1abc...xyz --output json poktrolld query supplier show-supplier pokt1abc...xyz --height 100`, PositionalArgs: []*autocliv1.PositionalArgDescriptor{