Skip to content

Commit

Permalink
chore: remove non-core queries
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Feb 8, 2022
1 parent 8b6960d commit 9bdcd8a
Showing 1 changed file with 0 additions and 218 deletions.
218 changes: 0 additions & 218 deletions x/ecocredit/server/core/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,221 +419,3 @@ func (s serverImpl) Params(ctx context.Context, _ *v1beta1.QueryParamsRequest) (
}
return &v1beta1.QueryParamsResponse{Params: &v1beta1Params}, nil
}

// SellOrder queries for information about a sell order by its ID
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) SellOrder(goCtx context.Context, request *ecocredit.QuerySellOrderRequest) (*ecocredit.QuerySellOrderResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//sellOrder, err := s.getSellOrder(ctx, request.SellOrderId)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QuerySellOrderResponse{SellOrder: sellOrder}, nil
}

// SellOrders queries for all sell orders with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) SellOrders(goCtx context.Context, request *ecocredit.QuerySellOrdersRequest) (*ecocredit.QuerySellOrdersResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//ordersIter, err := s.sellOrderTable.PrefixScan(ctx, 1, math.MaxUint64)
//if err != nil {
// return nil, err
//}
//
//var orders []*ecocredit.SellOrder
//pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QuerySellOrdersResponse{
// SellOrders: orders,
// Pagination: pageResp,
//}, nil
}

// SellOrdersByAddress queries for all sell orders by address with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) SellOrdersByAddress(goCtx context.Context, request *ecocredit.QuerySellOrdersByAddressRequest) (*ecocredit.QuerySellOrdersByAddressResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//addr, err := sdk.AccAddressFromBech32(request.Address)
//if err != nil {
// return nil, err
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//ordersIter, err := s.sellOrderByAddressIndex.GetPaginated(ctx, addr.Bytes(), request.Pagination)
//if err != nil {
// return nil, err
//}
//
//var orders []*ecocredit.SellOrder
//pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QuerySellOrdersByAddressResponse{
// SellOrders: orders,
// Pagination: pageResp,
//}, nil
}

// SellOrdersByBatchDenom queries for all sell orders by address with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) SellOrdersByBatchDenom(goCtx context.Context, request *ecocredit.QuerySellOrdersByBatchDenomRequest) (*ecocredit.QuerySellOrdersByBatchDenomResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//if err := ecocredit.ValidateDenom(request.BatchDenom); err != nil {
// return nil, err
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//ordersIter, err := s.sellOrderByBatchDenomIndex.GetPaginated(ctx, request.BatchDenom, request.Pagination)
//if err != nil {
// return nil, err
//}
//
//var orders []*ecocredit.SellOrder
//pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QuerySellOrdersByBatchDenomResponse{
// SellOrders: orders,
// Pagination: pageResp,
//}, nil
}

// BuyOrder queries for information about a buy order by its ID
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) BuyOrder(goCtx context.Context, request *ecocredit.QueryBuyOrderRequest) (*ecocredit.QueryBuyOrderResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//buyOrder, err := s.getBuyOrder(ctx, request.BuyOrderId)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QueryBuyOrderResponse{BuyOrder: buyOrder}, nil
}

// BuyOrders queries for all buy orders with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) BuyOrders(goCtx context.Context, request *ecocredit.QueryBuyOrdersRequest) (*ecocredit.QueryBuyOrdersResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//ordersIter, err := s.buyOrderTable.PrefixScan(ctx, 1, math.MaxUint64)
//if err != nil {
// return nil, err
//}
//
//var orders []*ecocredit.BuyOrder
//pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QueryBuyOrdersResponse{
// BuyOrders: orders,
// Pagination: pageResp,
//}, nil
}

// BuyOrdersByAddress queries for all buy orders by address with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) BuyOrdersByAddress(goCtx context.Context, request *ecocredit.QueryBuyOrdersByAddressRequest) (*ecocredit.QueryBuyOrdersByAddressResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//addr, err := sdk.AccAddressFromBech32(request.Address)
//if err != nil {
// return nil, err
//}
//
//ordersIter, err := s.buyOrderByAddressIndex.GetPaginated(ctx, addr.Bytes(), request.Pagination)
//if err != nil {
// return nil, err
//}
//
//var orders []*ecocredit.BuyOrder
//pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QueryBuyOrdersByAddressResponse{
// BuyOrders: orders,
// Pagination: pageResp,
//}, nil
}

// AllowedAskDenoms queries for all allowed ask denoms with pagination.
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
func (s serverImpl) AllowedAskDenoms(goCtx context.Context, request *ecocredit.QueryAllowedAskDenomsRequest) (*ecocredit.QueryAllowedAskDenomsResponse, error) {
panic("impl me!")
//if request == nil {
// return nil, status.Errorf(codes.InvalidArgument, "empty request")
//}
//
//ctx := types.UnwrapSDKContext(goCtx)
//denomsIter, err := s.askDenomTable.PrefixScan(ctx, nil, nil)
//if err != nil {
// return nil, err
//}
//
//var denoms []*ecocredit.AskDenom
//pageResp, err := orm.Paginate(denomsIter, request.Pagination, &denoms)
//if err != nil {
// return nil, err
//}
//
//return &ecocredit.QueryAllowedAskDenomsResponse{
// AskDenoms: denoms,
// Pagination: pageResp,
//}, nil
}

// TODO: baskets PR queries

func (s serverImpl) Basket(ctx context.Context, request *ecocredit.QueryBasketRequest) (*ecocredit.QueryBasketResponse, error) {
panic("implement me")
}

func (s serverImpl) Baskets(ctx context.Context, request *ecocredit.QueryBasketsRequest) (*ecocredit.QueryBasketsResponse, error) {
panic("implement me")
}

func (s serverImpl) BasketCredits(ctx context.Context, request *ecocredit.QueryBasketCreditsRequest) (*ecocredit.QueryBasketCreditsResponse, error) {
panic("implement me")
}

0 comments on commit 9bdcd8a

Please sign in to comment.