mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 19:04:26 -08:00
scaffold generalized ongoing auction info query
This commit is contained in:
@@ -33,6 +33,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
|
||||
cmd.AddCommand(CmdShowLockedUsers())
|
||||
cmd.AddCommand(CmdLockedFunds())
|
||||
|
||||
cmd.AddCommand(CmdAuctionInfo())
|
||||
|
||||
// this line is used by starport scaffolding # 1
|
||||
|
||||
return cmd
|
||||
|
||||
46
x/colinearcore/client/cli/query_auction_info.go
Normal file
46
x/colinearcore/client/cli/query_auction_info.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"colinear/x/colinearcore/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdAuctionInfo() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "auction-info [auction-id]",
|
||||
Short: "Query auctionInfo",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
reqAuctionId := args[0]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryClient := types.NewQueryClient(clientCtx)
|
||||
|
||||
params := &types.QueryAuctionInfoRequest{
|
||||
|
||||
AuctionId: reqAuctionId,
|
||||
}
|
||||
|
||||
res, err := queryClient.AuctionInfo(cmd.Context(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintProto(res)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user