Skip to content

Commit

Permalink
use notfound instead keynotfound err
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Nov 5, 2024
1 parent 6c96918 commit c9125bb
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion x/claim/keeper/query_claim_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down
2 changes: 1 addition & 1 deletion x/claim/keeper/query_mission.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions x/claim/keeper/query_mission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion x/fundraising/keeper/query_allowed_bidder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion x/fundraising/keeper/query_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions x/fundraising/keeper/query_auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion x/fundraising/keeper/query_bid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions x/fundraising/keeper/query_bid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c9125bb

Please sign in to comment.