From c9125bb03da3fdbff6f8abfbc9a5a39f4e2fb0d5 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Tue, 5 Nov 2024 01:45:58 -0300 Subject: [PATCH] use notfound instead keynotfound err --- x/claim/keeper/query_claim_record_test.go | 2 +- x/claim/keeper/query_mission.go | 2 +- x/claim/keeper/query_mission_test.go | 4 ++-- x/fundraising/keeper/query_allowed_bidder_test.go | 2 +- x/fundraising/keeper/query_auction.go | 2 +- x/fundraising/keeper/query_auction_test.go | 4 ++-- x/fundraising/keeper/query_bid.go | 2 +- x/fundraising/keeper/query_bid_test.go | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/x/claim/keeper/query_claim_record_test.go b/x/claim/keeper/query_claim_record_test.go index 7e12e66..860ee16 100644 --- a/x/claim/keeper/query_claim_record_test.go +++ b/x/claim/keeper/query_claim_record_test.go @@ -55,7 +55,7 @@ func TestClaimRecordQuerySingle(t *testing.T) { response: &types.QueryGetClaimRecordResponse{ClaimRecord: msgs[1]}, }, { - desc: "KeyNotFound", + desc: "NotFound", request: &types.QueryGetClaimRecordRequest{ Address: strconv.Itoa(100000), }, diff --git a/x/claim/keeper/query_mission.go b/x/claim/keeper/query_mission.go index e1f30d8..020a36b 100644 --- a/x/claim/keeper/query_mission.go +++ b/x/claim/keeper/query_mission.go @@ -41,7 +41,7 @@ func (q queryServer) GetMission(ctx context.Context, req *types.QueryGetMissionR mission, err := q.k.Mission.Get(ctx, req.MissionId) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return nil, sdkerrors.ErrKeyNotFound + return nil, sdkerrors.ErrNotFound } return nil, status.Error(codes.Internal, "internal error") diff --git a/x/claim/keeper/query_mission_test.go b/x/claim/keeper/query_mission_test.go index 61d206c..32854cb 100644 --- a/x/claim/keeper/query_mission_test.go +++ b/x/claim/keeper/query_mission_test.go @@ -50,9 +50,9 @@ func TestMissionQuerySingle(t *testing.T) { response: &types.QueryGetMissionResponse{Mission: msgs[1]}, }, { - desc: "KeyNotFound", + desc: "NotFound", request: &types.QueryGetMissionRequest{MissionId: uint64(len(msgs))}, - err: sdkerrors.ErrKeyNotFound, + err: sdkerrors.ErrNotFound, }, { desc: "InvalidRequest", diff --git a/x/fundraising/keeper/query_allowed_bidder_test.go b/x/fundraising/keeper/query_allowed_bidder_test.go index 4050f68..8922252 100644 --- a/x/fundraising/keeper/query_allowed_bidder_test.go +++ b/x/fundraising/keeper/query_allowed_bidder_test.go @@ -62,7 +62,7 @@ func TestAllowedBidderQuerySingle(t *testing.T) { response: &types.QueryGetAllowedBidderResponse{AllowedBidder: msgs[1]}, }, { - desc: "KeyNotFound", + desc: "NotFound", request: &types.QueryGetAllowedBidderRequest{ AuctionId: 100000, Bidder: sample.Address(r), diff --git a/x/fundraising/keeper/query_auction.go b/x/fundraising/keeper/query_auction.go index 1debdaa..0d3eefd 100644 --- a/x/fundraising/keeper/query_auction.go +++ b/x/fundraising/keeper/query_auction.go @@ -67,7 +67,7 @@ func (q queryServer) GetAuction(ctx context.Context, req *types.QueryGetAuctionR auction, err := q.k.Auction.Get(ctx, req.AuctionId) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return nil, sdkerrors.ErrKeyNotFound + return nil, sdkerrors.ErrNotFound } return nil, status.Error(codes.Internal, "internal error") diff --git a/x/fundraising/keeper/query_auction_test.go b/x/fundraising/keeper/query_auction_test.go index 58456f1..9ca7068 100644 --- a/x/fundraising/keeper/query_auction_test.go +++ b/x/fundraising/keeper/query_auction_test.go @@ -78,9 +78,9 @@ func TestAuctionQuerySingle(t *testing.T) { response: &types.QueryGetAuctionResponse{Auction: msgs[1]}, }, { - desc: "KeyNotFound", + desc: "NotFound", request: &types.QueryGetAuctionRequest{AuctionId: uint64(len(msgs))}, - err: sdkerrors.ErrKeyNotFound, + err: sdkerrors.ErrNotFound, }, { desc: "InvalidRequest", diff --git a/x/fundraising/keeper/query_bid.go b/x/fundraising/keeper/query_bid.go index d63e8fe..3d1b55f 100644 --- a/x/fundraising/keeper/query_bid.go +++ b/x/fundraising/keeper/query_bid.go @@ -41,7 +41,7 @@ func (q queryServer) GetBid(ctx context.Context, req *types.QueryGetBidRequest) bid, err := q.k.Bid.Get(ctx, collections.Join(req.AuctionId, req.BidId)) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return nil, sdkerrors.ErrKeyNotFound + return nil, sdkerrors.ErrNotFound } return nil, status.Error(codes.Internal, "internal error") diff --git a/x/fundraising/keeper/query_bid_test.go b/x/fundraising/keeper/query_bid_test.go index d1a2827..f13e31e 100644 --- a/x/fundraising/keeper/query_bid_test.go +++ b/x/fundraising/keeper/query_bid_test.go @@ -65,9 +65,9 @@ func TestBidQuerySingle(t *testing.T) { response: &types.QueryGetBidResponse{Bid: msgs[1]}, }, { - desc: "KeyNotFound", + desc: "NotFound", request: &types.QueryGetBidRequest{AuctionId: 0, BidId: uint64(len(msgs))}, - err: sdkerrors.ErrKeyNotFound, + err: sdkerrors.ErrNotFound, }, { desc: "InvalidRequest",