gpu-compute-chain/x/colinearcore/client/cli/query_locked_funds.go

47 lines
855 B
Go
Raw Normal View History

2022-09-08 14:52:01 -07:00
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 CmdLockedFunds() *cobra.Command {
cmd := &cobra.Command{
Use: "locked-funds [owner]",
Short: "Query lockedFunds",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
reqOwner := args[0]
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
params := &types.QueryLockedFundsRequest{
Owner: reqOwner,
}
res, err := queryClient.LockedFunds(cmd.Context(), params)
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}