From 734134c525b54492ef85dcfa54a074bd6c956789 Mon Sep 17 00:00:00 2001 From: Daniel Ahn Date: Thu, 8 Dec 2022 16:43:41 -0800 Subject: [PATCH 1/2] added file upload check query --- proto/canine_chain/storage/query.proto | 15 +- x/storage/client/cli/query.go | 2 + .../client/cli/query_file_upload_check.go | 46 ++ .../keeper/grpc_query_file_upload_check.go | 34 + x/storage/types/query.pb.go | 588 +++++++++++++++--- x/storage/types/query.pb.gw.go | 83 +++ 6 files changed, 677 insertions(+), 91 deletions(-) create mode 100644 x/storage/client/cli/query_file_upload_check.go create mode 100644 x/storage/keeper/grpc_query_file_upload_check.go diff --git a/proto/canine_chain/storage/query.proto b/proto/canine_chain/storage/query.proto index 3709d6595..992765360 100644 --- a/proto/canine_chain/storage/query.proto +++ b/proto/canine_chain/storage/query.proto @@ -119,7 +119,11 @@ service Query { "/jackal-dao/canine-chain/storage/payment_info"; } - // this line is used by starport scaffolding # 2 + // Queries whether user can upload a file based on size + rpc FileUploadCheck(QueryFileUploadCheck) returns (QueryFileUploadCheckResponse) { + option (google.api.http).get = + "/jackal-dao/canine-chain/storage/file_upload_check"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -241,4 +245,13 @@ message QueryAllStoragePaymentInfoResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryFileUploadCheck { + string address = 1; + int64 bytes = 2; +} + +message QueryFileUploadCheckResponse { + bool valid = 1; +} + // this line is used by starport scaffolding # 3 diff --git a/x/storage/client/cli/query.go b/x/storage/client/cli/query.go index 6bd8512a9..307474257 100644 --- a/x/storage/client/cli/query.go +++ b/x/storage/client/cli/query.go @@ -43,6 +43,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdShowFidCid()) cmd.AddCommand(CmdGetPayData()) + cmd.AddCommand(CmdFileUploadCheck()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/storage/client/cli/query_file_upload_check.go b/x/storage/client/cli/query_file_upload_check.go new file mode 100644 index 000000000..809d6d7c6 --- /dev/null +++ b/x/storage/client/cli/query_file_upload_check.go @@ -0,0 +1,46 @@ +package cli + +import ( + "context" + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/jackalLabs/canine-chain/x/storage/types" + "github.com/spf13/cobra" +) + +func CmdFileUploadCheck() *cobra.Command { + cmd := &cobra.Command{ + Use: "file-upload-check [address] [bytes]", + Short: "check user can upload file based on size", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + argAddr := args[0] + argByte := args[1] + + reqByte, err := strconv.ParseInt(argByte, 10, 64) + if err != nil { + return err + } + + params := &types.QueryFileUploadCheck{ + Address: argAddr, + Bytes: reqByte, + } + + res, err := queryClient.FileUploadCheck(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/storage/keeper/grpc_query_file_upload_check.go b/x/storage/keeper/grpc_query_file_upload_check.go new file mode 100644 index 000000000..588b0fc52 --- /dev/null +++ b/x/storage/keeper/grpc_query_file_upload_check.go @@ -0,0 +1,34 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/jackalLabs/canine-chain/x/storage/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) FileUploadCheck(c context.Context, req *types.QueryFileUploadCheck) (*types.QueryFileUploadCheckResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + + spi, found := k.GetStoragePaymentInfo(ctx, req.Address) + + if !found { + return nil, status.Error(codes.NotFound, "address not found") + } + + if req.Bytes < 0 { + return nil, status.Error(codes.InvalidArgument, "bytes cannot be negative") + } + + if (spi.SpaceAvailable - spi.SpaceUsed) < req.Bytes { + return &types.QueryFileUploadCheckResponse{Valid: false}, nil + } + + return &types.QueryFileUploadCheckResponse{Valid: true}, nil +} diff --git a/x/storage/types/query.pb.go b/x/storage/types/query.pb.go index af3bd9042..5b969556e 100644 --- a/x/storage/types/query.pb.go +++ b/x/storage/types/query.pb.go @@ -1577,6 +1577,102 @@ func (m *QueryAllStoragePaymentInfoResponse) GetPagination() *query.PageResponse return nil } +type QueryFileUploadCheck struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Bytes int64 `protobuf:"varint,2,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (m *QueryFileUploadCheck) Reset() { *m = QueryFileUploadCheck{} } +func (m *QueryFileUploadCheck) String() string { return proto.CompactTextString(m) } +func (*QueryFileUploadCheck) ProtoMessage() {} +func (*QueryFileUploadCheck) Descriptor() ([]byte, []int) { + return fileDescriptor_9fe03bff51a37284, []int{34} +} +func (m *QueryFileUploadCheck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFileUploadCheck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFileUploadCheck.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 *QueryFileUploadCheck) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFileUploadCheck.Merge(m, src) +} +func (m *QueryFileUploadCheck) XXX_Size() int { + return m.Size() +} +func (m *QueryFileUploadCheck) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFileUploadCheck.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFileUploadCheck proto.InternalMessageInfo + +func (m *QueryFileUploadCheck) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryFileUploadCheck) GetBytes() int64 { + if m != nil { + return m.Bytes + } + return 0 +} + +type QueryFileUploadCheckResponse struct { + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` +} + +func (m *QueryFileUploadCheckResponse) Reset() { *m = QueryFileUploadCheckResponse{} } +func (m *QueryFileUploadCheckResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFileUploadCheckResponse) ProtoMessage() {} +func (*QueryFileUploadCheckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9fe03bff51a37284, []int{35} +} +func (m *QueryFileUploadCheckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFileUploadCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFileUploadCheckResponse.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 *QueryFileUploadCheckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFileUploadCheckResponse.Merge(m, src) +} +func (m *QueryFileUploadCheckResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFileUploadCheckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFileUploadCheckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFileUploadCheckResponse proto.InternalMessageInfo + +func (m *QueryFileUploadCheckResponse) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "canine_chain.storage.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "canine_chain.storage.QueryParamsResponse") @@ -1612,101 +1708,108 @@ func init() { proto.RegisterType((*QueryStoragePaymentInfoResponse)(nil), "canine_chain.storage.QueryStoragePaymentInfoResponse") proto.RegisterType((*QueryAllStoragePaymentInfoRequest)(nil), "canine_chain.storage.QueryAllStoragePaymentInfoRequest") proto.RegisterType((*QueryAllStoragePaymentInfoResponse)(nil), "canine_chain.storage.QueryAllStoragePaymentInfoResponse") + proto.RegisterType((*QueryFileUploadCheck)(nil), "canine_chain.storage.QueryFileUploadCheck") + proto.RegisterType((*QueryFileUploadCheckResponse)(nil), "canine_chain.storage.QueryFileUploadCheckResponse") } func init() { proto.RegisterFile("canine_chain/storage/query.proto", fileDescriptor_9fe03bff51a37284) } var fileDescriptor_9fe03bff51a37284 = []byte{ - // 1418 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0xcf, 0x74, 0xbf, 0x4d, 0xbf, 0x3b, 0x29, 0x15, 0x0c, 0x69, 0x29, 0x26, 0xda, 0x36, 0x16, - 0x6d, 0xd2, 0x34, 0x59, 0x27, 0xe9, 0x4f, 0xda, 0x4a, 0xd0, 0xa6, 0x4a, 0x29, 0xea, 0x21, 0xdd, - 0xde, 0x10, 0x92, 0x99, 0xb5, 0x67, 0xb7, 0x43, 0x1d, 0x7b, 0x6b, 0xbb, 0x15, 0xab, 0x8a, 0x0b, - 0xdc, 0x11, 0x02, 0x21, 0xb8, 0xb4, 0x07, 0xa8, 0x84, 0x90, 0x38, 0xf1, 0x1f, 0x80, 0x84, 0xd4, - 0x1b, 0x95, 0xb8, 0x70, 0x42, 0xa8, 0xe5, 0x0f, 0x41, 0x1e, 0xbf, 0xb1, 0xbd, 0x5e, 0xef, 0xd8, - 0xae, 0x96, 0x5b, 0xec, 0x7d, 0x3f, 0x3e, 0xef, 0xbd, 0xcf, 0x9b, 0xf9, 0x38, 0xf8, 0xa8, 0x45, - 0x5d, 0xee, 0x32, 0xd3, 0xba, 0x4d, 0xb9, 0x6b, 0x04, 0xa1, 0xe7, 0xd3, 0x3e, 0x33, 0xee, 0xde, - 0x63, 0xfe, 0xb0, 0x3d, 0xf0, 0xbd, 0xd0, 0x23, 0xf3, 0x59, 0x8b, 0x36, 0x58, 0x68, 0xf3, 0x7d, - 0xaf, 0xef, 0x09, 0x03, 0x23, 0xfa, 0x2b, 0xb6, 0xd5, 0x16, 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, 0xf9, 0x51, 0x74, 0xab, 0xd5, 0x8c, 0x01, 0xe0, 0xba, 0x00, 0xb8, 0x42, 0x96, 0xab, - 0x02, 0x8c, 0x0e, 0x1c, 0x7c, 0x8d, 0x85, 0xa0, 0xa5, 0x89, 0x5a, 0xc6, 0x64, 0x05, 0xba, 0xb6, - 0x52, 0xc5, 0x14, 0x70, 0xbd, 0x2d, 0x70, 0xbd, 0x45, 0xce, 0x55, 0x1a, 0xf1, 0x80, 0x0e, 0x4d, - 0x9b, 0x86, 0x34, 0x33, 0xd9, 0x5f, 0x11, 0x26, 0xe3, 0xba, 0x90, 0x9c, 0x56, 0xee, 0xec, 0x04, - 0x11, 0xac, 0x9d, 0xa9, 0xe9, 0x55, 0xbb, 0x88, 0xac, 0xd6, 0xcd, 0x14, 0xf1, 0x0b, 0xc2, 0x07, - 0xc7, 0xe3, 0x47, 0x94, 0x38, 0x57, 0xb6, 0xdf, 0x93, 0x4a, 0x39, 0x5f, 0xdf, 0xb1, 0xf6, 0x21, - 0x96, 0xad, 0xe6, 0xca, 0x8d, 0x27, 0xcf, 0x5a, 0xe8, 0xe9, 0xb3, 0x16, 0xfa, 0xfb, 0x59, 0x0b, - 0x7d, 0xf1, 0xbc, 0x35, 0xf3, 0xf4, 0x79, 0x6b, 0xe6, 0xcf, 0xe7, 0xad, 0x99, 0xf7, 0x37, 0xfb, - 0x3c, 0xbc, 0x7d, 0xaf, 0xdb, 0xb6, 0xbc, 0x5d, 0x08, 0x79, 0x83, 0x76, 0x83, 0xd1, 0x90, 0x1f, - 0x27, 0x41, 0xc3, 0xe1, 0x80, 0x05, 0xdd, 0x59, 0xf1, 0x9f, 0xf8, 0x53, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0xb7, 0x60, 0x23, 0x9d, 0x2b, 0x19, 0x00, 0x00, + // 1494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59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0xd8, 0xb2, 0x3f, 0x70, + 0x99, 0xd7, 0x99, 0x16, 0xff, 0xb7, 0x38, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x25, + 0x42, 0x8a, 0x59, 0x1a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1755,6 +1858,8 @@ type QueryClient interface { StoragePaymentInfo(ctx context.Context, in *QueryStoragePaymentInfoRequest, opts ...grpc.CallOption) (*QueryStoragePaymentInfoResponse, error) // Queries a list of StoragePaymentInfo items. StoragePaymentInfoAll(ctx context.Context, in *QueryAllStoragePaymentInfoRequest, opts ...grpc.CallOption) (*QueryAllStoragePaymentInfoResponse, error) + // Queries whether user can upload a file based on size + FileUploadCheck(ctx context.Context, in *QueryFileUploadCheck, opts ...grpc.CallOption) (*QueryFileUploadCheckResponse, error) } type queryClient struct { @@ -1918,6 +2023,15 @@ func (c *queryClient) StoragePaymentInfoAll(ctx context.Context, in *QueryAllSto return out, nil } +func (c *queryClient) FileUploadCheck(ctx context.Context, in *QueryFileUploadCheck, opts ...grpc.CallOption) (*QueryFileUploadCheckResponse, error) { + out := new(QueryFileUploadCheckResponse) + err := c.cc.Invoke(ctx, "/canine_chain.storage.Query/FileUploadCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -1954,6 +2068,8 @@ type QueryServer interface { StoragePaymentInfo(context.Context, *QueryStoragePaymentInfoRequest) (*QueryStoragePaymentInfoResponse, error) // Queries a list of StoragePaymentInfo items. StoragePaymentInfoAll(context.Context, *QueryAllStoragePaymentInfoRequest) (*QueryAllStoragePaymentInfoResponse, error) + // Queries whether user can upload a file based on size + FileUploadCheck(context.Context, *QueryFileUploadCheck) (*QueryFileUploadCheckResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2011,6 +2127,9 @@ func (*UnimplementedQueryServer) StoragePaymentInfo(ctx context.Context, req *Qu func (*UnimplementedQueryServer) StoragePaymentInfoAll(ctx context.Context, req *QueryAllStoragePaymentInfoRequest) (*QueryAllStoragePaymentInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StoragePaymentInfoAll not implemented") } +func (*UnimplementedQueryServer) FileUploadCheck(ctx context.Context, req *QueryFileUploadCheck) (*QueryFileUploadCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FileUploadCheck not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2322,6 +2441,24 @@ func _Query_StoragePaymentInfoAll_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_FileUploadCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFileUploadCheck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FileUploadCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/canine_chain.storage.Query/FileUploadCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FileUploadCheck(ctx, req.(*QueryFileUploadCheck)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "canine_chain.storage.Query", HandlerType: (*QueryServer)(nil), @@ -2394,6 +2531,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "StoragePaymentInfoAll", Handler: _Query_StoragePaymentInfoAll_Handler, }, + { + MethodName: "FileUploadCheck", + Handler: _Query_FileUploadCheck_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "canine_chain/storage/query.proto", @@ -3578,6 +3719,74 @@ func (m *QueryAllStoragePaymentInfoResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *QueryFileUploadCheck) 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 *QueryFileUploadCheck) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFileUploadCheck) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Bytes != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Bytes)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFileUploadCheckResponse) 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 *QueryFileUploadCheckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFileUploadCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Valid { + i-- + if m.Valid { + 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 @@ -4050,6 +4259,34 @@ func (m *QueryAllStoragePaymentInfoResponse) Size() (n int) { return n } +func (m *QueryFileUploadCheck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Bytes != 0 { + n += 1 + sovQuery(uint64(m.Bytes)) + } + return n +} + +func (m *QueryFileUploadCheckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Valid { + n += 2 + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7064,6 +7301,177 @@ func (m *QueryAllStoragePaymentInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryFileUploadCheck) 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: QueryFileUploadCheck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFileUploadCheck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + m.Bytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Bytes |= 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 (m *QueryFileUploadCheckResponse) 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: QueryFileUploadCheckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFileUploadCheckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", 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.Valid = bool(v != 0) + 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/storage/types/query.pb.gw.go b/x/storage/types/query.pb.gw.go index 037b86069..625390940 100644 --- a/x/storage/types/query.pb.gw.go +++ b/x/storage/types/query.pb.gw.go @@ -807,6 +807,42 @@ func local_request_Query_StoragePaymentInfoAll_0(ctx context.Context, marshaler } +var ( + filter_Query_FileUploadCheck_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_FileUploadCheck_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFileUploadCheck + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FileUploadCheck_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FileUploadCheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FileUploadCheck_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFileUploadCheck + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FileUploadCheck_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FileUploadCheck(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. @@ -1204,6 +1240,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_FileUploadCheck_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_FileUploadCheck_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_FileUploadCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1585,6 +1644,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_FileUploadCheck_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_FileUploadCheck_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_FileUploadCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1622,6 +1701,8 @@ var ( pattern_Query_StoragePaymentInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"jackal-dao", "canine-chain", "storage", "payment_info", "address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_StoragePaymentInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine-chain", "storage", "payment_info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_FileUploadCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"jackal-dao", "canine-chain", "storage", "file_upload_check"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1658,4 +1739,6 @@ var ( forward_Query_StoragePaymentInfo_0 = runtime.ForwardResponseMessage forward_Query_StoragePaymentInfoAll_0 = runtime.ForwardResponseMessage + + forward_Query_FileUploadCheck_0 = runtime.ForwardResponseMessage ) From 6f5f559db03007d122bcac09e0f1a0e89ce51801 Mon Sep 17 00:00:00 2001 From: Daniel Ahn Date: Thu, 8 Dec 2022 16:56:40 -0800 Subject: [PATCH 2/2] edited FileUploadCheck --- x/storage/keeper/grpc_query_file_upload_check.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/x/storage/keeper/grpc_query_file_upload_check.go b/x/storage/keeper/grpc_query_file_upload_check.go index 588b0fc52..ffbd19c2b 100644 --- a/x/storage/keeper/grpc_query_file_upload_check.go +++ b/x/storage/keeper/grpc_query_file_upload_check.go @@ -26,9 +26,5 @@ func (k Keeper) FileUploadCheck(c context.Context, req *types.QueryFileUploadChe return nil, status.Error(codes.InvalidArgument, "bytes cannot be negative") } - if (spi.SpaceAvailable - spi.SpaceUsed) < req.Bytes { - return &types.QueryFileUploadCheckResponse{Valid: false}, nil - } - - return &types.QueryFileUploadCheckResponse{Valid: true}, nil + return &types.QueryFileUploadCheckResponse{Valid: (spi.SpaceAvailable - spi.SpaceUsed) < req.Bytes}, nil }