From 68aa2323685e9dd526b3155ab803f2a4e0654924 Mon Sep 17 00:00:00 2001 From: Prad Date: Tue, 24 Dec 2024 18:52:03 +0000 Subject: [PATCH] refactor(api): remove unused Allocate RPC from Query service --- api/dwn/v1/query.pulsar.go | 1196 +--------------------------------- api/dwn/v1/query_grpc.pb.go | 44 +- proto/dwn/v1/query.proto | 19 - x/dwn/keeper/query_server.go | 7 - x/dwn/types/query.pb.go | 552 +--------------- x/dwn/types/query.pb.gw.go | 65 -- 6 files changed, 42 insertions(+), 1841 deletions(-) diff --git a/api/dwn/v1/query.pulsar.go b/api/dwn/v1/query.pulsar.go index 9ccb8cf91..cce868221 100644 --- a/api/dwn/v1/query.pulsar.go +++ b/api/dwn/v1/query.pulsar.go @@ -804,1012 +804,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_QueryAllocateRequest protoreflect.MessageDescriptor -) - -func init() { - file_dwn_v1_query_proto_init() - md_QueryAllocateRequest = File_dwn_v1_query_proto.Messages().ByName("QueryAllocateRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryAllocateRequest)(nil) - -type fastReflection_QueryAllocateRequest QueryAllocateRequest - -func (x *QueryAllocateRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllocateRequest)(x) -} - -func (x *QueryAllocateRequest) slowProtoReflect() protoreflect.Message { - mi := &file_dwn_v1_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAllocateRequest_messageType fastReflection_QueryAllocateRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllocateRequest_messageType{} - -type fastReflection_QueryAllocateRequest_messageType struct{} - -func (x fastReflection_QueryAllocateRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllocateRequest)(nil) -} -func (x fastReflection_QueryAllocateRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllocateRequest) -} -func (x fastReflection_QueryAllocateRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllocateRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAllocateRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllocateRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAllocateRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAllocateRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllocateRequest) New() protoreflect.Message { - return new(fastReflection_QueryAllocateRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllocateRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAllocateRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryAllocateRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAllocateRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAllocateRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAllocateRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateRequest")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAllocateRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in dwn.v1.QueryAllocateRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAllocateRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryAllocateRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllocateRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllocateRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllocateRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllocateRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllocateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryAllocateResponse protoreflect.MessageDescriptor - fd_QueryAllocateResponse_success protoreflect.FieldDescriptor - fd_QueryAllocateResponse_cid protoreflect.FieldDescriptor - fd_QueryAllocateResponse_macaroon protoreflect.FieldDescriptor - fd_QueryAllocateResponse_public_uri protoreflect.FieldDescriptor - fd_QueryAllocateResponse_expiry_block protoreflect.FieldDescriptor -) - -func init() { - file_dwn_v1_query_proto_init() - md_QueryAllocateResponse = File_dwn_v1_query_proto.Messages().ByName("QueryAllocateResponse") - fd_QueryAllocateResponse_success = md_QueryAllocateResponse.Fields().ByName("success") - fd_QueryAllocateResponse_cid = md_QueryAllocateResponse.Fields().ByName("cid") - fd_QueryAllocateResponse_macaroon = md_QueryAllocateResponse.Fields().ByName("macaroon") - fd_QueryAllocateResponse_public_uri = md_QueryAllocateResponse.Fields().ByName("public_uri") - fd_QueryAllocateResponse_expiry_block = md_QueryAllocateResponse.Fields().ByName("expiry_block") -} - -var _ protoreflect.Message = (*fastReflection_QueryAllocateResponse)(nil) - -type fastReflection_QueryAllocateResponse QueryAllocateResponse - -func (x *QueryAllocateResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllocateResponse)(x) -} - -func (x *QueryAllocateResponse) slowProtoReflect() protoreflect.Message { - mi := &file_dwn_v1_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAllocateResponse_messageType fastReflection_QueryAllocateResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllocateResponse_messageType{} - -type fastReflection_QueryAllocateResponse_messageType struct{} - -func (x fastReflection_QueryAllocateResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllocateResponse)(nil) -} -func (x fastReflection_QueryAllocateResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllocateResponse) -} -func (x fastReflection_QueryAllocateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllocateResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAllocateResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllocateResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAllocateResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAllocateResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllocateResponse) New() protoreflect.Message { - return new(fastReflection_QueryAllocateResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllocateResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAllocateResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryAllocateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Success != false { - value := protoreflect.ValueOfBool(x.Success) - if !f(fd_QueryAllocateResponse_success, value) { - return - } - } - if x.Cid != "" { - value := protoreflect.ValueOfString(x.Cid) - if !f(fd_QueryAllocateResponse_cid, value) { - return - } - } - if x.Macaroon != "" { - value := protoreflect.ValueOfString(x.Macaroon) - if !f(fd_QueryAllocateResponse_macaroon, value) { - return - } - } - if x.PublicUri != "" { - value := protoreflect.ValueOfString(x.PublicUri) - if !f(fd_QueryAllocateResponse_public_uri, value) { - return - } - } - if x.ExpiryBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.ExpiryBlock) - if !f(fd_QueryAllocateResponse_expiry_block, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAllocateResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - return x.Success != false - case "dwn.v1.QueryAllocateResponse.cid": - return x.Cid != "" - case "dwn.v1.QueryAllocateResponse.macaroon": - return x.Macaroon != "" - case "dwn.v1.QueryAllocateResponse.public_uri": - return x.PublicUri != "" - case "dwn.v1.QueryAllocateResponse.expiry_block": - return x.ExpiryBlock != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - x.Success = false - case "dwn.v1.QueryAllocateResponse.cid": - x.Cid = "" - case "dwn.v1.QueryAllocateResponse.macaroon": - x.Macaroon = "" - case "dwn.v1.QueryAllocateResponse.public_uri": - x.PublicUri = "" - case "dwn.v1.QueryAllocateResponse.expiry_block": - x.ExpiryBlock = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAllocateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - value := x.Success - return protoreflect.ValueOfBool(value) - case "dwn.v1.QueryAllocateResponse.cid": - value := x.Cid - return protoreflect.ValueOfString(value) - case "dwn.v1.QueryAllocateResponse.macaroon": - value := x.Macaroon - return protoreflect.ValueOfString(value) - case "dwn.v1.QueryAllocateResponse.public_uri": - value := x.PublicUri - return protoreflect.ValueOfString(value) - case "dwn.v1.QueryAllocateResponse.expiry_block": - value := x.ExpiryBlock - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - x.Success = value.Bool() - case "dwn.v1.QueryAllocateResponse.cid": - x.Cid = value.Interface().(string) - case "dwn.v1.QueryAllocateResponse.macaroon": - x.Macaroon = value.Interface().(string) - case "dwn.v1.QueryAllocateResponse.public_uri": - x.PublicUri = value.Interface().(string) - case "dwn.v1.QueryAllocateResponse.expiry_block": - x.ExpiryBlock = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - panic(fmt.Errorf("field success of message dwn.v1.QueryAllocateResponse is not mutable")) - case "dwn.v1.QueryAllocateResponse.cid": - panic(fmt.Errorf("field cid of message dwn.v1.QueryAllocateResponse is not mutable")) - case "dwn.v1.QueryAllocateResponse.macaroon": - panic(fmt.Errorf("field macaroon of message dwn.v1.QueryAllocateResponse is not mutable")) - case "dwn.v1.QueryAllocateResponse.public_uri": - panic(fmt.Errorf("field public_uri of message dwn.v1.QueryAllocateResponse is not mutable")) - case "dwn.v1.QueryAllocateResponse.expiry_block": - panic(fmt.Errorf("field expiry_block of message dwn.v1.QueryAllocateResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAllocateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "dwn.v1.QueryAllocateResponse.success": - return protoreflect.ValueOfBool(false) - case "dwn.v1.QueryAllocateResponse.cid": - return protoreflect.ValueOfString("") - case "dwn.v1.QueryAllocateResponse.macaroon": - return protoreflect.ValueOfString("") - case "dwn.v1.QueryAllocateResponse.public_uri": - return protoreflect.ValueOfString("") - case "dwn.v1.QueryAllocateResponse.expiry_block": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: dwn.v1.QueryAllocateResponse")) - } - panic(fmt.Errorf("message dwn.v1.QueryAllocateResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAllocateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in dwn.v1.QueryAllocateResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAllocateResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllocateResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryAllocateResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllocateResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllocateResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Success { - n += 2 - } - l = len(x.Cid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Macaroon) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PublicUri) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ExpiryBlock != 0 { - n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllocateResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.ExpiryBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryBlock)) - i-- - dAtA[i] = 0x28 - } - if len(x.PublicUri) > 0 { - i -= len(x.PublicUri) - copy(dAtA[i:], x.PublicUri) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicUri))) - i-- - dAtA[i] = 0x22 - } - if len(x.Macaroon) > 0 { - i -= len(x.Macaroon) - copy(dAtA[i:], x.Macaroon) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Macaroon))) - i-- - dAtA[i] = 0x1a - } - if len(x.Cid) > 0 { - i -= len(x.Cid) - copy(dAtA[i:], x.Cid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) - i-- - dAtA[i] = 0x12 - } - if x.Success { - i-- - if x.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllocateResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllocateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Success = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Cid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Macaroon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicUri", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.PublicUri = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) - } - x.ExpiryBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.ExpiryBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -1887,101 +881,6 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -// QueryAllocateRequest is the request type for the Allocate RPC method. -type QueryAllocateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryAllocateRequest) Reset() { - *x = QueryAllocateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_dwn_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAllocateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAllocateRequest) ProtoMessage() {} - -// Deprecated: Use QueryAllocateRequest.ProtoReflect.Descriptor instead. -func (*QueryAllocateRequest) Descriptor() ([]byte, []int) { - return file_dwn_v1_query_proto_rawDescGZIP(), []int{2} -} - -// AllocateResponse is the response type for the Allocate RPC method. -type QueryAllocateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` - Macaroon string `protobuf:"bytes,3,opt,name=macaroon,proto3" json:"macaroon,omitempty"` - PublicUri string `protobuf:"bytes,4,opt,name=public_uri,json=publicUri,proto3" json:"public_uri,omitempty"` - ExpiryBlock int64 `protobuf:"varint,5,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` -} - -func (x *QueryAllocateResponse) Reset() { - *x = QueryAllocateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_dwn_v1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAllocateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAllocateResponse) ProtoMessage() {} - -// Deprecated: Use QueryAllocateResponse.ProtoReflect.Descriptor instead. -func (*QueryAllocateResponse) Descriptor() ([]byte, []int) { - return file_dwn_v1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryAllocateResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *QueryAllocateResponse) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *QueryAllocateResponse) GetMacaroon() string { - if x != nil { - return x.Macaroon - } - return "" -} - -func (x *QueryAllocateResponse) GetPublicUri() string { - if x != nil { - return x.PublicUri - } - return "" -} - -func (x *QueryAllocateResponse) GetExpiryBlock() int64 { - if x != nil { - return x.ExpiryBlock - } - return 0 -} - var File_dwn_v1_query_proto protoreflect.FileDescriptor var file_dwn_v1_query_proto_rawDesc = []byte{ @@ -1995,40 +894,21 @@ var file_dwn_v1_query_proto_rawDesc = []byte{ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa1, 0x01, - 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x63, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x55, 0x72, 0x69, 0x12, 0x21, - 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x32, 0xc9, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5b, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, - 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x63, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x61, 0x75, 0x6c, - 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x42, 0x7a, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, - 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x77, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x77, 0x6e, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x77, 0x6e, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x06, 0x44, 0x77, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x77, 0x6e, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x07, 0x44, 0x77, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x64, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5b, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, + 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x7a, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x64, 0x77, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x77, 0x6e, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x77, 0x6e, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x06, 0x44, 0x77, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x77, 0x6e, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, + 0x44, 0x77, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2043,22 +923,18 @@ func file_dwn_v1_query_proto_rawDescGZIP() []byte { return file_dwn_v1_query_proto_rawDescData } -var file_dwn_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_dwn_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_dwn_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: dwn.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: dwn.v1.QueryParamsResponse - (*QueryAllocateRequest)(nil), // 2: dwn.v1.QueryAllocateRequest - (*QueryAllocateResponse)(nil), // 3: dwn.v1.QueryAllocateResponse - (*Params)(nil), // 4: dwn.v1.Params + (*QueryParamsRequest)(nil), // 0: dwn.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: dwn.v1.QueryParamsResponse + (*Params)(nil), // 2: dwn.v1.Params } var file_dwn_v1_query_proto_depIdxs = []int32{ - 4, // 0: dwn.v1.QueryParamsResponse.params:type_name -> dwn.v1.Params + 2, // 0: dwn.v1.QueryParamsResponse.params:type_name -> dwn.v1.Params 0, // 1: dwn.v1.Query.Params:input_type -> dwn.v1.QueryParamsRequest - 2, // 2: dwn.v1.Query.Allocate:input_type -> dwn.v1.QueryAllocateRequest - 1, // 3: dwn.v1.Query.Params:output_type -> dwn.v1.QueryParamsResponse - 3, // 4: dwn.v1.Query.Allocate:output_type -> dwn.v1.QueryAllocateResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type + 1, // 2: dwn.v1.Query.Params:output_type -> dwn.v1.QueryParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -2095,30 +971,6 @@ func file_dwn_v1_query_proto_init() { return nil } } - file_dwn_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllocateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_dwn_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllocateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2126,7 +978,7 @@ func file_dwn_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_dwn_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/api/dwn/v1/query_grpc.pb.go b/api/dwn/v1/query_grpc.pb.go index 755023695..e05d6bbeb 100644 --- a/api/dwn/v1/query_grpc.pb.go +++ b/api/dwn/v1/query_grpc.pb.go @@ -19,8 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Query_Params_FullMethodName = "/dwn.v1.Query/Params" - Query_Allocate_FullMethodName = "/dwn.v1.Query/Allocate" + Query_Params_FullMethodName = "/dwn.v1.Query/Params" ) // QueryClient is the client API for Query service. @@ -31,9 +30,6 @@ const ( type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Allocate initializes a Target Vault available for claims with a compatible - // Authentication mechanism. The default authentication mechanism is WebAuthn. - Allocate(ctx context.Context, in *QueryAllocateRequest, opts ...grpc.CallOption) (*QueryAllocateResponse, error) } type queryClient struct { @@ -54,16 +50,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) Allocate(ctx context.Context, in *QueryAllocateRequest, opts ...grpc.CallOption) (*QueryAllocateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllocateResponse) - err := c.cc.Invoke(ctx, Query_Allocate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility. @@ -72,9 +58,6 @@ func (c *queryClient) Allocate(ctx context.Context, in *QueryAllocateRequest, op type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Allocate initializes a Target Vault available for claims with a compatible - // Authentication mechanism. The default authentication mechanism is WebAuthn. - Allocate(context.Context, *QueryAllocateRequest) (*QueryAllocateResponse, error) mustEmbedUnimplementedQueryServer() } @@ -88,9 +71,6 @@ type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) Allocate(context.Context, *QueryAllocateRequest) (*QueryAllocateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented") -} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) testEmbeddedByValue() {} @@ -130,24 +110,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllocateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Allocate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Allocate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Allocate(ctx, req.(*QueryAllocateRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -159,10 +121,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Allocate", - Handler: _Query_Allocate_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "dwn/v1/query.proto", diff --git a/proto/dwn/v1/query.proto b/proto/dwn/v1/query.proto index c9ab2b874..27e55f15b 100644 --- a/proto/dwn/v1/query.proto +++ b/proto/dwn/v1/query.proto @@ -16,13 +16,6 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/vault/v1/params"; } - - - // Allocate initializes a Target Vault available for claims with a compatible - // Authentication mechanism. The default authentication mechanism is WebAuthn. - rpc Allocate(QueryAllocateRequest) returns (QueryAllocateResponse) { - option (google.api.http).get = "/vault/v1/allocate"; - } } // ╭──────────────────────────────────────────────────────────╮ @@ -38,15 +31,3 @@ message QueryParamsResponse { Params params = 1; } -// QueryAllocateRequest is the request type for the Allocate RPC method. -message QueryAllocateRequest {} - -// AllocateResponse is the response type for the Allocate RPC method. -message QueryAllocateResponse { - bool success = 1; - string cid = 2; - string macaroon = 3; - string public_uri = 4; - int64 expiry_block = 5; -} - diff --git a/x/dwn/keeper/query_server.go b/x/dwn/keeper/query_server.go index aa3fdc147..c4e572466 100644 --- a/x/dwn/keeper/query_server.go +++ b/x/dwn/keeper/query_server.go @@ -28,10 +28,3 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type return &types.QueryParamsResponse{Params: &p}, nil } - -// Allocate implements types.QueryServer. -func (k Querier) Allocate(goCtx context.Context, req *types.QueryAllocateRequest) (*types.QueryAllocateResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - panic("Allocate is unimplemented") - return &types.QueryAllocateResponse{}, nil -} diff --git a/x/dwn/types/query.pb.go b/x/dwn/types/query.pb.go index 39bb35203..37d026958 100644 --- a/x/dwn/types/query.pb.go +++ b/x/dwn/types/query.pb.go @@ -111,156 +111,31 @@ func (m *QueryParamsResponse) GetParams() *Params { return nil } -// QueryAllocateRequest is the request type for the Allocate RPC method. -type QueryAllocateRequest struct { -} - -func (m *QueryAllocateRequest) Reset() { *m = QueryAllocateRequest{} } -func (m *QueryAllocateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllocateRequest) ProtoMessage() {} -func (*QueryAllocateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9a31dfed63924cb3, []int{2} -} -func (m *QueryAllocateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllocateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllocateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllocateRequest.Merge(m, src) -} -func (m *QueryAllocateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllocateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllocateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllocateRequest proto.InternalMessageInfo - -// AllocateResponse is the response type for the Allocate RPC method. -type QueryAllocateResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` - Macaroon string `protobuf:"bytes,3,opt,name=macaroon,proto3" json:"macaroon,omitempty"` - PublicUri string `protobuf:"bytes,4,opt,name=public_uri,json=publicUri,proto3" json:"public_uri,omitempty"` - ExpiryBlock int64 `protobuf:"varint,5,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` -} - -func (m *QueryAllocateResponse) Reset() { *m = QueryAllocateResponse{} } -func (m *QueryAllocateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllocateResponse) ProtoMessage() {} -func (*QueryAllocateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9a31dfed63924cb3, []int{3} -} -func (m *QueryAllocateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllocateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllocateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllocateResponse.Merge(m, src) -} -func (m *QueryAllocateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllocateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllocateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllocateResponse proto.InternalMessageInfo - -func (m *QueryAllocateResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *QueryAllocateResponse) GetCid() string { - if m != nil { - return m.Cid - } - return "" -} - -func (m *QueryAllocateResponse) GetMacaroon() string { - if m != nil { - return m.Macaroon - } - return "" -} - -func (m *QueryAllocateResponse) GetPublicUri() string { - if m != nil { - return m.PublicUri - } - return "" -} - -func (m *QueryAllocateResponse) GetExpiryBlock() int64 { - if m != nil { - return m.ExpiryBlock - } - return 0 -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "dwn.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dwn.v1.QueryParamsResponse") - proto.RegisterType((*QueryAllocateRequest)(nil), "dwn.v1.QueryAllocateRequest") - proto.RegisterType((*QueryAllocateResponse)(nil), "dwn.v1.QueryAllocateResponse") } func init() { proto.RegisterFile("dwn/v1/query.proto", fileDescriptor_9a31dfed63924cb3) } var fileDescriptor_9a31dfed63924cb3 = []byte{ - // 399 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x8e, 0xd3, 0x30, - 0x10, 0xae, 0xb7, 0x6c, 0xe8, 0x7a, 0x11, 0x5a, 0x0d, 0x01, 0x45, 0x61, 0x37, 0x2a, 0x39, 0xa0, - 0x9e, 0x62, 0xed, 0x72, 0x85, 0x03, 0xfb, 0x04, 0x10, 0x89, 0x0b, 0x1c, 0x56, 0x8e, 0x6b, 0x05, - 0x8b, 0xd4, 0x4e, 0x6d, 0xa7, 0x3f, 0x57, 0x9e, 0x00, 0x89, 0x27, 0xe0, 0x6d, 0xe0, 0x56, 0x89, - 0x0b, 0x47, 0xd4, 0xf2, 0x20, 0x28, 0x76, 0x02, 0x6a, 0x61, 0x2f, 0x51, 0xe6, 0xfb, 0x66, 0xbe, - 0xcf, 0xf3, 0x69, 0x30, 0x4c, 0x97, 0x92, 0x2c, 0x2e, 0xc9, 0xbc, 0xe1, 0x7a, 0x9d, 0xd5, 0x5a, - 0x59, 0x05, 0xc1, 0x74, 0x29, 0xb3, 0xc5, 0x65, 0x7c, 0x5e, 0x2a, 0x55, 0x56, 0x9c, 0xd0, 0x5a, - 0x10, 0x2a, 0xa5, 0xb2, 0xd4, 0x0a, 0x25, 0x8d, 0xef, 0x8a, 0xc3, 0x6e, 0xb2, 0xe4, 0x92, 0x1b, - 0xd1, 0xa1, 0x69, 0x88, 0xe1, 0x75, 0x2b, 0xf5, 0x8a, 0x6a, 0x3a, 0x33, 0x39, 0x9f, 0x37, 0xdc, - 0xd8, 0xf4, 0x05, 0x7e, 0xb0, 0x87, 0x9a, 0x5a, 0x49, 0xc3, 0xe1, 0x29, 0x0e, 0x6a, 0x87, 0x44, - 0x68, 0x8c, 0x26, 0xa7, 0x57, 0xf7, 0x33, 0xef, 0x9c, 0x75, 0x7d, 0x1d, 0x9b, 0x3e, 0xc2, 0xa1, - 0x1b, 0x7f, 0x59, 0x55, 0x8a, 0x51, 0xcb, 0x7b, 0xd9, 0x2f, 0x08, 0x3f, 0x3c, 0x20, 0x3a, 0xe5, - 0x08, 0xdf, 0x35, 0x0d, 0x63, 0xdc, 0x78, 0xe9, 0x51, 0xde, 0x97, 0x70, 0x86, 0x87, 0x4c, 0x4c, - 0xa3, 0xa3, 0x31, 0x9a, 0x9c, 0xe4, 0xed, 0x2f, 0xc4, 0x78, 0x34, 0xa3, 0x8c, 0x6a, 0xa5, 0x64, - 0x34, 0x74, 0xf0, 0x9f, 0x1a, 0x2e, 0x30, 0xae, 0x9b, 0xa2, 0x12, 0xec, 0xa6, 0xd1, 0x22, 0xba, - 0xe3, 0xd8, 0x13, 0x8f, 0xbc, 0xd1, 0x02, 0x9e, 0xe0, 0x7b, 0x7c, 0x55, 0x0b, 0xbd, 0xbe, 0x29, - 0x2a, 0xc5, 0x3e, 0x44, 0xc7, 0x63, 0x34, 0x19, 0xe6, 0xa7, 0x1e, 0xbb, 0x6e, 0xa1, 0xab, 0x6f, - 0x08, 0x1f, 0xbb, 0x37, 0xc2, 0x3b, 0x1c, 0xf8, 0xbd, 0x20, 0xee, 0xf7, 0xfc, 0x37, 0xaa, 0xf8, - 0xf1, 0x7f, 0x39, 0xbf, 0x56, 0x1a, 0x7d, 0xfc, 0xfe, 0xeb, 0xf3, 0x11, 0xc0, 0x19, 0x59, 0xd0, - 0xa6, 0xb2, 0x6d, 0xfc, 0x3e, 0x22, 0x60, 0x78, 0xd4, 0x87, 0x00, 0xe7, 0x7b, 0x12, 0x07, 0xa1, - 0xc5, 0x17, 0xb7, 0xb0, 0x9d, 0x45, 0xec, 0x2c, 0x42, 0x80, 0xbf, 0x16, 0xb4, 0xeb, 0xb9, 0x7e, - 0xfe, 0x75, 0x9b, 0xa0, 0xcd, 0x36, 0x41, 0x3f, 0xb7, 0x09, 0xfa, 0xb4, 0x4b, 0x06, 0x9b, 0x5d, - 0x32, 0xf8, 0xb1, 0x4b, 0x06, 0x6f, 0xd3, 0x52, 0xd8, 0xf7, 0x4d, 0x91, 0x31, 0x35, 0x23, 0x4a, - 0x1a, 0x25, 0x35, 0x71, 0x9f, 0x15, 0x69, 0xaf, 0xc4, 0xae, 0x6b, 0x6e, 0x8a, 0xc0, 0x5d, 0xc8, - 0xb3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x14, 0x99, 0xd4, 0xa2, 0x73, 0x02, 0x00, 0x00, + // 254 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0x29, 0xcf, 0xd3, + 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, + 0x4b, 0x29, 0xcf, 0xd3, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, + 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0xa8, + 0x92, 0x12, 0x81, 0xea, 0x4c, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x84, 0x8a, 0x2a, 0x89, 0x70, 0x09, + 0x05, 0x82, 0x8c, 0x0a, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, + 0x51, 0xb2, 0xe5, 0x12, 0x46, 0x11, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, 0xe3, 0x62, + 0x2b, 0x00, 0x8b, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xf1, 0xe9, 0x41, 0x6c, 0xd6, 0x83, + 0xaa, 0x83, 0xca, 0x1a, 0xa5, 0x70, 0xb1, 0x82, 0xb5, 0x0b, 0x45, 0x73, 0xb1, 0x41, 0xa4, 0x84, + 0xa4, 0x60, 0x4a, 0x31, 0x6d, 0x93, 0x92, 0xc6, 0x2a, 0x07, 0xb1, 0x53, 0x49, 0xa2, 0xe9, 0xf2, + 0x93, 0xc9, 0x4c, 0x42, 0x42, 0x02, 0xfa, 0x65, 0x89, 0xa5, 0x39, 0x25, 0x20, 0x1f, 0x40, 0x6c, + 0x71, 0xb2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, + 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, + 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0x7d, + 0x30, 0x51, 0xa1, 0x0f, 0x0a, 0x83, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xff, 0x8d, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9d, 0xd6, 0xd8, 0xe6, 0x51, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -277,9 +152,6 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Allocate initializes a Target Vault available for claims with a compatible - // Authentication mechanism. The default authentication mechanism is WebAuthn. - Allocate(ctx context.Context, in *QueryAllocateRequest, opts ...grpc.CallOption) (*QueryAllocateResponse, error) } type queryClient struct { @@ -299,22 +171,10 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) Allocate(ctx context.Context, in *QueryAllocateRequest, opts ...grpc.CallOption) (*QueryAllocateResponse, error) { - out := new(QueryAllocateResponse) - err := c.cc.Invoke(ctx, "/dwn.v1.Query/Allocate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Allocate initializes a Target Vault available for claims with a compatible - // Authentication mechanism. The default authentication mechanism is WebAuthn. - Allocate(context.Context, *QueryAllocateRequest) (*QueryAllocateResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -324,9 +184,6 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) Allocate(ctx context.Context, req *QueryAllocateRequest) (*QueryAllocateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -350,24 +207,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllocateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Allocate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dwn.v1.Query/Allocate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Allocate(ctx, req.(*QueryAllocateRequest)) - } - return interceptor(ctx, in, info, handler) -} - var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dwn.v1.Query", @@ -377,10 +216,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "Allocate", - Handler: _Query_Allocate_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "dwn/v1/query.proto", @@ -444,88 +279,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllocateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllocateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllocateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryAllocateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllocateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllocateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExpiryBlock != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ExpiryBlock)) - i-- - dAtA[i] = 0x28 - } - if len(m.PublicUri) > 0 { - i -= len(m.PublicUri) - copy(dAtA[i:], m.PublicUri) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PublicUri))) - i-- - dAtA[i] = 0x22 - } - if len(m.Macaroon) > 0 { - i -= len(m.Macaroon) - copy(dAtA[i:], m.Macaroon) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Macaroon))) - i-- - dAtA[i] = 0x1a - } - if len(m.Cid) > 0 { - i -= len(m.Cid) - copy(dAtA[i:], m.Cid) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Cid))) - i-- - dAtA[i] = 0x12 - } - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -559,42 +312,6 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryAllocateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryAllocateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - l = len(m.Cid) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Macaroon) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PublicUri) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.ExpiryBlock != 0 { - n += 1 + sovQuery(uint64(m.ExpiryBlock)) - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -737,241 +454,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllocateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllocateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllocateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllocateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Macaroon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicUri", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicUri = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) - } - m.ExpiryBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpiryBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/dwn/types/query.pb.gw.go b/x/dwn/types/query.pb.gw.go index 5b345f236..406d1adcc 100644 --- a/x/dwn/types/query.pb.gw.go +++ b/x/dwn/types/query.pb.gw.go @@ -51,24 +51,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_Allocate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllocateRequest - var metadata runtime.ServerMetadata - - msg, err := client.Allocate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Allocate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllocateRequest - var metadata runtime.ServerMetadata - - msg, err := server.Allocate(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -98,29 +80,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Allocate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Allocate_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allocate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -182,37 +141,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Allocate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Allocate_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allocate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Allocate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "allocate"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Allocate_0 = runtime.ForwardResponseMessage )