From 96bbaf3146d372844305344db86ec7450129a96c Mon Sep 17 00:00:00 2001 From: Roshan Date: Tue, 1 Aug 2023 14:58:35 +0800 Subject: [PATCH 1/3] feat: add new query APIs --- .gitignore | 1 + proto/greenfield/storage/query.proto | 38 + swagger/static/swagger.yaml | 163 +++ x/storage/keeper/grpc_query.go | 512 +++++++- x/storage/keeper/grpc_query_test.go | 132 ++- x/storage/keeper/payment_test.go | 14 +- x/storage/keeper/query.go | 460 -------- x/storage/types/query.pb.go | 1633 +++++++++++++++++++++++--- x/storage/types/query.pb.gw.go | 347 ++++++ 9 files changed, 2635 insertions(+), 665 deletions(-) delete mode 100644 x/storage/keeper/query.go diff --git a/.gitignore b/.gitignore index 7a8efdf4b..e1791ccc8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ build/ vendor/ .local .task +coverage.out diff --git a/proto/greenfield/storage/query.proto b/proto/greenfield/storage/query.proto index 411f7f931..bcb7ce708 100644 --- a/proto/greenfield/storage/query.proto +++ b/proto/greenfield/storage/query.proto @@ -128,6 +128,21 @@ service Query { option (google.api.http).get = "/greenfield/storage/is_price_changed/{bucket_name}"; } + // Queries whether some members are in the group. + rpc QueryGroupMembersExist(QueryGroupMembersExistRequest) returns (QueryGroupMembersExistResponse) { + option (google.api.http).get = "/greenfield/storage/group_members_exist/{group_id}/{members}"; + } + + // Queries whether some groups are exist. + rpc QueryGroupsExist(QueryGroupsExistRequest) returns (QueryGroupsExistResponse) { + option (google.api.http).get = "/greenfield/storage/groups_exist/{group_owner}/{group_names}"; + } + + // Queries whether some groups are exist by id. + rpc QueryGroupsExistById(QueryGroupsExistByIdRequest) returns (QueryGroupsExistResponse) { + option (google.api.http).get = "/greenfield/storage/groups_exist_by_id/{group_ids}"; + } + // this line is used by starport scaffolding # 2 } @@ -356,4 +371,27 @@ message QueryIsPriceChangedResponse { (gogoproto.nullable) = false ]; } + +message QueryGroupMembersExistRequest { + string group_id = 1; + repeated string members = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +message QueryGroupMembersExistResponse { + map exists = 1; +} + +message QueryGroupsExistRequest { + string group_owner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated string group_names = 2; +} + +message QueryGroupsExistByIdRequest { + repeated string group_ids = 1; +} + +message QueryGroupsExistResponse { + map exists = 1; +} + // this line is used by starport scaffolding # 3 diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index 9b3a4b440..3dd0ec391 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -2198,6 +2198,155 @@ paths: type: boolean tags: - Query + /greenfield/storage/group_members_exist/{group_id}/{members}: + get: + summary: Queries whether some members are in the group. + operationId: QueryGroupMembersExist + responses: + '200': + description: A successful response. + schema: + type: object + properties: + exists: + type: object + additionalProperties: + type: boolean + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: group_id + in: path + required: true + type: string + - name: members + in: path + required: true + type: array + items: + type: string + collectionFormat: csv + minItems: 1 + tags: + - Query + /greenfield/storage/groups_exist/{group_owner}/{group_names}: + get: + summary: Queries whether some groups are exist. + operationId: QueryGroupsExist + responses: + '200': + description: A successful response. + schema: + type: object + properties: + exists: + type: object + additionalProperties: + type: boolean + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: group_owner + in: path + required: true + type: string + - name: group_names + in: path + required: true + type: array + items: + type: string + collectionFormat: csv + minItems: 1 + tags: + - Query + /greenfield/storage/groups_exist_by_id/{group_ids}: + get: + summary: Queries whether some groups are exist by id. + operationId: QueryGroupsExistById + responses: + '200': + description: A successful response. + schema: + type: object + properties: + exists: + type: object + additionalProperties: + type: boolean + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: group_ids + in: path + required: true + type: array + items: + type: string + collectionFormat: csv + minItems: 1 + tags: + - Query /greenfield/storage/head_bucket/{bucket_name}: get: summary: Queries a bucket with specify name. @@ -33742,6 +33891,13 @@ definitions: value: type: string title: attributes + greenfield.storage.QueryGroupMembersExistResponse: + type: object + properties: + exists: + type: object + additionalProperties: + type: boolean greenfield.storage.QueryGroupNFTResponse: type: object properties: @@ -33770,6 +33926,13 @@ definitions: value: type: string title: attributes + greenfield.storage.QueryGroupsExistResponse: + type: object + properties: + exists: + type: object + additionalProperties: + type: boolean greenfield.storage.QueryHeadBucketExtraResponse: type: object properties: diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go index ddcc0e4dd..24009e97c 100644 --- a/x/storage/keeper/grpc_query.go +++ b/x/storage/keeper/grpc_query.go @@ -3,12 +3,22 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - types2 "github.com/bnb-chain/greenfield/x/sp/types" + "github.com/bnb-chain/greenfield/internal/sequence" + gnfd "github.com/bnb-chain/greenfield/types" + "github.com/bnb-chain/greenfield/types/errors" + permtypes "github.com/bnb-chain/greenfield/x/permission/types" + sptypes "github.com/bnb-chain/greenfield/x/sp/types" "github.com/bnb-chain/greenfield/x/storage/types" + vgtypes "github.com/bnb-chain/greenfield/x/virtualgroup/types" ) var _ types.QueryServer = Keeper{} @@ -43,6 +53,239 @@ func (k Keeper) QueryParamsByTimestamp(c context.Context, req *types.QueryParams return &types.QueryParamsByTimestampResponse{Params: params}, nil } +func (k Keeper) HeadBucket(goCtx context.Context, req *types.QueryHeadBucketRequest) (*types.QueryHeadBucketResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) + if found { + return &types.QueryHeadBucketResponse{ + BucketInfo: bucketInfo, + }, nil + } + return nil, types.ErrNoSuchBucket +} + +func (k Keeper) HeadBucketById(goCtx context.Context, req *types.QueryHeadBucketByIdRequest) (*types.QueryHeadBucketResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + id, err := math.ParseUint(req.BucketId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid bucket id") + } + + bucketInfo, found := k.GetBucketInfoById(ctx, id) + if found { + return &types.QueryHeadBucketResponse{ + BucketInfo: bucketInfo, + }, nil + } + return nil, types.ErrNoSuchBucket +} + +func (k Keeper) HeadObject(goCtx context.Context, req *types.QueryHeadObjectRequest) (*types.QueryHeadObjectResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + objectInfo, objectFound := k.GetObjectInfo(ctx, req.BucketName, req.ObjectName) + if !objectFound { + return nil, types.ErrNoSuchObject + } + + bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) + if !found { + return nil, types.ErrNoSuchBucket + } + var gvg *vgtypes.GlobalVirtualGroup + if objectInfo.ObjectStatus == types.OBJECT_STATUS_SEALED { + gvgFound := false + gvg, gvgFound = k.GetObjectGVG(ctx, bucketInfo.Id, objectInfo.LocalVirtualGroupId) + if !gvgFound { + return nil, types.ErrInvalidGlobalVirtualGroup.Wrapf("gvg not found. objectInfo: %s", objectInfo.String()) + } + } + return &types.QueryHeadObjectResponse{ + ObjectInfo: objectInfo, + GlobalVirtualGroup: gvg, + }, nil +} + +func (k Keeper) HeadObjectById(goCtx context.Context, req *types.QueryHeadObjectByIdRequest) (*types.QueryHeadObjectResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + id, err := math.ParseUint(req.ObjectId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid object id") + } + + objectInfo, found := k.GetObjectInfoById(ctx, id) + if !found { + return nil, types.ErrNoSuchObject + } + + bucketInfo, found := k.GetBucketInfo(ctx, objectInfo.BucketName) + if !found { + return nil, types.ErrNoSuchBucket + } + var gvg *vgtypes.GlobalVirtualGroup + if objectInfo.ObjectStatus == types.OBJECT_STATUS_SEALED { + gvgFound := false + gvg, gvgFound = k.GetObjectGVG(ctx, bucketInfo.Id, objectInfo.LocalVirtualGroupId) + if !gvgFound { + return nil, types.ErrInvalidGlobalVirtualGroup.Wrapf("gvg not found. objectInfo: %s", objectInfo.String()) + } + } + return &types.QueryHeadObjectResponse{ + ObjectInfo: objectInfo, + GlobalVirtualGroup: gvg, + }, nil +} + +func (k Keeper) ListBuckets(goCtx context.Context, req *types.QueryListBucketsRequest) (*types.QueryListBucketsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { + return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + var bucketInfos []*types.BucketInfo + store := ctx.KVStore(k.storeKey) + bucketStore := prefix.NewStore(store, types.BucketByIDPrefix) + + pageRes, err := query.Paginate(bucketStore, req.Pagination, func(key, value []byte) error { + var bucketInfo types.BucketInfo + k.cdc.MustUnmarshal(value, &bucketInfo) + bucketInfos = append(bucketInfos, &bucketInfo) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryListBucketsResponse{BucketInfos: bucketInfos, Pagination: pageRes}, nil +} + +func (k Keeper) ListObjects(goCtx context.Context, req *types.QueryListObjectsRequest) (*types.QueryListObjectsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { + return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + var objectInfos []*types.ObjectInfo + store := ctx.KVStore(k.storeKey) + objectPrefixStore := prefix.NewStore(store, types.GetObjectKeyOnlyBucketPrefix(req.BucketName)) + + pageRes, err := query.Paginate(objectPrefixStore, req.Pagination, func(key, value []byte) error { + objectInfo, found := k.GetObjectInfoById(ctx, k.objectSeq.DecodeSequence(value)) + if found { + objectInfos = append(objectInfos, objectInfo) + } + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + return &types.QueryListObjectsResponse{ObjectInfos: objectInfos, Pagination: pageRes}, nil +} + +func (k Keeper) ListObjectsByBucketId(goCtx context.Context, req *types.QueryListObjectsByBucketIdRequest) (*types.QueryListObjectsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { + return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + var objectInfos []*types.ObjectInfo + store := ctx.KVStore(k.storeKey) + id, err := math.ParseUint(req.BucketId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid bucket id") + } + bucketInfo, found := k.GetBucketInfoById(ctx, id) + if !found { + return nil, types.ErrNoSuchBucket + } + objectPrefixStore := prefix.NewStore(store, types.GetObjectKeyOnlyBucketPrefix(bucketInfo.BucketName)) + + pageRes, err := query.Paginate(objectPrefixStore, req.Pagination, func(key, value []byte) error { + u256Seq := sequence.Sequence[math.Uint]{} + objectInfo, found := k.GetObjectInfoById(ctx, u256Seq.DecodeSequence(value)) + if found { + objectInfos = append(objectInfos, objectInfo) + } + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + return &types.QueryListObjectsResponse{ObjectInfos: objectInfos, Pagination: pageRes}, nil +} + +func (k Keeper) HeadBucketNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryBucketNFTResponse, error) { + id, err := validateAndGetId(req) + if err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) + bucketInfo, found := k.GetBucketInfoById(ctx, id) + if !found { + return nil, types.ErrNoSuchBucket + } + return &types.QueryBucketNFTResponse{ + MetaData: bucketInfo.ToNFTMetadata(), + }, nil +} + +func (k Keeper) HeadObjectNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryObjectNFTResponse, error) { + id, err := validateAndGetId(req) + if err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) + objectInfo, found := k.GetObjectInfoById(ctx, id) + if !found { + return nil, types.ErrNoSuchObject + } + return &types.QueryObjectNFTResponse{ + MetaData: objectInfo.ToNFTMetadata(), + }, nil +} + +func (k Keeper) HeadGroupNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryGroupNFTResponse, error) { + id, err := validateAndGetId(req) + if err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) + groupInfo, found := k.GetGroupInfoById(ctx, id) + if !found { + return nil, types.ErrNoSuchObject + } + return &types.QueryGroupNFTResponse{ + MetaData: groupInfo.ToNFTMetadata(), + }, nil +} + func (k Keeper) QueryLockFee(c context.Context, req *types.QueryLockFeeRequest) (*types.QueryLockFeeResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -61,7 +304,7 @@ func (k Keeper) QueryLockFee(c context.Context, req *types.QueryLockFeeRequest) sp, found := k.spKeeper.GetStorageProviderByOperatorAddr(ctx, primaryAcc) if !found { - return nil, types2.ErrStorageProviderNotFound + return nil, sptypes.ErrStorageProviderNotFound } amount, err := k.GetObjectLockFee(ctx, sp.GetId(), createAt, req.PayloadSize) @@ -93,6 +336,7 @@ func (k Keeper) QueryIsPriceChanged(c context.Context, req *types.QueryIsPriceCh if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } + ctx := sdk.UnwrapSDKContext(c) bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) if !found { @@ -118,3 +362,267 @@ func (k Keeper) QueryIsPriceChanged(c context.Context, req *types.QueryIsPriceCh NewValidatorTaxRate: newTaxRate, }, nil } + +func validateAndGetId(req *types.QueryNFTRequest) (math.Uint, error) { + if req == nil { + return math.ZeroUint(), status.Error(codes.InvalidArgument, "invalid request") + } + id, err := math.ParseUint(req.TokenId) + if err != nil { + return math.ZeroUint(), status.Error(codes.InvalidArgument, "invalid token id") + } + return id, nil +} + +func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPolicyForAccountRequest) (*types. + QueryPolicyForAccountResponse, + error, +) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + principalAcc, err := sdk.AccAddressFromHexUnsafe(req.PrincipalAddress) + if err != nil { + return nil, err + } + var grn gnfd.GRN + err = grn.ParseFromString(req.Resource, false) + if err != nil { + return nil, err + } + + policy, err := k.GetPolicy(ctx, &grn, permtypes.NewPrincipalWithAccount(principalAcc)) + if err != nil { + return nil, err + } + + return &types.QueryPolicyForAccountResponse{Policy: policy}, nil +} + +func (k Keeper) QueryPolicyForGroup(goCtx context.Context, req *types.QueryPolicyForGroupRequest) (*types. + QueryPolicyForGroupResponse, error, +) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + id, err := math.ParseUint(req.PrincipalGroupId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid group id") + } + + var grn gnfd.GRN + err = grn.ParseFromString(req.Resource, false) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to parse GRN %s: %v", req.Resource, err) + } + + policy, err := k.GetPolicy( + ctx, &grn, permtypes.NewPrincipalWithGroupId(id), + ) + if err != nil { + return nil, err + } + return &types.QueryPolicyForGroupResponse{Policy: policy}, nil +} + +func (k Keeper) VerifyPermission(goCtx context.Context, req *types.QueryVerifyPermissionRequest) (*types.QueryVerifyPermissionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + operator, err := sdk.AccAddressFromHexUnsafe(req.Operator) + if err != nil && err != sdk.ErrEmptyHexAddress { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid operator address (%s)", err) + } + + if req.BucketName == "" { + return nil, errorsmod.Wrapf(errors.ErrInvalidParameter, "No bucket specified") + } + + bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) + if !found { + return nil, types.ErrNoSuchBucket + } + + var effect permtypes.Effect + if req.ObjectName == "" { + effect = k.VerifyBucketPermission(ctx, bucketInfo, operator, req.ActionType, nil) + } else { + objectInfo, found := k.GetObjectInfo(ctx, req.BucketName, req.ObjectName) + if !found { + return nil, types.ErrNoSuchObject + } + effect = k.VerifyObjectPermission(ctx, bucketInfo, objectInfo, operator, req.ActionType) + } + + return &types.QueryVerifyPermissionResponse{ + Effect: effect, + }, nil +} + +func (k Keeper) HeadGroup(goCtx context.Context, req *types.QueryHeadGroupRequest) (*types.QueryHeadGroupResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) + if err != nil { + return nil, err + } + groupInfo, found := k.GetGroupInfo(ctx, owner, req.GroupName) + if !found { + return nil, types.ErrNoSuchGroup + } + return &types.QueryHeadGroupResponse{GroupInfo: groupInfo}, nil +} + +func (k Keeper) ListGroup(goCtx context.Context, req *types.QueryListGroupRequest) (*types.QueryListGroupResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { + return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) + if err != nil { + return nil, err + } + + var groupInfos []*types.GroupInfo + store := ctx.KVStore(k.storeKey) + groupStore := prefix.NewStore(store, types.GetGroupKeyOnlyOwnerPrefix(owner)) + + pageRes, err := query.Paginate(groupStore, req.Pagination, func(key, value []byte) error { + groupInfo, found := k.GetGroupInfoById(ctx, k.groupSeq.DecodeSequence(value)) + if found { + groupInfos = append(groupInfos, groupInfo) + } + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryListGroupResponse{GroupInfos: groupInfos, Pagination: pageRes}, nil +} + +func (k Keeper) HeadGroupMember(goCtx context.Context, req *types.QueryHeadGroupMemberRequest) (*types.QueryHeadGroupMemberResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + member, err := sdk.AccAddressFromHexUnsafe(req.Member) + if err != nil { + return nil, err + } + owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) + if err != nil { + return nil, err + } + groupInfo, found := k.GetGroupInfo(ctx, owner, req.GroupName) + if !found { + return nil, types.ErrNoSuchGroup + } + groupMember, found := k.permKeeper.GetGroupMember(ctx, groupInfo.Id, member) + if !found { + return nil, types.ErrNoSuchGroupMember + } + return &types.QueryHeadGroupMemberResponse{GroupMember: groupMember}, nil +} + +func (k Keeper) QueryPolicyById(goCtx context.Context, req *types.QueryPolicyByIdRequest) (*types. + QueryPolicyByIdResponse, error, +) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + policyId, err := math.ParseUint(req.PolicyId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid policy id") + } + + policy, found := k.permKeeper.GetPolicyByID(ctx, policyId) + if !found { + return nil, types.ErrNoSuchPolicy + } + return &types.QueryPolicyByIdResponse{Policy: policy}, nil +} + +func (k Keeper) QueryGroupMembersExist(goCtx context.Context, req *types.QueryGroupMembersExistRequest) (*types.QueryGroupMembersExistResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + id, err := math.ParseUint(req.GroupId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid group id") + } + + exists := make(map[string]bool) + for _, member := range req.Members { + addr, err := sdk.AccAddressFromHexUnsafe(member) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid member address") + } + _, found := k.permKeeper.GetGroupMember(ctx, id, addr) + exists[member] = found + } + return &types.QueryGroupMembersExistResponse{Exists: exists}, nil +} + +func (k Keeper) QueryGroupsExist(goCtx context.Context, req *types.QueryGroupsExistRequest) (*types.QueryGroupsExistResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid owner address") + } + + exists := make(map[string]bool) + for _, groupName := range req.GroupNames { + _, found := k.GetGroupInfo(ctx, owner, groupName) + exists[groupName] = found + } + return &types.QueryGroupsExistResponse{Exists: exists}, nil +} + +func (k Keeper) QueryGroupsExistById(goCtx context.Context, req *types.QueryGroupsExistByIdRequest) (*types.QueryGroupsExistResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + exists := make(map[string]bool) + for _, groupId := range req.GroupIds { + id, err := math.ParseUint(groupId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid group id") + } + _, found := k.GetGroupInfoById(ctx, id) + exists[groupId] = found + } + return &types.QueryGroupsExistResponse{Exists: exists}, nil +} diff --git a/x/storage/keeper/grpc_query_test.go b/x/storage/keeper/grpc_query_test.go index 05c911219..79b99b8d2 100644 --- a/x/storage/keeper/grpc_query_test.go +++ b/x/storage/keeper/grpc_query_test.go @@ -1,6 +1,9 @@ package keeper_test import ( + "context" + "math/rand" + "strconv" "testing" "time" @@ -12,6 +15,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/bnb-chain/greenfield/testutil/sample" @@ -42,50 +46,118 @@ func makeKeeper(t *testing.T) (*keeper.Keeper, sdk.Context) { return k, testCtx.Ctx } -func TestParamsQuery(t *testing.T) { - k, ctx := makeKeeper(t) - params := types.DefaultParams() - err := k.SetParams(ctx, params) - require.NoError(t, err) - - response, err := k.Params(ctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +func (s *TestSuite) TestQueryParams() { + res, err := s.queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + s.Require().NoError(err) + s.Require().Equal(s.storageKeeper.GetParams(s.ctx), res.GetParams()) } -func TestVersionedParamsQuery(t *testing.T) { - k, ctx := makeKeeper(t) +func (s *TestSuite) TestQueryVersionedParams() { params := types.DefaultParams() params.VersionedParams.MaxSegmentSize = 1 - blockTimeT1 := ctx.BlockTime().Unix() + blockTimeT1 := s.ctx.BlockTime().Unix() paramsT1 := params - err := k.SetParams(ctx, params) - require.NoError(t, err) + err := s.storageKeeper.SetParams(s.ctx, params) + s.Require().NoError(err) - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(1 * time.Hour)) - blockTimeT2 := ctx.BlockTime().Unix() + s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime().Add(1 * time.Hour)) + blockTimeT2 := s.ctx.BlockTime().Unix() params.VersionedParams.MaxSegmentSize = 2 paramsT2 := params - err = k.SetParams(ctx, params) - require.NoError(t, err) + err = s.storageKeeper.SetParams(s.ctx, params) + s.Require().NoError(err) - responseT1, err := k.QueryParamsByTimestamp(ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT1}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsByTimestampResponse{Params: paramsT1}, responseT1) + responseT1, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT1}) + s.Require().NoError(err) + s.Require().Equal(&types.QueryParamsByTimestampResponse{Params: paramsT1}, responseT1) getParams := responseT1.GetParams() - require.EqualValues(t, getParams.GetMaxSegmentSize(), 1) + s.Require().Equal(getParams.GetMaxSegmentSize(), uint64(1)) - responseT2, err := k.QueryParamsByTimestamp(ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT2}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsByTimestampResponse{Params: paramsT2}, responseT2) + responseT2, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT2}) + s.Require().NoError(err) + s.Require().Equal(&types.QueryParamsByTimestampResponse{Params: paramsT2}, responseT2) p := responseT2.GetParams() - require.EqualValues(t, p.GetMaxSegmentSize(), 2) + s.Require().Equal(p.GetMaxSegmentSize(), uint64(2)) - responseT3, err := k.QueryParamsByTimestamp(ctx, &types.QueryParamsByTimestampRequest{Timestamp: 0}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsByTimestampResponse{Params: paramsT2}, responseT3) + responseT3, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: 0}) + s.Require().NoError(err) + s.Require().Equal(&types.QueryParamsByTimestampResponse{Params: paramsT2}, responseT3) p = responseT2.GetParams() - require.EqualValues(t, p.GetMaxSegmentSize(), 2) + s.Require().Equal(p.GetMaxSegmentSize(), uint64(2)) +} + +func (s *TestSuite) TestQueryGroupMembersExist() { + groupId := rand.Intn(1000) + members := make([]string, 3) + exists := make(map[string]bool) + for i := 0; i < 3; i++ { + members[i] = sample.RandAccAddressHex() + exist := rand.Intn(2) + if exist == 0 { + exists[members[i]] = false + s.permissionKeeper.EXPECT().GetGroupMember(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, false).Times(1) + } else { + exists[members[i]] = true + s.permissionKeeper.EXPECT().GetGroupMember(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, true).Times(1) + } + } + + req := &types.QueryGroupMembersExistRequest{ + GroupId: strconv.Itoa(groupId), + Members: members, + } + res, err := s.queryClient.QueryGroupMembersExist(context.Background(), req) + s.Require().NoError(err) + s.Require().Equal(exists, res.GetExists()) +} + +func (s *TestSuite) TestQueryGroupsExist() { + groupOwner := sample.RandAccAddress() + groupNames := make([]string, 3) + exists := make(map[string]bool) + for i := 0; i < 3; i++ { + groupNames[i] = string(sample.RandStr(10)) + exist := rand.Intn(2) + if exist == 0 { + exists[groupNames[i]] = false + } else { + exists[groupNames[i]] = true + _, err := s.storageKeeper.CreateGroup(s.ctx, groupOwner, groupNames[i], types.CreateGroupOptions{}) + s.Require().NoError(err) + } + } + + req := &types.QueryGroupsExistRequest{ + GroupOwner: groupOwner.String(), + GroupNames: groupNames, + } + res, err := s.queryClient.QueryGroupsExist(context.Background(), req) + s.Require().NoError(err) + s.Require().Equal(exists, res.GetExists()) +} + +func (s *TestSuite) TestQueryGroupsExistById() { + groupIds := make([]string, 3) + exists := make(map[string]bool) + for i := 0; i < 3; i++ { + groupIds[i] = strconv.Itoa(rand.Intn(1000) + 10) // make sure there's no conflict + exist := rand.Intn(2) + if exist == 0 { + exists[groupIds[i]] = false + } else { + id, err := s.storageKeeper.CreateGroup(s.ctx, sample.RandAccAddress(), string(sample.RandStr(10)), types.CreateGroupOptions{}) + s.Require().NoError(err) + groupIds[i] = id.String() + exists[groupIds[i]] = true + } + } + + req := &types.QueryGroupsExistByIdRequest{ + GroupIds: groupIds, + } + res, err := s.queryClient.QueryGroupsExistById(context.Background(), req) + s.Require().NoError(err) + s.Require().Equal(exists, res.GetExists()) } func TestHeadBucket(t *testing.T) { diff --git a/x/storage/keeper/payment_test.go b/x/storage/keeper/payment_test.go index a13db11d6..b58c2a8f7 100644 --- a/x/storage/keeper/payment_test.go +++ b/x/storage/keeper/payment_test.go @@ -33,7 +33,7 @@ type TestSuite struct { accountKeeper *types.MockAccountKeeper spKeeper *types.MockSpKeeper permissionKeeper *types.MockPermissionKeeper - crosschainKeeper *types.MockCrossChainKeeper + crossChainKeeper *types.MockCrossChainKeeper paymentKeeper *types.MockPaymentKeeper virtualGroupKeeper *types.MockVirtualGroupKeeper @@ -60,7 +60,7 @@ func (s *TestSuite) SetupTest() { accountKeeper := types.NewMockAccountKeeper(ctrl) spKeeper := types.NewMockSpKeeper(ctrl) permissionKeeper := types.NewMockPermissionKeeper(ctrl) - crosschainKeeper := types.NewMockCrossChainKeeper(ctrl) + crossChainKeeper := types.NewMockCrossChainKeeper(ctrl) paymentKeeper := types.NewMockPaymentKeeper(ctrl) virtualGroupKeeper := types.NewMockVirtualGroupKeeper(ctrl) @@ -72,7 +72,7 @@ func (s *TestSuite) SetupTest() { spKeeper, paymentKeeper, permissionKeeper, - crosschainKeeper, + crossChainKeeper, virtualGroupKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -81,7 +81,7 @@ func (s *TestSuite) SetupTest() { s.accountKeeper = accountKeeper s.spKeeper = spKeeper s.permissionKeeper = permissionKeeper - s.crosschainKeeper = crosschainKeeper + s.crossChainKeeper = crossChainKeeper s.paymentKeeper = paymentKeeper s.virtualGroupKeeper = virtualGroupKeeper @@ -138,7 +138,8 @@ func (s *TestSuite) TestGetBucketReadBill() { Status: sptypes.STATUS_IN_SERVICE, Id: 100, OperatorAddress: sample.RandAccAddress().String(), - FundingAddress: sample.RandAccAddress().String()} + FundingAddress: sample.RandAccAddress().String(), + } s.spKeeper.EXPECT().GetStorageProvider(gomock.Any(), gomock.Eq(primarySp.Id)). Return(primarySp, true).AnyTimes() @@ -199,7 +200,8 @@ func (s *TestSuite) TestGetBucketReadStoreBill() { Status: sptypes.STATUS_IN_SERVICE, Id: 100, OperatorAddress: sample.RandAccAddress().String(), - FundingAddress: sample.RandAccAddress().String()} + FundingAddress: sample.RandAccAddress().String(), + } s.spKeeper.EXPECT().GetStorageProvider(gomock.Any(), gomock.Eq(primarySp.Id)). Return(primarySp, true).AnyTimes() diff --git a/x/storage/keeper/query.go b/x/storage/keeper/query.go deleted file mode 100644 index 185b60908..000000000 --- a/x/storage/keeper/query.go +++ /dev/null @@ -1,460 +0,0 @@ -package keeper - -import ( - "context" - - "cosmossdk.io/errors" - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/bnb-chain/greenfield/internal/sequence" - gnfd "github.com/bnb-chain/greenfield/types" - errors2 "github.com/bnb-chain/greenfield/types/errors" - permtypes "github.com/bnb-chain/greenfield/x/permission/types" - "github.com/bnb-chain/greenfield/x/storage/types" - types2 "github.com/bnb-chain/greenfield/x/virtualgroup/types" -) - -func (k Keeper) HeadBucket(goCtx context.Context, req *types.QueryHeadBucketRequest) (*types.QueryHeadBucketResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) - if found { - return &types.QueryHeadBucketResponse{ - BucketInfo: bucketInfo, - }, nil - - } - return nil, types.ErrNoSuchBucket -} - -func (k Keeper) HeadBucketById(goCtx context.Context, req *types.QueryHeadBucketByIdRequest) (*types.QueryHeadBucketResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - id, err := math.ParseUint(req.BucketId) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid bucket id") - } - - bucketInfo, found := k.GetBucketInfoById(ctx, id) - if found { - return &types.QueryHeadBucketResponse{ - BucketInfo: bucketInfo, - }, nil - - } - return nil, types.ErrNoSuchBucket -} - -func (k Keeper) HeadObject(goCtx context.Context, req *types.QueryHeadObjectRequest) (*types.QueryHeadObjectResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - objectInfo, objectFound := k.GetObjectInfo(ctx, req.BucketName, req.ObjectName) - if !objectFound { - return nil, types.ErrNoSuchObject - } - - bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) - if !found { - return nil, types.ErrNoSuchBucket - } - var gvg *types2.GlobalVirtualGroup - if objectInfo.ObjectStatus == types.OBJECT_STATUS_SEALED { - gvgFound := false - gvg, gvgFound = k.GetObjectGVG(ctx, bucketInfo.Id, objectInfo.LocalVirtualGroupId) - if !gvgFound { - return nil, types.ErrInvalidGlobalVirtualGroup.Wrapf("gvg not found. objectInfo: %s", objectInfo.String()) - } - } - return &types.QueryHeadObjectResponse{ - ObjectInfo: objectInfo, - GlobalVirtualGroup: gvg, - }, nil -} - -func (k Keeper) HeadObjectById(goCtx context.Context, req *types.QueryHeadObjectByIdRequest) (*types.QueryHeadObjectResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - id, err := math.ParseUint(req.ObjectId) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid object id") - } - - objectInfo, found := k.GetObjectInfoById(ctx, id) - if !found { - return nil, types.ErrNoSuchObject - } - - bucketInfo, found := k.GetBucketInfo(ctx, objectInfo.BucketName) - if !found { - return nil, types.ErrNoSuchBucket - } - var gvg *types2.GlobalVirtualGroup - if objectInfo.ObjectStatus == types.OBJECT_STATUS_SEALED { - gvgFound := false - gvg, gvgFound = k.GetObjectGVG(ctx, bucketInfo.Id, objectInfo.LocalVirtualGroupId) - if !gvgFound { - return nil, types.ErrInvalidGlobalVirtualGroup.Wrapf("gvg not found. objectInfo: %s", objectInfo.String()) - } - } - return &types.QueryHeadObjectResponse{ - ObjectInfo: objectInfo, - GlobalVirtualGroup: gvg, - }, nil - -} - -func (k Keeper) ListBuckets(goCtx context.Context, req *types.QueryListBucketsRequest) (*types.QueryListBucketsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { - return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - var bucketInfos []*types.BucketInfo - store := ctx.KVStore(k.storeKey) - bucketStore := prefix.NewStore(store, types.BucketByIDPrefix) - - pageRes, err := query.Paginate(bucketStore, req.Pagination, func(key []byte, value []byte) error { - var bucketInfo types.BucketInfo - k.cdc.MustUnmarshal(value, &bucketInfo) - bucketInfos = append(bucketInfos, &bucketInfo) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryListBucketsResponse{BucketInfos: bucketInfos, Pagination: pageRes}, nil -} - -func (k Keeper) ListObjects(goCtx context.Context, req *types.QueryListObjectsRequest) (*types.QueryListObjectsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { - return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) - } - ctx := sdk.UnwrapSDKContext(goCtx) - - var objectInfos []*types.ObjectInfo - store := ctx.KVStore(k.storeKey) - objectPrefixStore := prefix.NewStore(store, types.GetObjectKeyOnlyBucketPrefix(req.BucketName)) - - pageRes, err := query.Paginate(objectPrefixStore, req.Pagination, func(key []byte, value []byte) error { - objectInfo, found := k.GetObjectInfoById(ctx, k.objectSeq.DecodeSequence(value)) - if found { - objectInfos = append(objectInfos, objectInfo) - } - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - return &types.QueryListObjectsResponse{ObjectInfos: objectInfos, Pagination: pageRes}, nil -} - -func (k Keeper) ListObjectsByBucketId(goCtx context.Context, req *types.QueryListObjectsByBucketIdRequest) (*types.QueryListObjectsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { - return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - var objectInfos []*types.ObjectInfo - store := ctx.KVStore(k.storeKey) - id, err := math.ParseUint(req.BucketId) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid bucket id") - } - bucketInfo, found := k.GetBucketInfoById(ctx, id) - if !found { - return nil, types.ErrNoSuchBucket - } - objectPrefixStore := prefix.NewStore(store, types.GetObjectKeyOnlyBucketPrefix(bucketInfo.BucketName)) - - pageRes, err := query.Paginate(objectPrefixStore, req.Pagination, func(key []byte, value []byte) error { - u256Seq := sequence.Sequence[math.Uint]{} - objectInfo, found := k.GetObjectInfoById(ctx, u256Seq.DecodeSequence(value)) - if found { - objectInfos = append(objectInfos, objectInfo) - } - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - return &types.QueryListObjectsResponse{ObjectInfos: objectInfos, Pagination: pageRes}, nil -} - -func (k Keeper) HeadBucketNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryBucketNFTResponse, error) { - id, err := validateAndGetId(req) - if err != nil { - return nil, err - } - ctx := sdk.UnwrapSDKContext(goCtx) - bucketInfo, found := k.GetBucketInfoById(ctx, id) - if !found { - return nil, types.ErrNoSuchBucket - } - return &types.QueryBucketNFTResponse{ - MetaData: bucketInfo.ToNFTMetadata(), - }, nil -} - -func (k Keeper) HeadObjectNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryObjectNFTResponse, error) { - id, err := validateAndGetId(req) - if err != nil { - return nil, err - } - ctx := sdk.UnwrapSDKContext(goCtx) - objectInfo, found := k.GetObjectInfoById(ctx, id) - if !found { - return nil, types.ErrNoSuchObject - } - return &types.QueryObjectNFTResponse{ - MetaData: objectInfo.ToNFTMetadata(), - }, nil -} - -func (k Keeper) HeadGroupNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryGroupNFTResponse, error) { - id, err := validateAndGetId(req) - if err != nil { - return nil, err - } - ctx := sdk.UnwrapSDKContext(goCtx) - groupInfo, found := k.GetGroupInfoById(ctx, id) - if !found { - return nil, types.ErrNoSuchGroup - } - return &types.QueryGroupNFTResponse{ - MetaData: groupInfo.ToNFTMetadata(), - }, nil -} - -func validateAndGetId(req *types.QueryNFTRequest) (math.Uint, error) { - if req == nil { - return math.ZeroUint(), status.Error(codes.InvalidArgument, "invalid request") - } - id, err := math.ParseUint(req.TokenId) - if err != nil { - return math.ZeroUint(), status.Error(codes.InvalidArgument, "invalid token id") - } - return id, nil -} - -func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPolicyForAccountRequest) (*types. - QueryPolicyForAccountResponse, - error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - principalAcc, err := sdk.AccAddressFromHexUnsafe(req.PrincipalAddress) - if err != nil { - return nil, err - } - var grn gnfd.GRN - err = grn.ParseFromString(req.Resource, false) - if err != nil { - return nil, err - } - - policy, err := k.GetPolicy(ctx, &grn, permtypes.NewPrincipalWithAccount(principalAcc)) - if err != nil { - return nil, err - } - - return &types.QueryPolicyForAccountResponse{Policy: policy}, nil -} - -func (k Keeper) QueryPolicyForGroup(goCtx context.Context, req *types.QueryPolicyForGroupRequest) (*types. - QueryPolicyForGroupResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - id, err := math.ParseUint(req.PrincipalGroupId) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid group id") - } - - var grn gnfd.GRN - err = grn.ParseFromString(req.Resource, false) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "failed to parse GRN %s: %v", req.Resource, err) - } - - policy, err := k.GetPolicy( - ctx, &grn, permtypes.NewPrincipalWithGroupId(id), - ) - if err != nil { - return nil, err - } - return &types.QueryPolicyForGroupResponse{Policy: policy}, nil -} - -func (k Keeper) VerifyPermission(goCtx context.Context, req *types.QueryVerifyPermissionRequest) (*types.QueryVerifyPermissionResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - operator, err := sdk.AccAddressFromHexUnsafe(req.Operator) - if err != nil && err != sdk.ErrEmptyHexAddress { - return nil, errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid operator address (%s)", err) - } - - if req.BucketName == "" { - return nil, errors.Wrapf(errors2.ErrInvalidParameter, "No bucket specified") - } - - bucketInfo, found := k.GetBucketInfo(ctx, req.BucketName) - if !found { - return nil, types.ErrNoSuchBucket - } - - var effect permtypes.Effect - if req.ObjectName == "" { - effect = k.VerifyBucketPermission(ctx, bucketInfo, operator, req.ActionType, nil) - } else { - objectInfo, found := k.GetObjectInfo(ctx, req.BucketName, req.ObjectName) - if !found { - return nil, types.ErrNoSuchObject - } - effect = k.VerifyObjectPermission(ctx, bucketInfo, objectInfo, operator, req.ActionType) - } - - return &types.QueryVerifyPermissionResponse{ - Effect: effect, - }, nil -} - -func (k Keeper) HeadGroup(goCtx context.Context, req *types.QueryHeadGroupRequest) (*types.QueryHeadGroupResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) - if err != nil { - return nil, err - } - groupInfo, found := k.GetGroupInfo(ctx, owner, req.GroupName) - if !found { - return nil, types.ErrNoSuchGroup - } - return &types.QueryHeadGroupResponse{GroupInfo: groupInfo}, nil -} - -func (k Keeper) ListGroup(goCtx context.Context, req *types.QueryListGroupRequest) (*types.QueryListGroupResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - if req.Pagination != nil && req.Pagination.Limit > types.MaxPaginationLimit { - return nil, status.Errorf(codes.InvalidArgument, "exceed pagination limit %d", types.MaxPaginationLimit) - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) - if err != nil { - return nil, err - } - - var groupInfos []*types.GroupInfo - store := ctx.KVStore(k.storeKey) - groupStore := prefix.NewStore(store, types.GetGroupKeyOnlyOwnerPrefix(owner)) - - pageRes, err := query.Paginate(groupStore, req.Pagination, func(key []byte, value []byte) error { - groupInfo, found := k.GetGroupInfoById(ctx, k.groupSeq.DecodeSequence(value)) - if found { - groupInfos = append(groupInfos, groupInfo) - } - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryListGroupResponse{GroupInfos: groupInfos, Pagination: pageRes}, nil -} - -func (k Keeper) HeadGroupMember(goCtx context.Context, req *types.QueryHeadGroupMemberRequest) (*types.QueryHeadGroupMemberResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - member, err := sdk.AccAddressFromHexUnsafe(req.Member) - if err != nil { - return nil, err - } - owner, err := sdk.AccAddressFromHexUnsafe(req.GroupOwner) - if err != nil { - return nil, err - } - groupInfo, found := k.GetGroupInfo(ctx, owner, req.GroupName) - if !found { - return nil, types.ErrNoSuchGroup - } - groupMember, found := k.permKeeper.GetGroupMember(ctx, groupInfo.Id, member) - if !found { - return nil, types.ErrNoSuchGroupMember - } - return &types.QueryHeadGroupMemberResponse{GroupMember: groupMember}, nil -} - -func (k Keeper) QueryPolicyById(goCtx context.Context, req *types.QueryPolicyByIdRequest) (*types. - QueryPolicyByIdResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - policyId, err := math.ParseUint(req.PolicyId) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid policy id") - } - policy, found := k.permKeeper.GetPolicyByID(ctx, policyId) - if !found { - return nil, types.ErrNoSuchPolicy - } - return &types.QueryPolicyByIdResponse{Policy: policy}, nil -} diff --git a/x/storage/types/query.pb.go b/x/storage/types/query.pb.go index 8a84a7bcb..1c5f26ca7 100644 --- a/x/storage/types/query.pb.go +++ b/x/storage/types/query.pb.go @@ -1897,6 +1897,242 @@ func (m *QueryIsPriceChangedResponse) GetChanged() bool { return false } +type QueryGroupMembersExistRequest struct { + GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Members []string `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` +} + +func (m *QueryGroupMembersExistRequest) Reset() { *m = QueryGroupMembersExistRequest{} } +func (m *QueryGroupMembersExistRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGroupMembersExistRequest) ProtoMessage() {} +func (*QueryGroupMembersExistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b1b80b580af04cb0, []int{39} +} +func (m *QueryGroupMembersExistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupMembersExistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupMembersExistRequest.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 *QueryGroupMembersExistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupMembersExistRequest.Merge(m, src) +} +func (m *QueryGroupMembersExistRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupMembersExistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupMembersExistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupMembersExistRequest proto.InternalMessageInfo + +func (m *QueryGroupMembersExistRequest) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *QueryGroupMembersExistRequest) GetMembers() []string { + if m != nil { + return m.Members + } + return nil +} + +type QueryGroupMembersExistResponse struct { + Exists map[string]bool `protobuf:"bytes,1,rep,name=exists,proto3" json:"exists,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (m *QueryGroupMembersExistResponse) Reset() { *m = QueryGroupMembersExistResponse{} } +func (m *QueryGroupMembersExistResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGroupMembersExistResponse) ProtoMessage() {} +func (*QueryGroupMembersExistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b1b80b580af04cb0, []int{40} +} +func (m *QueryGroupMembersExistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupMembersExistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupMembersExistResponse.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 *QueryGroupMembersExistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupMembersExistResponse.Merge(m, src) +} +func (m *QueryGroupMembersExistResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupMembersExistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupMembersExistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupMembersExistResponse proto.InternalMessageInfo + +func (m *QueryGroupMembersExistResponse) GetExists() map[string]bool { + if m != nil { + return m.Exists + } + return nil +} + +type QueryGroupsExistRequest struct { + GroupOwner string `protobuf:"bytes,1,opt,name=group_owner,json=groupOwner,proto3" json:"group_owner,omitempty"` + GroupNames []string `protobuf:"bytes,2,rep,name=group_names,json=groupNames,proto3" json:"group_names,omitempty"` +} + +func (m *QueryGroupsExistRequest) Reset() { *m = QueryGroupsExistRequest{} } +func (m *QueryGroupsExistRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGroupsExistRequest) ProtoMessage() {} +func (*QueryGroupsExistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b1b80b580af04cb0, []int{41} +} +func (m *QueryGroupsExistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupsExistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupsExistRequest.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 *QueryGroupsExistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupsExistRequest.Merge(m, src) +} +func (m *QueryGroupsExistRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupsExistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupsExistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupsExistRequest proto.InternalMessageInfo + +func (m *QueryGroupsExistRequest) GetGroupOwner() string { + if m != nil { + return m.GroupOwner + } + return "" +} + +func (m *QueryGroupsExistRequest) GetGroupNames() []string { + if m != nil { + return m.GroupNames + } + return nil +} + +type QueryGroupsExistByIdRequest struct { + GroupIds []string `protobuf:"bytes,1,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` +} + +func (m *QueryGroupsExistByIdRequest) Reset() { *m = QueryGroupsExistByIdRequest{} } +func (m *QueryGroupsExistByIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGroupsExistByIdRequest) ProtoMessage() {} +func (*QueryGroupsExistByIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b1b80b580af04cb0, []int{42} +} +func (m *QueryGroupsExistByIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupsExistByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupsExistByIdRequest.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 *QueryGroupsExistByIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupsExistByIdRequest.Merge(m, src) +} +func (m *QueryGroupsExistByIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupsExistByIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupsExistByIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupsExistByIdRequest proto.InternalMessageInfo + +func (m *QueryGroupsExistByIdRequest) GetGroupIds() []string { + if m != nil { + return m.GroupIds + } + return nil +} + +type QueryGroupsExistResponse struct { + Exists map[string]bool `protobuf:"bytes,1,rep,name=exists,proto3" json:"exists,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (m *QueryGroupsExistResponse) Reset() { *m = QueryGroupsExistResponse{} } +func (m *QueryGroupsExistResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGroupsExistResponse) ProtoMessage() {} +func (*QueryGroupsExistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b1b80b580af04cb0, []int{43} +} +func (m *QueryGroupsExistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupsExistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupsExistResponse.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 *QueryGroupsExistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupsExistResponse.Merge(m, src) +} +func (m *QueryGroupsExistResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupsExistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupsExistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupsExistResponse proto.InternalMessageInfo + +func (m *QueryGroupsExistResponse) GetExists() map[string]bool { + if m != nil { + return m.Exists + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "greenfield.storage.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "greenfield.storage.QueryParamsResponse") @@ -1937,156 +2173,178 @@ func init() { proto.RegisterType((*QueryHeadBucketExtraResponse)(nil), "greenfield.storage.QueryHeadBucketExtraResponse") proto.RegisterType((*QueryIsPriceChangedRequest)(nil), "greenfield.storage.QueryIsPriceChangedRequest") proto.RegisterType((*QueryIsPriceChangedResponse)(nil), "greenfield.storage.QueryIsPriceChangedResponse") + proto.RegisterType((*QueryGroupMembersExistRequest)(nil), "greenfield.storage.QueryGroupMembersExistRequest") + proto.RegisterType((*QueryGroupMembersExistResponse)(nil), "greenfield.storage.QueryGroupMembersExistResponse") + proto.RegisterMapType((map[string]bool)(nil), "greenfield.storage.QueryGroupMembersExistResponse.ExistsEntry") + proto.RegisterType((*QueryGroupsExistRequest)(nil), "greenfield.storage.QueryGroupsExistRequest") + proto.RegisterType((*QueryGroupsExistByIdRequest)(nil), "greenfield.storage.QueryGroupsExistByIdRequest") + proto.RegisterType((*QueryGroupsExistResponse)(nil), "greenfield.storage.QueryGroupsExistResponse") + proto.RegisterMapType((map[string]bool)(nil), "greenfield.storage.QueryGroupsExistResponse.ExistsEntry") } func init() { proto.RegisterFile("greenfield/storage/query.proto", fileDescriptor_b1b80b580af04cb0) } var fileDescriptor_b1b80b580af04cb0 = []byte{ - // 2290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x5a, 0xdb, 0x6f, 0xdc, 0x58, - 0x19, 0xaf, 0x93, 0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, 0x43, 0x85, 0xc9, 0x37, 0x19, 0xce, 0x2a, 0xbe, 0x36, 0x70, 0x17, - 0xe6, 0xe0, 0xc4, 0xbf, 0x95, 0xd0, 0xa9, 0x14, 0x0f, 0x84, 0x95, 0xe2, 0xec, 0x24, 0xc8, 0xad, - 0xf2, 0xf5, 0xd1, 0x15, 0x00, 0xec, 0x12, 0x03, 0x7b, 0x05, 0x7f, 0xb5, 0x60, 0x3b, 0x02, 0x17, - 0xf6, 0x8f, 0x90, 0x03, 0x49, 0x72, 0x3c, 0x43, 0xce, 0xd8, 0x5c, 0xd2, 0xa9, 0xac, 0x8c, 0x2c, - 0x0f, 0x38, 0xef, 0x31, 0x9c, 0x5b, 0xf8, 0x6e, 0xc1, 0x06, 0x84, 0xd4, 0xe6, 0x6e, 0xbf, 0x90, - 0xc0, 0xea, 0x07, 0x47, 0xc9, 0xa9, 0x14, 0x3b, 0x34, 0xe4, 0x5e, 0x93, 0x61, 0x9e, 0x86, 0x5c, - 0x11, 0xb2, 0x74, 0xd3, 0xf0, 0x7e, 0x00, 0xe8, 0x70, 0x3b, 0x88, 0xe8, 0xac, 0x3e, 0xfe, 0x91, - 0x84, 0x66, 0x45, 0x3a, 0x07, 0x0f, 0xfe, 0xd4, 0x48, 0xf2, 0x51, 0xe5, 0xc5, 0x62, 0x41, 0x40, - 0xf6, 0x15, 0x86, 0xac, 0x82, 0xcf, 0xe7, 0x76, 0xaa, 0xad, 0xef, 0x6b, 0x0d, 0x4a, 0xf1, 0x5f, - 0xa0, 0x33, 0x05, 0x96, 0xa6, 0xa0, 0x33, 0xb3, 0x7c, 0x50, 0x41, 0x67, 0xe6, 0x10, 0x40, 0xf2, - 0x2d, 0x06, 0x6e, 0x15, 0xdf, 0x28, 0xba, 0xae, 0x32, 0xb2, 0x27, 0x75, 0x10, 0xff, 0x35, 0xec, - 0xd3, 0x24, 0x6f, 0x33, 0xa4, 0x4f, 0x73, 0x09, 0xa2, 0x21, 0x7d, 0x9a, 0x4f, 0x08, 0xc9, 0xdf, - 0x60, 0xa8, 0x6f, 0xe2, 0x95, 0x3c, 0xd4, 0xa6, 0xc7, 0xbf, 0xa0, 0x35, 0x20, 0x89, 0x92, 0xa0, - 0x37, 0x6a, 0x1f, 0xbd, 0xa8, 0x48, 0x1f, 0xbf, 0xa8, 0x48, 0xff, 0x7d, 0x51, 0x91, 0x7e, 0xf2, - 0xb2, 0x72, 0xec, 0xe3, 0x97, 0x95, 0x63, 0xff, 0x79, 0x59, 0x39, 0xf6, 0x58, 0x11, 0xbe, 0x76, - 0xeb, 0x56, 0x7d, 0x49, 0x7f, 0x42, 0x4c, 0x4b, 0xf4, 0xf0, 0x3c, 0xf9, 0x67, 0x27, 0xf5, 0x29, - 0xf6, 0x27, 0x25, 0x37, 0x3e, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x32, 0xdd, 0xcd, 0x59, 0xb0, 0x23, - 0x00, 0x00, + // 2543 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xdd, 0x6f, 0xdc, 0x58, + 0x15, 0xaf, 0x93, 0x6e, 0x9a, 0xdc, 0x84, 0xb6, 0xdc, 0xcd, 0x6e, 0xd3, 0x69, 0x9b, 0xb6, 0x5e, + 0x68, 0xbb, 0xdd, 0x66, 0xdc, 0xa6, 0x2d, 0x6a, 0xfa, 0x85, 0x92, 0x6d, 0x52, 0x46, 0xea, 0x47, + 0x70, 0xa3, 0x20, 0x2a, 0x21, 0xeb, 0x8e, 0x7d, 0x33, 0xf5, 0x66, 0xc6, 0x9e, 0xda, 0x9e, 0xa6, + 0xb3, 0xa3, 0x11, 0x62, 0x5f, 0xe0, 0x11, 0x81, 0x90, 0x56, 0x08, 0x24, 0x10, 0xe2, 0xf3, 0x05, + 0xc1, 0xee, 0x03, 0x3c, 0xf1, 0x02, 0xd2, 0x4a, 0x08, 0x69, 0xb5, 0xbc, 0xa0, 0x7d, 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b, + 0x31, 0xe1, 0x67, 0xe8, 0x5d, 0x7c, 0xa9, 0xc4, 0x4e, 0x96, 0x49, 0xae, 0x2c, 0xee, 0x46, 0x04, + 0x50, 0x56, 0x19, 0xca, 0x73, 0xf8, 0xcc, 0x60, 0x94, 0x5a, 0x2f, 0xa2, 0xa3, 0xfb, 0xf8, 0x27, + 0x0a, 0x42, 0xf1, 0x0c, 0x81, 0xcf, 0x0f, 0x34, 0x99, 0x21, 0x95, 0x2b, 0x6f, 0x0d, 0xb5, 0x17, + 0x70, 0x5d, 0x65, 0xb8, 0x34, 0xbc, 0x90, 0x87, 0xeb, 0x49, 0x78, 0x01, 0xf0, 0xb1, 0x41, 0xeb, + 0x49, 0x13, 0x45, 0x1f, 0xff, 0x46, 0x41, 0x07, 0x93, 0x9c, 0x34, 0xae, 0x0e, 0x61, 0x56, 0xaa, + 0xf1, 0xdd, 0xc1, 0x5c, 0x62, 0x30, 0x2f, 0xe3, 0x4b, 0x25, 0x30, 0x8d, 0x7a, 0x38, 0x35, 0x47, + 0x60, 0x6d, 0xab, 0x8f, 0xdf, 0x57, 0xd0, 0x17, 0x62, 0x8d, 0x0f, 0xd6, 0x36, 0xf0, 0x1b, 0x03, + 0x2d, 0xc7, 0xbc, 0x55, 0x65, 0x70, 0xc4, 0x33, 0x74, 0x95, 0xfa, 0x15, 0x86, 0xee, 0x22, 0xae, + 0x96, 0xa1, 0x73, 0xb6, 0x02, 0xad, 0x27, 0xe8, 0xb0, 0x3e, 0xfe, 0x1d, 0x24, 0x99, 0x73, 0x4d, + 0x25, 0x49, 0x4e, 0xf0, 0xec, 0x25, 0xd1, 0x4b, 0x72, 0xdf, 0xea, 0xdb, 0x0c, 0xdf, 0x2d, 0x7c, + 0x63, 0x20, 0x3e, 0xce, 0x88, 0x24, 0x93, 0xac, 0xf5, 0x24, 0xea, 0x24, 0x4e, 0x79, 0xcc, 0xc9, + 0x97, 0xa4, 0x3c, 0x43, 0xde, 0xef, 0x0e, 0x74, 0x79,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, 0xa3, 0xa0, 0xd6, 0xf3, 0x79, 0x91, + 0x5d, 0xa2, 0x2f, 0xac, 0x18, 0x19, 0xbd, 0x68, 0x12, 0x11, 0xe7, 0xd2, 0x5f, 0xa9, 0x7d, 0xf4, + 0x62, 0x5e, 0xf9, 0xf8, 0xc5, 0xbc, 0xf2, 0xef, 0x17, 0xf3, 0xca, 0xf7, 0x5f, 0xce, 0xef, 0xfb, + 0xf8, 0xe5, 0xfc, 0xbe, 0x7f, 0xbd, 0x9c, 0xdf, 0xf7, 0x58, 0x93, 0x28, 0xba, 0xba, 0x53, 0x5f, + 0x30, 0x9f, 0x10, 0xdb, 0x91, 0x2d, 0x3c, 0x4f, 0xfe, 0x5f, 0xb9, 0xfa, 0x04, 0xfb, 0x7f, 0x70, + 0x97, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x53, 0xc7, 0xdb, 0xaa, 0x65, 0x28, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2145,6 +2403,12 @@ type QueryClient interface { HeadBucketExtra(ctx context.Context, in *QueryHeadBucketExtraRequest, opts ...grpc.CallOption) (*QueryHeadBucketExtraResponse, error) // Queries whether read and storage prices changed for the bucket. QueryIsPriceChanged(ctx context.Context, in *QueryIsPriceChangedRequest, opts ...grpc.CallOption) (*QueryIsPriceChangedResponse, error) + // Queries whether some members are in the group. + QueryGroupMembersExist(ctx context.Context, in *QueryGroupMembersExistRequest, opts ...grpc.CallOption) (*QueryGroupMembersExistResponse, error) + // Queries whether some groups are exist. + QueryGroupsExist(ctx context.Context, in *QueryGroupsExistRequest, opts ...grpc.CallOption) (*QueryGroupsExistResponse, error) + // Queries whether some groups are exist by id. + QueryGroupsExistById(ctx context.Context, in *QueryGroupsExistByIdRequest, opts ...grpc.CallOption) (*QueryGroupsExistResponse, error) } type queryClient struct { @@ -2353,6 +2617,33 @@ func (c *queryClient) QueryIsPriceChanged(ctx context.Context, in *QueryIsPriceC return out, nil } +func (c *queryClient) QueryGroupMembersExist(ctx context.Context, in *QueryGroupMembersExistRequest, opts ...grpc.CallOption) (*QueryGroupMembersExistResponse, error) { + out := new(QueryGroupMembersExistResponse) + err := c.cc.Invoke(ctx, "/greenfield.storage.Query/QueryGroupMembersExist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryGroupsExist(ctx context.Context, in *QueryGroupsExistRequest, opts ...grpc.CallOption) (*QueryGroupsExistResponse, error) { + out := new(QueryGroupsExistResponse) + err := c.cc.Invoke(ctx, "/greenfield.storage.Query/QueryGroupsExist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryGroupsExistById(ctx context.Context, in *QueryGroupsExistByIdRequest, opts ...grpc.CallOption) (*QueryGroupsExistResponse, error) { + out := new(QueryGroupsExistResponse) + err := c.cc.Invoke(ctx, "/greenfield.storage.Query/QueryGroupsExistById", 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. @@ -2399,6 +2690,12 @@ type QueryServer interface { HeadBucketExtra(context.Context, *QueryHeadBucketExtraRequest) (*QueryHeadBucketExtraResponse, error) // Queries whether read and storage prices changed for the bucket. QueryIsPriceChanged(context.Context, *QueryIsPriceChangedRequest) (*QueryIsPriceChangedResponse, error) + // Queries whether some members are in the group. + QueryGroupMembersExist(context.Context, *QueryGroupMembersExistRequest) (*QueryGroupMembersExistResponse, error) + // Queries whether some groups are exist. + QueryGroupsExist(context.Context, *QueryGroupsExistRequest) (*QueryGroupsExistResponse, error) + // Queries whether some groups are exist by id. + QueryGroupsExistById(context.Context, *QueryGroupsExistByIdRequest) (*QueryGroupsExistResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2471,6 +2768,15 @@ func (*UnimplementedQueryServer) HeadBucketExtra(ctx context.Context, req *Query func (*UnimplementedQueryServer) QueryIsPriceChanged(ctx context.Context, req *QueryIsPriceChangedRequest) (*QueryIsPriceChangedResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryIsPriceChanged not implemented") } +func (*UnimplementedQueryServer) QueryGroupMembersExist(ctx context.Context, req *QueryGroupMembersExistRequest) (*QueryGroupMembersExistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGroupMembersExist not implemented") +} +func (*UnimplementedQueryServer) QueryGroupsExist(ctx context.Context, req *QueryGroupsExistRequest) (*QueryGroupsExistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGroupsExist not implemented") +} +func (*UnimplementedQueryServer) QueryGroupsExistById(ctx context.Context, req *QueryGroupsExistByIdRequest) (*QueryGroupsExistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGroupsExistById not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2872,6 +3178,60 @@ func _Query_QueryIsPriceChanged_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Query_QueryGroupMembersExist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGroupMembersExistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryGroupMembersExist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.storage.Query/QueryGroupMembersExist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryGroupMembersExist(ctx, req.(*QueryGroupMembersExistRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryGroupsExist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGroupsExistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryGroupsExist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.storage.Query/QueryGroupsExist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryGroupsExist(ctx, req.(*QueryGroupsExistRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryGroupsExistById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGroupsExistByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryGroupsExistById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.storage.Query/QueryGroupsExistById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryGroupsExistById(ctx, req.(*QueryGroupsExistByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "greenfield.storage.Query", HandlerType: (*QueryServer)(nil), @@ -2964,6 +3324,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryIsPriceChanged", Handler: _Query_QueryIsPriceChanged_Handler, }, + { + MethodName: "QueryGroupMembersExist", + Handler: _Query_QueryGroupMembersExist_Handler, + }, + { + MethodName: "QueryGroupsExist", + Handler: _Query_QueryGroupsExist_Handler, + }, + { + MethodName: "QueryGroupsExistById", + Handler: _Query_QueryGroupsExistById_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "greenfield/storage/query.proto", @@ -4456,35 +4828,235 @@ func (m *QueryIsPriceChangedResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryGroupMembersExistRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryGroupMembersExistRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupMembersExistRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + if len(m.Members) > 0 { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Members[iNdEx]) + copy(dAtA[i:], m.Members[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Members[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.GroupId) > 0 { + i -= len(m.GroupId) + copy(dAtA[i:], m.GroupId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GroupId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGroupMembersExistResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil +} + +func (m *QueryGroupMembersExistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupMembersExistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Exists) > 0 { + for k := range m.Exists { + v := m.Exists[k] + baseI := i + i-- + if v { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGroupsExistRequest) 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 *QueryGroupsExistRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupsExistRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GroupNames) > 0 { + for iNdEx := len(m.GroupNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GroupNames[iNdEx]) + copy(dAtA[i:], m.GroupNames[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GroupNames[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.GroupOwner) > 0 { + i -= len(m.GroupOwner) + copy(dAtA[i:], m.GroupOwner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GroupOwner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGroupsExistByIdRequest) 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 *QueryGroupsExistByIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupsExistByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GroupIds) > 0 { + for iNdEx := len(m.GroupIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GroupIds[iNdEx]) + copy(dAtA[i:], m.GroupIds[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GroupIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGroupsExistResponse) 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 *QueryGroupsExistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupsExistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Exists) > 0 { + for k := range m.Exists { + v := m.Exists[k] + baseI := i + i-- + if v { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n } func (m *QueryParamsByTimestampRequest) Size() (n int) { @@ -5052,6 +5624,93 @@ func (m *QueryIsPriceChangedResponse) Size() (n int) { return n } +func (m *QueryGroupMembersExistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GroupId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Members) > 0 { + for _, s := range m.Members { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGroupMembersExistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Exists) > 0 { + for k, v := range m.Exists { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + 1 + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryGroupsExistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GroupOwner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.GroupNames) > 0 { + for _, s := range m.GroupNames { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGroupsExistByIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GroupIds) > 0 { + for _, s := range m.GroupIds { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGroupsExistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Exists) > 0 { + for k, v := range m.Exists { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + 1 + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -9081,6 +9740,646 @@ func (m *QueryIsPriceChangedResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGroupMembersExistRequest) 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: QueryGroupMembersExistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupMembersExistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", 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.GroupId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Members", 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.Members = append(m.Members, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + 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 *QueryGroupMembersExistResponse) 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: QueryGroupMembersExistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupMembersExistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exists == nil { + m.Exists = make(map[string]bool) + } + var mapkey string + var mapvalue bool + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapvaluetemp int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvaluetemp |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + mapvalue = bool(mapvaluetemp != 0) + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Exists[mapkey] = mapvalue + iNdEx = postIndex + 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 *QueryGroupsExistRequest) 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: QueryGroupsExistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupsExistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupOwner", 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.GroupOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupNames", 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.GroupNames = append(m.GroupNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + 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 *QueryGroupsExistByIdRequest) 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: QueryGroupsExistByIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupsExistByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupIds", 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.GroupIds = append(m.GroupIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + 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 *QueryGroupsExistResponse) 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: QueryGroupsExistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupsExistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exists == nil { + m.Exists = make(map[string]bool) + } + var mapkey string + var mapvalue bool + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapvaluetemp int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvaluetemp |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + mapvalue = bool(mapvaluetemp != 0) + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Exists[mapkey] = mapvalue + iNdEx = postIndex + 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 f66bbd84e..6707fddf8 100644 --- a/x/storage/types/query.pb.gw.go +++ b/x/storage/types/query.pb.gw.go @@ -1342,6 +1342,212 @@ func local_request_Query_QueryIsPriceChanged_0(ctx context.Context, marshaler ru } +func request_Query_QueryGroupMembersExist_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupMembersExistRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_id") + } + + protoReq.GroupId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_id", err) + } + + val, ok = pathParams["members"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "members") + } + + protoReq.Members, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "members", err) + } + + msg, err := client.QueryGroupMembersExist(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryGroupMembersExist_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupMembersExistRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_id") + } + + protoReq.GroupId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_id", err) + } + + val, ok = pathParams["members"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "members") + } + + protoReq.Members, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "members", err) + } + + msg, err := server.QueryGroupMembersExist(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryGroupsExist_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsExistRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_owner") + } + + protoReq.GroupOwner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_owner", err) + } + + val, ok = pathParams["group_names"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_names") + } + + protoReq.GroupNames, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_names", err) + } + + msg, err := client.QueryGroupsExist(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryGroupsExist_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsExistRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_owner") + } + + protoReq.GroupOwner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_owner", err) + } + + val, ok = pathParams["group_names"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_names") + } + + protoReq.GroupNames, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_names", err) + } + + msg, err := server.QueryGroupsExist(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryGroupsExistById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsExistByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_ids"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_ids") + } + + protoReq.GroupIds, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_ids", err) + } + + msg, err := client.QueryGroupsExistById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryGroupsExistById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsExistByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["group_ids"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group_ids") + } + + protoReq.GroupIds, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group_ids", err) + } + + msg, err := server.QueryGroupsExistById(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. @@ -1854,6 +2060,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryGroupMembersExist_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_QueryGroupMembersExist_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_QueryGroupMembersExist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGroupsExist_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_QueryGroupsExist_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_QueryGroupsExist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGroupsExistById_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_QueryGroupsExistById_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_QueryGroupsExistById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2335,6 +2610,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryGroupMembersExist_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_QueryGroupMembersExist_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_QueryGroupMembersExist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGroupsExist_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_QueryGroupsExist_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_QueryGroupsExist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGroupsExistById_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_QueryGroupsExistById_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_QueryGroupsExistById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2382,6 +2717,12 @@ var ( pattern_Query_HeadBucketExtra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"greenfield", "storage", "head_bucket_extra", "bucket_name"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryIsPriceChanged_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"greenfield", "storage", "is_price_changed", "bucket_name"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryGroupMembersExist_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"greenfield", "storage", "group_members_exist", "group_id", "members"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryGroupsExist_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"greenfield", "storage", "groups_exist", "group_owner", "group_names"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryGroupsExistById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"greenfield", "storage", "groups_exist_by_id", "group_ids"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -2428,4 +2769,10 @@ var ( forward_Query_HeadBucketExtra_0 = runtime.ForwardResponseMessage forward_Query_QueryIsPriceChanged_0 = runtime.ForwardResponseMessage + + forward_Query_QueryGroupMembersExist_0 = runtime.ForwardResponseMessage + + forward_Query_QueryGroupsExist_0 = runtime.ForwardResponseMessage + + forward_Query_QueryGroupsExistById_0 = runtime.ForwardResponseMessage ) From 736af7f2884aac8d38cd2ff38de38fd0b3b25876 Mon Sep 17 00:00:00 2001 From: Roshan Date: Tue, 1 Aug 2023 16:06:37 +0800 Subject: [PATCH 2/3] fix wrong error msg --- x/storage/keeper/grpc_query.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go index 24009e97c..29dbcd424 100644 --- a/x/storage/keeper/grpc_query.go +++ b/x/storage/keeper/grpc_query.go @@ -279,7 +279,7 @@ func (k Keeper) HeadGroupNFT(goCtx context.Context, req *types.QueryNFTRequest) ctx := sdk.UnwrapSDKContext(goCtx) groupInfo, found := k.GetGroupInfoById(ctx, id) if !found { - return nil, types.ErrNoSuchObject + return nil, types.ErrNoSuchGroup } return &types.QueryGroupNFTResponse{ MetaData: groupInfo.ToNFTMetadata(), @@ -375,7 +375,7 @@ func validateAndGetId(req *types.QueryNFTRequest) (math.Uint, error) { } func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPolicyForAccountRequest) (*types. - QueryPolicyForAccountResponse, +QueryPolicyForAccountResponse, error, ) { if req == nil { @@ -403,7 +403,7 @@ func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPol } func (k Keeper) QueryPolicyForGroup(goCtx context.Context, req *types.QueryPolicyForGroupRequest) (*types. - QueryPolicyForGroupResponse, error, +QueryPolicyForGroupResponse, error, ) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -547,7 +547,7 @@ func (k Keeper) HeadGroupMember(goCtx context.Context, req *types.QueryHeadGroup } func (k Keeper) QueryPolicyById(goCtx context.Context, req *types.QueryPolicyByIdRequest) (*types. - QueryPolicyByIdResponse, error, +QueryPolicyByIdResponse, error, ) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") From cefb6474ec791f8bc6e13b5d929d8d9d15e459f3 Mon Sep 17 00:00:00 2001 From: Roshan Date: Tue, 1 Aug 2023 16:10:21 +0800 Subject: [PATCH 3/3] fix lint issue --- x/storage/keeper/grpc_query.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go index 29dbcd424..f4affc3d8 100644 --- a/x/storage/keeper/grpc_query.go +++ b/x/storage/keeper/grpc_query.go @@ -375,7 +375,7 @@ func validateAndGetId(req *types.QueryNFTRequest) (math.Uint, error) { } func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPolicyForAccountRequest) (*types. -QueryPolicyForAccountResponse, + QueryPolicyForAccountResponse, error, ) { if req == nil { @@ -403,7 +403,7 @@ QueryPolicyForAccountResponse, } func (k Keeper) QueryPolicyForGroup(goCtx context.Context, req *types.QueryPolicyForGroupRequest) (*types. -QueryPolicyForGroupResponse, error, + QueryPolicyForGroupResponse, error, ) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -547,7 +547,7 @@ func (k Keeper) HeadGroupMember(goCtx context.Context, req *types.QueryHeadGroup } func (k Keeper) QueryPolicyById(goCtx context.Context, req *types.QueryPolicyByIdRequest) (*types. -QueryPolicyByIdResponse, error, + QueryPolicyByIdResponse, error, ) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request")