Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Aug 14, 2024
1 parent 1e4d7cd commit 2d88bcd
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions x/marketplace/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package keeper

import (
"context"
"fmt"
"time"

"cosmossdk.io/store/prefix"
Expand All @@ -26,7 +25,7 @@ func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types

func (k Keeper) Listing(goCtx context.Context, req *types.QueryListingRequest) (*types.QueryListingResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand All @@ -40,7 +39,7 @@ func (k Keeper) Listing(goCtx context.Context, req *types.QueryListingRequest) (

func (k Keeper) Listings(goCtx context.Context, req *types.QueryListingsRequest) (*types.QueryListingsResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand All @@ -53,7 +52,7 @@ func (k Keeper) Listings(goCtx context.Context, req *types.QueryListingsRequest)
if len(req.Owner) > 0 {
owner, err = sdk.AccAddressFromBech32(req.Owner)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid owner address (%s)", err))
return nil, status.Errorf(codes.InvalidArgument, "invalid owner address (%s)", err)
}
listingStore := prefix.NewStore(store, append(types.PrefixListingOwner, owner.Bytes()...))
pageRes, err = query.Paginate(listingStore, req.Pagination, func(key []byte, value []byte) error {
Expand Down Expand Up @@ -105,7 +104,7 @@ func (k Keeper) ListingsByOwner(goCtx context.Context, req *types.QueryListingsB
if len(req.Owner) > 0 {
owner, err = sdk.AccAddressFromBech32(req.Owner)
if err != nil || owner == nil {
return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid owner address (%s)", err))
return nil, status.Errorf(codes.InvalidArgument, "invalid owner address (%s)", err)
}
}

Expand Down Expand Up @@ -266,7 +265,7 @@ func (k Keeper) AuctionsByOwner(goCtx context.Context, req *types.QueryAuctionsB
if len(req.Owner) > 0 {
owner, err = sdk.AccAddressFromBech32(req.Owner)
if err != nil || owner == nil {
return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid owner address (%s)", err))
return nil, status.Errorf(codes.InvalidArgument, "invalid owner address (%s)", err)
}
}

Expand All @@ -293,7 +292,7 @@ func (k Keeper) AuctionsByOwner(goCtx context.Context, req *types.QueryAuctionsB

func (k Keeper) AuctionsByPriceDenom(goCtx context.Context, req *types.QueryAuctionsByPriceDenomRequest) (*types.QueryAuctionsResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand Down Expand Up @@ -322,10 +321,10 @@ func (k Keeper) AuctionsByPriceDenom(goCtx context.Context, req *types.QueryAuct

func (k Keeper) AuctionByNftId(goCtx context.Context, req *types.QueryAuctionByNFTIDRequest) (*types.QueryAuctionResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}
if req.NftId == "" {
return nil, status.Errorf(codes.InvalidArgument, "need nft id to request")
return nil, status.Error(codes.InvalidArgument, "need nft id to request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand All @@ -339,12 +338,12 @@ func (k Keeper) AuctionByNftId(goCtx context.Context, req *types.QueryAuctionByN
}
return auction, nil
}
return nil, status.Errorf(codes.NotFound, "auction not found with given nft id")
return nil, status.Error(codes.NotFound, "auction not found with given nft id")
}

func (k Keeper) Bid(goCtx context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand All @@ -357,7 +356,7 @@ func (k Keeper) Bid(goCtx context.Context, req *types.QueryBidRequest) (*types.Q

func (k Keeper) Bids(goCtx context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error) {
if req == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
return nil, status.Error(codes.InvalidArgument, "empty request")
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand Down

0 comments on commit 2d88bcd

Please sign in to comment.