gpu-compute-chain/x/cosmostest/client/cli/query_auction_bids.go

47 lines
856 B
Go
Raw Normal View History

2022-08-30 14:27:12 -07:00
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
}