Skip to content

Commit 4823880

Browse files
authored
chore: use notFound error instead KeyNotFound error (#113)
1 parent 6c96918 commit 4823880

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

x/claim/keeper/query_claim_record_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestClaimRecordQuerySingle(t *testing.T) {
5555
response: &types.QueryGetClaimRecordResponse{ClaimRecord: msgs[1]},
5656
},
5757
{
58-
desc: "KeyNotFound",
58+
desc: "NotFound",
5959
request: &types.QueryGetClaimRecordRequest{
6060
Address: strconv.Itoa(100000),
6161
},

x/claim/keeper/query_mission.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (q queryServer) GetMission(ctx context.Context, req *types.QueryGetMissionR
4141
mission, err := q.k.Mission.Get(ctx, req.MissionId)
4242
if err != nil {
4343
if errors.Is(err, collections.ErrNotFound) {
44-
return nil, sdkerrors.ErrKeyNotFound
44+
return nil, sdkerrors.ErrNotFound
4545
}
4646

4747
return nil, status.Error(codes.Internal, "internal error")

x/claim/keeper/query_mission_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ func TestMissionQuerySingle(t *testing.T) {
5050
response: &types.QueryGetMissionResponse{Mission: msgs[1]},
5151
},
5252
{
53-
desc: "KeyNotFound",
53+
desc: "NotFound",
5454
request: &types.QueryGetMissionRequest{MissionId: uint64(len(msgs))},
55-
err: sdkerrors.ErrKeyNotFound,
55+
err: sdkerrors.ErrNotFound,
5656
},
5757
{
5858
desc: "InvalidRequest",

x/fundraising/keeper/query_allowed_bidder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestAllowedBidderQuerySingle(t *testing.T) {
6262
response: &types.QueryGetAllowedBidderResponse{AllowedBidder: msgs[1]},
6363
},
6464
{
65-
desc: "KeyNotFound",
65+
desc: "NotFound",
6666
request: &types.QueryGetAllowedBidderRequest{
6767
AuctionId: 100000,
6868
Bidder: sample.Address(r),

x/fundraising/keeper/query_auction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (q queryServer) GetAuction(ctx context.Context, req *types.QueryGetAuctionR
6767
auction, err := q.k.Auction.Get(ctx, req.AuctionId)
6868
if err != nil {
6969
if errors.Is(err, collections.ErrNotFound) {
70-
return nil, sdkerrors.ErrKeyNotFound
70+
return nil, sdkerrors.ErrNotFound
7171
}
7272

7373
return nil, status.Error(codes.Internal, "internal error")

x/fundraising/keeper/query_auction_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func TestAuctionQuerySingle(t *testing.T) {
7878
response: &types.QueryGetAuctionResponse{Auction: msgs[1]},
7979
},
8080
{
81-
desc: "KeyNotFound",
81+
desc: "NotFound",
8282
request: &types.QueryGetAuctionRequest{AuctionId: uint64(len(msgs))},
83-
err: sdkerrors.ErrKeyNotFound,
83+
err: sdkerrors.ErrNotFound,
8484
},
8585
{
8686
desc: "InvalidRequest",

x/fundraising/keeper/query_bid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (q queryServer) GetBid(ctx context.Context, req *types.QueryGetBidRequest)
4141
bid, err := q.k.Bid.Get(ctx, collections.Join(req.AuctionId, req.BidId))
4242
if err != nil {
4343
if errors.Is(err, collections.ErrNotFound) {
44-
return nil, sdkerrors.ErrKeyNotFound
44+
return nil, sdkerrors.ErrNotFound
4545
}
4646

4747
return nil, status.Error(codes.Internal, "internal error")

x/fundraising/keeper/query_bid_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ func TestBidQuerySingle(t *testing.T) {
6565
response: &types.QueryGetBidResponse{Bid: msgs[1]},
6666
},
6767
{
68-
desc: "KeyNotFound",
68+
desc: "NotFound",
6969
request: &types.QueryGetBidRequest{AuctionId: 0, BidId: uint64(len(msgs))},
70-
err: sdkerrors.ErrKeyNotFound,
70+
err: sdkerrors.ErrNotFound,
7171
},
7272
{
7373
desc: "InvalidRequest",

0 commit comments

Comments
 (0)