mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 06:54:25 -08:00
scaffold auction-bids query
This commit is contained in:
@@ -28,6 +28,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
|
||||
cmd.AddCommand(CmdShowNextAuction())
|
||||
cmd.AddCommand(CmdListAuction())
|
||||
cmd.AddCommand(CmdShowAuction())
|
||||
cmd.AddCommand(CmdAuctionBids())
|
||||
|
||||
// this line is used by starport scaffolding # 1
|
||||
|
||||
return cmd
|
||||
|
||||
46
x/cosmostest/client/cli/query_auction_bids.go
Normal file
46
x/cosmostest/client/cli/query_auction_bids.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"cosmos-test/x/cosmostest/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdAuctionBids() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "auction-bids [index]",
|
||||
Short: "Query auctionBids",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
reqIndex := args[0]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryClient := types.NewQueryClient(clientCtx)
|
||||
|
||||
params := &types.QueryAuctionBidsRequest{
|
||||
|
||||
Index: reqIndex,
|
||||
}
|
||||
|
||||
res, err := queryClient.AuctionBids(cmd.Context(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintProto(res)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user