mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-06 21:34:26 -08:00
query: pending bids for auction
This commit is contained in:
@@ -2,8 +2,11 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"cosmos-test/x/cosmostest/memdb"
|
||||
"cosmos-test/x/cosmostest/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -16,8 +19,15 @@ func (k Keeper) AuctionBids(goCtx context.Context, req *types.QueryAuctionBidsRe
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
// TODO: Process the query
|
||||
_ = ctx
|
||||
auction, found := k.GetAuction(ctx, req.Index)
|
||||
if !found {
|
||||
return nil, fmt.Errorf("auction %s not found", req.Index)
|
||||
}
|
||||
|
||||
return &types.QueryAuctionBidsResponse{}, nil
|
||||
bids, err := memdb.BidDB.GetBids(auction.Index)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get bids for auction %s:", err)
|
||||
}
|
||||
|
||||
return &types.QueryAuctionBidsResponse{Bids: bids}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user