Skip to content

Commit

Permalink
clean up sell order by seller
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanchristo committed Jun 3, 2022
1 parent 22d7870 commit 92760d5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions x/ecocredit/client/marketplace/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ $ regen q sell-orders --pagination.limit 10 --pagination.offset 2
return cmd
}

// QuerySellOrdersByAddressCmd returns a query command that retrieves all sell orders by address with pagination.
func QuerySellOrdersByAddressCmd() *cobra.Command {
// QuerySellOrdersBySellerCmd returns a query command that retrieves all sell orders by address with pagination.
func QuerySellOrdersBySellerCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "sell-orders-by-seller [address]",
Use: "sell-orders-by-seller [seller]",
Short: "List all sell orders by seller address with pagination",
Long: strings.TrimSpace(
`Retrieve sell orders by seller address with pagination
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func QueryCmd(name string) *cobra.Command {
basketcli.QueryBasketBalancesCmd(),
marketplacecli.QuerySellOrderCmd(),
marketplacecli.QuerySellOrdersCmd(),
marketplacecli.QuerySellOrdersByAddressCmd(),
marketplacecli.QuerySellOrdersBySellerCmd(),
marketplacecli.QuerySellOrdersByBatchDenomCmd(),
marketplacecli.QueryAllowedDenomsCmd(),
)
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/client/testsuite/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (s *IntegrationTestSuite) TestQuerySellOrdersByBatchDenom() {
}
}

func (s *IntegrationTestSuite) TestQuerySellOrdersByAddress() {
func (s *IntegrationTestSuite) TestQuerySellOrdersBySeller() {
val := s.network.Validators[0]
_, _, batchDenom := s.createClassProjectBatch(val.ClientCtx, val.Address.String())
validAsk := types.NewInt64Coin(types.DefaultBondDenom, 10)
Expand Down
4 changes: 2 additions & 2 deletions x/ecocredit/client/testsuite/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ func (s *IntegrationTestSuite) TestQuerySellOrdersCmd() {
}
}

func (s *IntegrationTestSuite) TestQuerySellOrdersByAddressCmd() {
func (s *IntegrationTestSuite) TestQuerySellOrdersBySellerCmd() {
val := s.network.Validators[0]
clientCtx := val.ClientCtx
clientCtx.OutputFormat = "JSON"
Expand Down Expand Up @@ -748,7 +748,7 @@ func (s *IntegrationTestSuite) TestQuerySellOrdersByAddressCmd() {

for _, tc := range testCases {
s.Run(tc.name, func() {
cmd := marketplaceclient.QuerySellOrdersByAddressCmd()
cmd := marketplaceclient.QuerySellOrdersBySellerCmd()
out, err := cli.ExecTestCLICmd(clientCtx, cmd, tc.args)
if tc.expErr {
s.Require().Error(err)
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/server/marketplace/query_sell_orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (k Keeper) SellOrdersByBatchDenom(ctx context.Context, req *marketplace.Que
return &marketplace.QuerySellOrdersByBatchDenomResponse{SellOrders: orders, Pagination: pr}, nil
}

// SellOrdersByAddress queries all sell orders created by the given address with optional pagination
// SellOrdersBySeller queries all sell orders created by the given address with optional pagination
func (k Keeper) SellOrdersBySeller(ctx context.Context, req *marketplace.QuerySellOrdersBySellerRequest) (*marketplace.QuerySellOrdersBySellerResponse, error) {
pg, err := ormutil.GogoPageReqToPulsarPageReq(req.Pagination)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/spec/04_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ For examples on how to query state using gRPC and REST, see the [ecocredit clien
- [AllowedDenoms](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.AllowedDenoms)
- [SellOrder](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.SellOrder)
- [SellOrders](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.SellOrders)
- [SellOrdersByAddress](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.SellOrdersByAddress)
- [SellOrdersBySeller](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.SellOrdersBySeller)
- [SellOrdersByBatchDenom](https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.marketplace.v1#regen.ecocredit.marketplace.v1.Query.SellOrdersByBatchDenom)

0 comments on commit 92760d5

Please sign in to comment.